diff --git a/charts/common/templates/_deployment.yaml b/charts/common/templates/_deployment.yaml new file mode 100644 index 00000000..0d5a0dff --- /dev/null +++ b/charts/common/templates/_deployment.yaml @@ -0,0 +1,51 @@ +{{- define "common.node-deployment" -}} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "common.names.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: {{- include "common.labels.standard" . | nindent 4 }} + {{- if .Values.commonLabels }} + {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} + {{- end }} + {{- if .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} + {{- end }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} + template: + metadata: + labels: {{- include "common.labels.standard" . | nindent 8 }} + {{- if .Values.commonLabels }} + {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 8 }} + {{- end }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + containers: + - name: {{ include "common.names.name" . }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + {{- if .Values.env }} + env: + {{- include "common.environment.render" (dict "env" .Values.env "context" $) | indent 12 }} + {{- end }} + ports: + - name: {{ include "common.names.name" . }} + containerPort: {{ .Values.containerPort }} + readinessProbe: + tcpSocket: + port: {{ include "common.names.name" . }} + initialDelaySeconds: 5 + periodSeconds: 10 + livenessProbe: + httpGet: + path: {{ .Values.livenessEndpoint | default "/" }} + port: {{ include "common.names.name" . }} + initialDelaySeconds: 60 + periodSeconds: 15 +{{- end }} \ No newline at end of file