Update deployment

This commit is contained in:
2026-06-12 13:05:32 +08:00
parent d3072e7e18
commit b97bd85533
12 changed files with 48 additions and 128 deletions
-25
View File
@@ -1,25 +0,0 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: astrojs-nginx-ctmpls
namespace: default
data:
default.conf.template: |
server {
listen 80;
listen [::]:80;
server_name localhost;
expires 10d;
add_header Cache-Control "public";
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
+33 -56
View File
@@ -22,56 +22,8 @@ spec:
runAsNonRoot: true
runAsUser: 1001
env:
- name: DEBUG
value: "0"
volumeMounts:
- name: cache
mountPath: "/app/cache"
livenessProbe:
exec:
command:
- sh
- -c
- wget -qO - http://127.0.0.1:5000/health
- name: redis
image: redis:6.0.8-alpine
- name: compiler
image: registry.k8s.astropenguin.net/closure-api:IMAGE_TAG
securityContext:
runAsNonRoot: true
env:
- name: DEBUG
value: "0"
volumeMounts:
- name: cache
mountPath: "/app/cache"
- name: assets
image: nginx:alpine
volumeMounts:
- mountPath: "/usr/share/nginx/html"
name: cache
- mountPath: "/etc/nginx/templates"
name: nginx-conf-templates
volumes:
- name: cache
persistentVolumeClaim:
claimName: astrojs-cache
- name: nginx-conf-templates
configMap:
name: astrojs-nginx-ctmpls
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: astrojs-cache
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 1Gi
storageClassName: local-storage
- name: CLOSURE_ENDPOINT
value: "http://closure-api.default.svc.cluster.local/compile"
---
@@ -83,9 +35,34 @@ spec:
selector:
app: astrojs
ports:
- port: 5000
targetPort: 5000
name: application
- port: 80
targetPort: 80
name: files
- port: 8080
targetPort: 8080
name: web
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: astrojs
spec:
parentRefs:
- name: gateway-prod
namespace: cilium-system
sectionName: k8s-astropenguin-net
hostnames:
- astrojs.k8s.astropenguin.net
rules:
- matches:
- path:
type: PathPrefix
value: /
filters:
- type: URLRewrite
urlRewrite:
path:
type: ReplaceFullPath
replaceFullPath: /
backendRefs:
- name: astrojs
port: 8080
-33
View File
@@ -1,33 +0,0 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: default-astrojs
namespace: ingress-https
spec:
ingressClassName: nginx
tls:
- hosts:
- astrojs.k8s.astropenguin.net
secretName: any-k8s-astro-prod
rules:
- host: astrojs.k8s.astropenguin.net
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: default-astrojs
port:
number: 5000
---
kind: Service
apiVersion: v1
metadata:
name: default-astrojs
namespace: ingress-https
spec:
type: ExternalName
externalName: astrojs.default.svc.cluster.local