timoth-y/kicksware-api

View on GitHub
services/cdn/cdn-chart/templates/deployment.yaml

Summary

Maintainability
Test Coverage
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "chart.fullname" . }}
  labels:
    {{- include "chart.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
  replicas: {{ .Values.replicaCount }}
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
{{- end }}
  selector:
    matchLabels:
      {{- include "chart.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        {{- include "chart.selectorLabels" . | nindent 8 }}
      annotations:
        rollme: {{ randAlphaNum 5 | quote }}
    spec:
      containers:
        - name: {{ .Chart.Name }}
          image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}"
          imagePullPolicy: {{ .Values.image.pullPolicy }}
          ports:
            - name: http
              containerPort: {{ .Values.service.port }}
          readinessProbe:
            httpGet:
              path: /health/ready
              port: http
            periodSeconds: 60
          volumeMounts:
            - name: config
              mountPath: {{ .Values.config.configMountPath }}
            {{- range .Values.secrets.mounts }}
            - name: {{ .name }}
              mountPath: {{ .mountPath }}
            {{- end }}
            {{- range .Values.volumes }}
            - name: {{ .name }}
              mountPath: {{ .mountPath }}
            {{- end }}
          envFrom:
            - configMapRef:
                name: {{ template "chart.fullname" . }}.env
          resources:
            {{- toYaml .Values.resources | nindent 12 }}
      serviceAccountName: {{ include "chart.serviceAccountName" . }}
      volumes:
        - name: config
          configMap:
            name: {{ template "chart.fullname" . }}.config
        {{- range .Values.secrets.mounts }}
        - name: {{ .name }}
          secret:
            secretName: {{ .name }}
        {{- end }}
        {{- range .Values.volumes }}
        - name: {{ .name }}
          {{- with .host }}
          hostPath:
            path: {{ .pathBase }}{{ .path }}
            type: {{ .type }}
          {{- end }}
          {{- with .persistent }}
          persistentVolumeClaim:
            claimName: {{ .claim }}
          {{- end }}
          {{ with .config }}
          configMap:
            name: {{ .name }}
          {{- end }}
      {{- end }}