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
|
|
|
securityContext:
|
|
|
|
runAsGroup: 1001
|
|
|
|
runAsNonRoot: true
|
|
|
|
runAsUser: 1001
|
|
|
|
imagePullSecrets:
|
|
|
|
- name: registry-auth
|
2022-03-15 16:27:38 +00:00
|
|
|
initContainers:
|
|
|
|
- name: init-dir
|
|
|
|
image: alpine:latest
|
|
|
|
command:
|
|
|
|
- chown
|
|
|
|
- 1001:1001
|
|
|
|
- /app/cache
|
|
|
|
securityContext:
|
|
|
|
runAsNonRoot: false
|
|
|
|
volumeMounts:
|
|
|
|
- name: cache
|
|
|
|
mountPath: "/app/cache"
|
2020-09-22 17:37:10 +00:00
|
|
|
containers:
|
|
|
|
- name: web
|
2022-03-15 16:04:16 +00:00
|
|
|
image: registry.k8s.astropenguin.net/astrojs:2022.03.15.04
|
2020-09-22 17:37:10 +00:00
|
|
|
env:
|
|
|
|
- name: FLASK_DEBUG
|
|
|
|
value: "0"
|
|
|
|
- name: FLASK_ENV
|
|
|
|
value: "production"
|
|
|
|
- name: RUN_MODE
|
|
|
|
value: "web"
|
2022-03-15 16:04:16 +00:00
|
|
|
volumeMounts:
|
|
|
|
- name: cache
|
|
|
|
mountPath: "/app/cache"
|
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-03-15 16:04:16 +00:00
|
|
|
image: registry.k8s.astropenguin.net/astrojs:2022.03.15.04
|
2020-09-22 17:37:10 +00:00
|
|
|
env:
|
|
|
|
- name: RUN_MODE
|
|
|
|
value: "tasks"
|
2022-03-15 16:04:16 +00:00
|
|
|
volumeMounts:
|
|
|
|
- name: cache
|
|
|
|
mountPath: "/app/cache"
|
|
|
|
volumes:
|
|
|
|
- name: cache
|
|
|
|
persistentVolumeClaim:
|
|
|
|
claimName: astrojs-cache
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
apiVersion: v1
|
|
|
|
kind: PersistentVolumeClaim
|
|
|
|
metadata:
|
|
|
|
name: astrojs-cache
|
|
|
|
spec:
|
|
|
|
accessModes: [ "ReadWriteOnce" ]
|
|
|
|
resources:
|
|
|
|
requests:
|
2022-03-15 16:27:38 +00:00
|
|
|
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
|
|
|
|
|
|
|
|
---
|
|
|
|
|
2021-09-05 14:02:29 +00:00
|
|
|
apiVersion: networking.k8s.io/v1
|
2020-09-22 17:37:10 +00:00
|
|
|
kind: Ingress
|
|
|
|
metadata:
|
2020-09-22 20:22:38 +00:00
|
|
|
name: astrojs
|
2022-03-15 16:04:16 +00:00
|
|
|
namespace: ingress-https
|
2020-09-22 17:37:10 +00:00
|
|
|
spec:
|
2021-09-05 16:29:08 +00:00
|
|
|
ingressClassName: nginx
|
2022-03-15 16:04:16 +00:00
|
|
|
tls:
|
|
|
|
- hosts:
|
|
|
|
- astrojs.k8s.astropenguin.net
|
|
|
|
secretName: any-k8s-astro-prod
|
2020-09-22 17:37:10 +00:00
|
|
|
rules:
|
2022-03-15 16:04:16 +00:00
|
|
|
- host: astrojs.k8s.astropenguin.net
|
2020-09-22 17:37:10 +00:00
|
|
|
http:
|
|
|
|
paths:
|
2021-09-05 16:29:08 +00:00
|
|
|
- path: /
|
2021-09-05 14:02:29 +00:00
|
|
|
pathType: Prefix
|
|
|
|
backend:
|
|
|
|
service:
|
2022-03-15 16:04:16 +00:00
|
|
|
name: f-astrojs-default
|
2021-09-05 14:02:29 +00:00
|
|
|
port:
|
|
|
|
number: 5000
|
2022-03-15 16:04:16 +00:00
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
kind: Service
|
|
|
|
apiVersion: v1
|
|
|
|
metadata:
|
|
|
|
name: f-astrojs-default
|
|
|
|
namespace: ingress-https
|
|
|
|
spec:
|
|
|
|
type: ExternalName
|
|
|
|
externalName: astrojs.default.svc.cluster.local
|