mirror of
https://github.com/resf/distro-tools.git
synced 2024-11-24 06:01:26 +00:00
84 lines
2.7 KiB
YAML
84 lines
2.7 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ include "apollo-server.fullname" . }}
|
|
labels:
|
|
{{- include "apollo-server.labels" . | nindent 4 }}
|
|
spec:
|
|
{{- if not .Values.autoscaling.enabled }}
|
|
replicas: {{ .Values.replicaCount }}
|
|
{{- end }}
|
|
selector:
|
|
matchLabels:
|
|
{{- include "apollo-server.selectorLabels" . | nindent 6 }}
|
|
template:
|
|
metadata:
|
|
{{- with .Values.podAnnotations }}
|
|
annotations:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
labels:
|
|
{{- include "apollo-server.selectorLabels" . | nindent 8 }}
|
|
spec:
|
|
{{- with .Values.imagePullSecrets }}
|
|
imagePullSecrets:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
serviceAccountName: {{ include "apollo-server.serviceAccountName" . }}
|
|
securityContext:
|
|
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
|
containers:
|
|
- name: {{ .Chart.Name }}
|
|
securityContext:
|
|
{{- toYaml .Values.securityContext | nindent 12 }}
|
|
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
command: ["/opt/venv/bin/python3", "-m", "hypercorn", "apollo.server.server", "--bind", "[::]:8000"]
|
|
env:
|
|
- name: ENV
|
|
value: production
|
|
- name: KUBERNETES
|
|
value: "1"
|
|
- name: DB_HOST
|
|
value: "{{ .Values.database.host }}"
|
|
- name: DB_PORT
|
|
value: "{{ .Values.database.port | default 5432 }}"
|
|
- name: DB_USER
|
|
value: "{{ .Values.database.user }}"
|
|
- name: DB_PASSWORD
|
|
{{- toYaml .Values.database.password | nindent 14 }}
|
|
- name: DB_SSLMODE
|
|
value: {{ .Values.database.sslMode | default "disable" }}
|
|
ports:
|
|
- name: http
|
|
containerPort: 8000
|
|
protocol: TCP
|
|
startupProbe:
|
|
httpGet:
|
|
path: /_/healthz
|
|
port: http
|
|
failureThreshold: 10
|
|
periodSeconds: 10
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /_/healthz
|
|
port: http
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /_/healthz
|
|
port: http
|
|
resources:
|
|
{{- toYaml .Values.resources | nindent 12 }}
|
|
{{- with .Values.nodeSelector }}
|
|
nodeSelector:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.affinity }}
|
|
affinity:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.tolerations }}
|
|
tolerations:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|