|
| 1 | +{{- define "single-deployment.deployment.data" -}} |
| 2 | + |
| 3 | +name: {{ template "single-deployment.fullname" . }} |
| 4 | +labels: |
| 5 | + {{- include "single-deployment.labels" . | nindent 2 }} |
| 6 | +annotations: |
| 7 | + {{- toYaml .Values.deploymentAnnotations | nindent 2 }} |
| 8 | +selector: |
| 9 | + {{- include "single-deployment.selectorLabels" . | nindent 4 }} |
| 10 | +replicas: {{ .Values.replicaCount }} |
| 11 | +strategy: |
| 12 | + {{- toYaml .Values.updateStrategy | nindent 2 }} |
| 13 | + |
| 14 | +pod_labels: |
| 15 | + {{- include "single-deployment.selectorLabels" . | nindent 4 }} |
| 16 | +pod_annotations: |
| 17 | + {{- toYaml .Values.podAnnotations | nindent 2 }} |
| 18 | +topologySpreadConstraints: |
| 19 | + {{- toYaml .Values.topologySpreadConstraints | nindent 2 }} |
| 20 | +tolerations: |
| 21 | + {{- toYaml .Values.tolerations | nindent 2 }} |
| 22 | +affinity: |
| 23 | + {{- toYaml .Values.affinity | nindent 2 }} |
| 24 | +nodeSelector: |
| 25 | + {{- toYaml .Values.nodeSelector | nindent 2 }} |
| 26 | +securityContext: |
| 27 | + {{- toYaml .Values.podSecurityContext | nindent 2 }} |
| 28 | +imagePullSecrets: |
| 29 | + {{- toYaml .Values.imagePullSecrets | nindent 2 }} |
| 30 | +terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }} |
| 31 | + |
| 32 | +volumes: |
| 33 | + {{- toYaml .Values.extraVolumes | nindent 2 }} |
| 34 | + |
| 35 | +init_containers: |
| 36 | + {{- toYaml .Values.initContainers | nindent 2 }} |
| 37 | + |
| 38 | +containers_dict: |
| 39 | + main: |
| 40 | + name: main |
| 41 | + image: "{{ .Values.image.repository }}:{{ default .Chart.AppVersion .Values.image.tag }}" |
| 42 | + imagePullPolicy: {{ .Values.image.pullPolicy }} |
| 43 | + {{- with .Values.image.command }} |
| 44 | + command: |
| 45 | + {{- toYaml . | nindent 4 }} |
| 46 | + {{- end }} |
| 47 | + {{- with .Values.image.args }} |
| 48 | + args: |
| 49 | + {{- toYaml . | nindent 4 }} |
| 50 | + {{- end }} |
| 51 | + # env_literal: |
| 52 | + # env_values_configmap: |
| 53 | + # env_from_field_ref: |
| 54 | + # env_from_resource_ref: |
| 55 | + envFrom: |
| 56 | + secrets: |
| 57 | + - {{ template "single-deployment.fullname" . }}-env |
| 58 | + ports: |
| 59 | + {{- range $port := .Values.containerPorts }} |
| 60 | + - name: {{ $port.name }} |
| 61 | + protocol: {{ $port.protocol }} |
| 62 | + pod: {{ $port.number }} |
| 63 | + {{- end }} |
| 64 | + |
| 65 | + lifecycle: |
| 66 | + {{- toYaml .Values.lifecycle | nindent 6 }} |
| 67 | + |
| 68 | + securityContext: |
| 69 | + {{- toYaml .Values.securityContext | nindent 6 }} |
| 70 | + |
| 71 | + volumeMounts: |
| 72 | + {{- toYaml .Values.extraVolumeMounts | nindent 6 }} |
| 73 | + |
| 74 | + resources: |
| 75 | + {{- toYaml .Values.resources | nindent 6 }} |
| 76 | + |
| 77 | +{{- end -}} |
| 78 | + |
| 79 | +{{ include "ph.deployment.render" (include "single-deployment.deployment.data" . | fromYaml ) }} |
0 commit comments