diff options
| author | 2024-04-15 12:02:31 +0100 | |
|---|---|---|
| committer | 2024-04-15 12:02:31 +0100 | |
| commit | d3cb2bded9af86adae2bfac518b60496196a942a (patch) | |
| tree | 54c83918764e21a805c0cf22bb29d1a93a9351c7 /kubernetes/namespaces/web/site/deployment.yaml | |
| parent | Move API services to apis namespace (diff) | |
Move site namespace
Diffstat (limited to 'kubernetes/namespaces/web/site/deployment.yaml')
| -rw-r--r-- | kubernetes/namespaces/web/site/deployment.yaml | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/kubernetes/namespaces/web/site/deployment.yaml b/kubernetes/namespaces/web/site/deployment.yaml new file mode 100644 index 0000000..bdb4073 --- /dev/null +++ b/kubernetes/namespaces/web/site/deployment.yaml @@ -0,0 +1,73 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: site + namespace: web +spec: + replicas: 2 + selector: + matchLabels: + app: site + template: + metadata: + labels: + app: site + spec: + containers: + - name: site + image: ghcr.io/python-discord/site:latest + imagePullPolicy: Always + ports: + - containerPort: 8000 + livenessProbe: + httpGet: + path: / + port: 8000 + httpHeaders: + - name: Host + value: pythondiscord.com + failureThreshold: 2 + periodSeconds: 30 + timeoutSeconds: 5 + initialDelaySeconds: 10 + startupProbe: + httpGet: + path: / + port: 8000 + httpHeaders: + - name: Host + value: pythondiscord.com + failureThreshold: 15 + periodSeconds: 2 + timeoutSeconds: 5 + initialDelaySeconds: 10 + resources: + limits: + cpu: 500m + memory: 1000Mi + requests: + cpu: 250m + memory: 400Mi + env: + # Needs to match with the variable name being read in django-prometheus + # https://github.com/korfuri/django-prometheus/blob/434a3ba36bdada45c9633451f5f6cfd145814ccf/django_prometheus/exports.py#L119 + - name: prometheus_multiproc_dir + value: /tmp + envFrom: + - secretRef: + name: site-env + volumeMounts: + # Used for `gunicorn` worker heartbeats as well as the Prometheus + # client library's multiprocessing mode. + - name: django-tmp + mountPath: /tmp + securityContext: + readOnlyRootFilesystem: true + volumes: + - name: django-tmp + emptyDir: + medium: Memory + securityContext: + fsGroup: 1000 + runAsUser: 1000 + runAsNonRoot: true |