distro-tools/deploy/apollo/apollo-rpmworker/templates/deployment.yaml
2023-02-02 17:55:49 +01:00

69 lines
2.2 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "apollo-rpmworker.fullname" . }}
labels:
{{- include "apollo-rpmworker.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "apollo-rpmworker.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "apollo-rpmworker.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "apollo-rpmworker.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 }}
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: 80
protocol: TCP
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 }}