github.com/spotahome/redis-operator@v1.2.4/charts/redisoperator/templates/deployment.yaml (about)

     1  {{- $fullName := include "chart.fullname" . -}}
     2  {{ $name := "registry" }}
     3  {{- $data := dict "Chart" .Chart "Release" .Release "Values" .Values -}}
     4  apiVersion: {{ template "common.capabilities.deployment.apiVersion" . }}
     5  kind: Deployment
     6  metadata:
     7    name: {{ $fullName }}
     8    labels:
     9      {{- include "chart.labels" $data | nindent 4 }}
    10    {{- if .Values.annotations }}
    11    annotations:
    12  {{ toYaml .Values.annotations | indent 4 }}
    13    {{- end }}
    14  spec:
    15    replicas: {{ .Values.replicas }}
    16    selector:
    17      matchLabels:
    18        {{- include "chart.selectorLabels" $data | nindent 6 }}
    19    strategy:
    20      type: {{ .Values.updateStrategy.type }}
    21    template:
    22      metadata:
    23        {{- with .Values.annotations }}
    24        annotations:
    25          {{- toYaml . | nindent 8 }}
    26        {{- end }}
    27        labels:
    28          {{- include "chart.selectorLabels" $data | nindent 8 }}
    29      spec:
    30        serviceAccountName: {{ template "chart.serviceAccountName" . }}
    31        {{- if (and .Values.imageCredentials.create (not .Values.imageCredentials.existsSecrets)) }}
    32        imagePullSecrets:
    33          - name: {{ $fullName }}-{{ $name }}
    34        {{- else if (and .Values.imageCredentials.create .Values.imageCredentials.existsSecrets) }}
    35        {{- range .Values.imageCredentials.existsSecrets }}
    36        imagePullSecrets:
    37          {{ printf "- name: %s" . }}
    38        {{- end }}
    39        {{- end }}
    40        containers:
    41        - name: {{ .Chart.Name }}
    42          image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion}}"
    43          imagePullPolicy: {{ .Values.image.pullPolicy }}
    44          ports:
    45            - name: metrics
    46              containerPort: {{ .Values.container.port }}
    47              protocol: TCP
    48          readinessProbe:
    49            tcpSocket:
    50              port: {{ .Values.container.port }}
    51            initialDelaySeconds: 10
    52            periodSeconds: 3
    53            timeoutSeconds: 3
    54          livenessProbe:
    55            tcpSocket:
    56              port: {{ .Values.container.port }}
    57            initialDelaySeconds: 30
    58            periodSeconds: 5
    59            timeoutSeconds: 5
    60            failureThreshold: 6
    61            successThreshold: 1
    62          securityContext:
    63            {{- toYaml .Values.securityContext | nindent 12 }}
    64          resources:
    65            {{- toYaml .Values.resources | nindent 12 }}
    66      {{- with .Values.affinity }}
    67        affinity:
    68          {{- toYaml . | nindent 8 }}
    69      {{- end }}
    70      {{- with .Values.tolerations }}
    71        tolerations:
    72          {{- toYaml . | nindent 8 }}
    73      {{- end }}
    74      {{- with .Values.nodeSelector }}
    75        nodeSelector:
    76          {{- toYaml . | nindent 8 }}
    77      {{- end }}