AstroJS/k8s/deployments.yaml

116 lines
2.7 KiB
YAML
Raw Normal View History

2020-09-22 17:37:10 +00:00
apiVersion: apps/v1
kind: Deployment
metadata:
name: astrojs
spec:
selector:
matchLabels:
app: astrojs
replicas: 1
template:
metadata:
labels:
app: astrojs
spec:
2022-03-15 16:04:16 +00:00
imagePullSecrets:
- name: registry-auth
initContainers:
- name: init-dir
image: alpine:latest
command:
- chown
- 1001:1001
- /app/cache
volumeMounts:
- name: cache
mountPath: "/app/cache"
2020-09-22 17:37:10 +00:00
containers:
- name: web
2022-07-31 12:29:08 +00:00
image: registry.k8s.astropenguin.net/astrojs:IMAGE_TAG
2022-03-15 18:16:36 +00:00
securityContext:
runAsGroup: 1001
runAsNonRoot: true
runAsUser: 1001
2020-09-22 17:37:10 +00:00
env:
- name: DEBUG
value: "0"
2020-09-22 17:37:10 +00:00
- name: FLASK_DEBUG
value: "0"
- name: FLASK_ENV
value: "production"
- name: RUN_MODE
value: "web"
- name: REDIS_CONN
value: "redis://:@localhost:6379/9"
2022-03-15 16:04:16 +00:00
volumeMounts:
- name: cache
mountPath: "/app/cache"
2022-04-04 17:42:09 +00:00
livenessProbe:
exec:
command:
- sh
- -c
- wget -qO - http://127.0.0.1:5000/rjs/System | grep -q function
2020-09-22 18:03:35 +00:00
- name: redis
image: redis:6.0.8-alpine
2020-09-22 17:37:10 +00:00
- name: compiler
2022-07-31 12:29:08 +00:00
image: registry.k8s.astropenguin.net/astrojs:IMAGE_TAG
2022-03-15 18:16:36 +00:00
securityContext:
runAsGroup: 1001
runAsNonRoot: true
runAsUser: 1001
2020-09-22 17:37:10 +00:00
env:
- name: RUN_MODE
value: "tasks"
- name: DEBUG
value: "0"
- name: REDIS_CONN
value: "redis://:@localhost:6379/9"
2022-03-15 16:04:16 +00:00
volumeMounts:
- name: cache
mountPath: "/app/cache"
2022-03-15 20:28:01 +00:00
- name: assets
image: nginx:alpine
volumeMounts:
- mountPath: "/usr/share/nginx/html"
name: cache
2022-03-20 03:34:42 +00:00
- mountPath: "/etc/nginx/templates"
name: nginx-conf-templates
2022-03-15 16:04:16 +00:00
volumes:
- name: cache
persistentVolumeClaim:
claimName: astrojs-cache
2022-03-20 03:34:42 +00:00
- name: nginx-conf-templates
secret:
secretName: nginx-conf-templates
2022-03-15 16:04:16 +00:00
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: astrojs-cache
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 1Gi
2022-03-15 16:04:16 +00:00
storageClassName: local-storage
2020-09-22 17:37:10 +00:00
---
apiVersion: v1
kind: Service
metadata:
name: astrojs
spec:
selector:
app: astrojs
ports:
- port: 5000
targetPort: 5000
2022-03-15 20:28:01 +00:00
name: application
- port: 80
targetPort: 80
name: files