github.com/argoproj/argo-cd@v1.8.7/util/helm/testdata/redis/templates/redis-master-statefulset.yaml (about)

     1  apiVersion: apps/v1beta2
     2  kind: StatefulSet
     3  metadata:
     4    name: {{ template "redis.fullname" . }}-master
     5    labels:
     6      app: {{ template "redis.name" . }}
     7      chart: {{ template "redis.chart" . }}
     8      release: "{{ .Release.Name }}"
     9      heritage: "{{ .Release.Service }}"
    10  spec:
    11    selector:
    12      matchLabels:
    13        release: "{{ .Release.Name }}"
    14        role: master
    15        app: {{ template "redis.name" . }}
    16    serviceName: "redis-master"
    17    template:
    18      metadata:
    19        labels:
    20          release: "{{ .Release.Name }}"
    21          role: master
    22          app: {{ template "redis.name" . }}
    23  {{- if .Values.master.podLabels }}
    24  {{ toYaml .Values.master.podLabels | indent 8 }}
    25  {{- end }}
    26        {{- if .Values.master.podAnnotations }}
    27        annotations:
    28  {{ toYaml .Values.master.podAnnotations | indent 8 }}
    29        {{- end }}
    30      spec:
    31        {{- if .Values.image.pullSecrets }}
    32        imagePullSecrets:
    33          {{- range .Values.image.pullSecrets }}
    34          - name: {{ . }}
    35          {{- end}}
    36        {{- end}}
    37        {{- if .Values.master.securityContext.enabled }}
    38        securityContext:
    39          fsGroup: {{ .Values.master.securityContext.fsGroup }}
    40          runAsUser: {{ .Values.master.securityContext.runAsUser }}
    41        {{- end }}
    42        serviceAccountName: "{{ template "redis.serviceAccountName" . }}"
    43        {{- with .Values.master.affinity }}
    44        affinity:
    45  {{ toYaml . | indent 8 }}
    46        {{- end }}
    47        {{- if .Values.master.nodeSelector }}
    48        nodeSelector:
    49  {{ toYaml .Values.master.nodeSelector | indent 8 }}
    50        {{- end }}
    51        {{- if .Values.master.tolerations }}
    52        tolerations:
    53  {{ toYaml .Values.master.tolerations | indent 8 }}
    54        {{- end }}
    55        {{- if .Values.master.schedulerName }}
    56        schedulerName: "{{ .Values.master.schedulerName }}"
    57        {{- end }}
    58        containers:
    59        - name: {{ template "redis.fullname" . }}
    60          image: "{{ template "redis.image" . }}"
    61          imagePullPolicy: {{ default "" .Values.image.pullPolicy | quote }}
    62          {{- if .Values.master.args }}
    63          args:
    64  {{ toYaml .Values.master.args | indent 10 }}
    65          {{- end }}
    66          env:
    67          - name: REDIS_REPLICATION_MODE
    68            value: master
    69          {{- if .Values.usePassword }}
    70          - name: REDIS_PASSWORD
    71            valueFrom:
    72              secretKeyRef:
    73              {{- if .Values.existingSecret }}
    74                name: {{ .Values.existingSecret }}
    75              {{- else }}
    76                name: {{ template "redis.fullname" . }}
    77              {{- end }}
    78                key: redis-password
    79          {{- else }}
    80          - name: ALLOW_EMPTY_PASSWORD
    81            value: "yes"
    82          - name: REDIS_PORT
    83            value: {{ .Values.master.port | quote }}
    84          {{- end }}
    85          - name: REDIS_DISABLE_COMMANDS
    86            value: {{ .Values.master.disableCommands }}
    87          {{- if .Values.master.extraFlags }}
    88          - name: REDIS_EXTRA_FLAGS
    89            value: {{ .Values.master.extraFlags | join " " }}
    90          {{- end }}
    91          ports:
    92          - name: redis
    93            containerPort: {{ .Values.master.port }}
    94          {{- if .Values.master.livenessProbe.enabled }}
    95          livenessProbe:
    96            initialDelaySeconds: {{ .Values.master.livenessProbe.initialDelaySeconds }}
    97            periodSeconds: {{ .Values.master.livenessProbe.periodSeconds }}
    98            timeoutSeconds: {{ .Values.master.livenessProbe.timeoutSeconds }}
    99            successThreshold: {{ .Values.master.livenessProbe.successThreshold }}
   100            failureThreshold: {{ .Values.master.livenessProbe.failureThreshold }}
   101            exec:
   102              command:
   103              - redis-cli
   104              - ping
   105          {{- end }}
   106          {{- if .Values.master.readinessProbe.enabled}}
   107          readinessProbe:
   108            initialDelaySeconds: {{ .Values.master.readinessProbe.initialDelaySeconds }}
   109            periodSeconds: {{ .Values.master.readinessProbe.periodSeconds }}
   110            timeoutSeconds: {{ .Values.master.readinessProbe.timeoutSeconds }}
   111            successThreshold: {{ .Values.master.readinessProbe.successThreshold }}
   112            failureThreshold: {{ .Values.master.readinessProbe.failureThreshold }}
   113            exec:
   114              command:
   115              - redis-cli
   116              - ping
   117          {{- end }}
   118          resources:
   119  {{ toYaml .Values.master.resources | indent 10 }}
   120          volumeMounts:
   121          - name: redis-data
   122            mountPath: {{ .Values.master.persistence.path }}
   123            subPath: {{ .Values.master.persistence.subPath }}
   124    {{- if not .Values.master.persistence.enabled }}
   125        volumes:
   126        - name: "redis-data"
   127          emptyDir: {}
   128    {{- else }}
   129      {{- if .Values.persistence.existingClaim }}
   130        volumes:
   131        - name: "redis-data"
   132          persistentVolumeClaim:
   133            claimName: {{ .Values.persistence.existingClaim }}
   134      {{- else }}
   135    volumeClaimTemplates:
   136      - metadata:
   137          name: redis-data
   138          labels:
   139            app: "{{ template "redis.name" . }}"
   140            chart: {{ template "redis.chart" . }}
   141            component: "master"
   142            release: {{ .Release.Name | quote }}
   143            heritage: {{ .Release.Service | quote }}
   144        spec:
   145          accessModes:
   146          {{- range .Values.master.persistence.accessModes }}
   147            - {{ . | quote }}
   148          {{- end }}
   149          resources:
   150            requests:
   151              storage: {{ .Values.master.persistence.size | quote }}
   152        {{- if .Values.master.persistence.storageClass }}
   153        {{- if (eq "-" .Values.master.persistence.storageClass) }}
   154          storageClassName: ""
   155        {{- else }}
   156          storageClassName: {{ .Values.master.persistence.storageClass | quote }}
   157        {{- end }}
   158        {{- end }}
   159      {{- end }}
   160    {{- end }}
   161    updateStrategy:
   162      type: {{ .Values.master.statefulset.updateStrategy }}
   163      {{- if .Values.master.statefulset.rollingUpdatePartition }}
   164      rollingUpdate:
   165        partition: {{ .Values.master.statefulset.rollingUpdatePartition }}
   166      {{- end }}