apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "rustus.fullname" . }} labels: {{- include "rustus.labels" . | nindent 4 }} spec: {{- if not .Values.autoscaling.enabled }} replicas: {{ .Values.replicaCount }} {{- end }} selector: matchLabels: {{- include "rustus.selectorLabels" . | nindent 6 }} template: metadata: {{- with .Values.podAnnotations }} annotations: {{- toYaml . | nindent 8 }} {{- end }} labels: {{- include "rustus.selectorLabels" . | nindent 8 }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} serviceAccountName: {{ include "rustus.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 }} {{- with .Values.image.command }} command: {{- . | toYaml | nindent 12 }} {{- end }} ports: - name: http containerPort: {{ default 1081 .Values.env.RUSTUS_PORT }} protocol: TCP readinessProbe: httpGet: path: /health port: http {{- with .Values.env }} env: {{- range $key, $val := . }} - name: {{ $key | quote }} value: {{ $val | quote }} {{- end }} {{- end }} {{- if .Values.persistence.enabled }} volumeMounts: - name: data mountPath: {{ default "/app/data" .Values.env.RUSTUS_DATA_DIR }} {{- end }} resources: {{- toYaml .Values.resources | nindent 12 }} {{- if .Values.persistence.enabled }} volumes: - name: data persistentVolumeClaim: {{- if .Values.persistence.existingClaim }} claimName: {{ .Values.persistence.existingClaim }} {{- else }} claimName: {{ printf "rustus-data-%s" (include "rustus.fullname" .) }} {{- end }} {{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.tolerations }} tolerations: {{- toYaml . | nindent 8 }} {{- end }}