github.com/timoth-y/kicksware-api/order-service@v0.0.0-20201002192818-87b546a7ae5a/orders-chart/templates/deployment.yaml (about)

     1  apiVersion: apps/v1
     2  kind: Deployment
     3  metadata:
     4    name: {{ include "chart.fullname" . }}
     5    labels:
     6      {{- include "chart.labels" . | nindent 4 }}
     7  spec:
     8  {{- if not .Values.autoscaling.enabled }}
     9    replicas: {{ .Values.replicaCount }}
    10    strategy:
    11      type: RollingUpdate
    12      rollingUpdate:
    13        maxSurge: 1
    14        maxUnavailable: 0
    15  {{- end }}
    16    selector:
    17      matchLabels:
    18        {{- include "chart.selectorLabels" . | nindent 6 }}
    19    template:
    20      metadata:
    21        labels:
    22          {{- include "chart.selectorLabels" . | nindent 8 }}
    23        annotations:
    24          rollme: {{ randAlphaNum 5 | quote }}
    25      spec:
    26        containers:
    27          - name: {{ .Chart.Name }}
    28            image: "{{ .Values.image.registry }}/{{ .Values.project }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}"
    29            imagePullPolicy: {{ .Values.image.pullPolicy }}
    30            ports:
    31              - name: http
    32                containerPort: {{ .Values.service.port }}
    33            livenessProbe:
    34              httpGet:
    35                path: /health/live
    36                port: http
    37            readinessProbe:
    38              httpGet:
    39                path: /health/ready
    40                port: http
    41            volumeMounts:
    42              - name: config
    43                mountPath: {{ .Values.config.configMountPath }}
    44              {{- range .Values.secrets.mounts }}
    45              - name: {{ .name }}
    46                mountPath: {{ .mountPath }}
    47              {{- end }}
    48              {{- range .Values.volumes }}
    49              - name: {{ .name }}
    50                mountPath: {{ .mountPath }}
    51              {{- end }}
    52            envFrom:
    53              - configMapRef:
    54                  name: {{ template "chart.fullname" . }}.env
    55            env:
    56              - name: ELASTIC_APM_SECRET_TOKEN
    57                valueFrom:
    58                  secretKeyRef:
    59                    name: apm-server-token
    60                    key: token
    61            resources:
    62              {{- toYaml .Values.resources | nindent 12 }}
    63        imagePullSecrets:
    64          - name: {{ .Values.secrets.dockerRegistry }}
    65        serviceAccountName: {{ include "chart.serviceAccountName" . }}
    66        volumes:
    67          - name: config
    68            configMap:
    69              name: {{ template "chart.fullname" . }}.config
    70          {{- range .Values.secrets.mounts }}
    71          - name: {{ .name }}
    72            secret:
    73              secretName: {{ .name }}
    74          {{- end }}
    75          {{- range .Values.volumes }}
    76          - name: {{ .name }}
    77            {{- with .host }}
    78            hostPath:
    79              path: {{ .pathBase }}{{ .path }}
    80              type: {{ .type }}
    81            {{- end }}
    82            {{- with .persistent }}
    83            persistentVolumeClaim:
    84              claimName: {{ .claim }}
    85          {{- end }}
    86        {{- end }}