Files
AstroJS/k8s/deployments.yaml
T
2026-06-12 13:35:19 +08:00

79 lines
1.6 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: astrojs
spec:
selector:
matchLabels:
app: astrojs
replicas: 1
template:
metadata:
labels:
app: astrojs
spec:
imagePullSecrets:
- name: registry-auth
containers:
- name: web
image: registry.k8s.astropenguin.net/astrojs:IMAGE_TAG
securityContext:
runAsGroup: 1001
runAsNonRoot: true
runAsUser: 1001
env:
- name: CLOSURE_ENDPOINT
value: "http://closure-api.default.svc.cluster.local/compile"
---
apiVersion: v1
kind: Service
metadata:
name: astrojs
spec:
selector:
app: astrojs
ports:
- port: 80
targetPort: 8080
name: http
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: astrojs-http-redirect
spec:
parentRefs:
- name: gateway-prod
namespace: cilium-system
sectionName: http
hostnames:
- "astrojs.k8s.astropenguin.net"
rules:
- filters:
- type: RequestRedirect
requestRedirect:
scheme: https
port: 443
statusCode: 301
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: astrojs-https
spec:
parentRefs:
- name: gateway-prod
namespace: cilium-system
sectionName: k8s-astropenguin-net
hostnames:
- "astrojs.k8s.astropenguin.net"
rules:
- matches:
- path:
type: PathPrefix
value: /
backendRefs:
- name: astrojs
namespace: default
port: 80