bcgov/document-generation-showcase

View on GitHub
charts/dgrsc/templates/deploymentconfig.yaml

Summary

Maintainability
Test Coverage
---
apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
metadata:
  name: {{ include "dgrsc.fullname" . }}
  labels:
    {{- include "dgrsc.labels" . | nindent 4 }}
spec:
  replicas: {{ .Values.replicaCount }}
  revisionHistoryLimit: 10
  selector:
    {{- include "dgrsc.selectorLabels" . | nindent 4 }}
  strategy:
    resources:
      {{- toYaml .Values.resources | nindent 6 }}
    rollingParams:
      timeoutSeconds: 600
    type: Rolling
  template:
    metadata:
      labels: {{ include "dgrsc.selectorLabels" . | nindent 8 }}
    spec:
      {{- with .Values.imagePullSecrets }}
      imagePullSecrets: {{ toYaml . | nindent 8 }}
      {{- end }}
      {{- if .Values.serviceAccount.create }}
      serviceAccountName: {{ include "dgrsc.serviceAccountName" . }}
      {{- end }}
      {{- with .Values.podSecurityContext }}
      securityContext: {{ toYaml . | nindent 8 }}
      {{- end }}
      containers:
        - name: app
          {{- with .Values.securityContext }}
          securityContext: {{ toYaml . | nindent 12 }}
          {{- end }}
          image: "{{ .Values.image.repository }}/{{ .Chart.Name }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
          imagePullPolicy: {{ .Values.image.pullPolicy }}
          ports:
            - containerPort: {{ .Values.service.port }}
              protocol: TCP
          livenessProbe:
            failureThreshold: 3
            httpGet:
              path: {{ .Values.route.path }}
              port: {{ .Values.service.port }}
              scheme: HTTP
            initialDelaySeconds: 10
            timeoutSeconds: 1
          readinessProbe:
            failureThreshold: 3
            httpGet:
              path: {{ .Values.route.path }}
              port: {{ .Values.service.port }}
              scheme: HTTP
            initialDelaySeconds: 10
            timeoutSeconds: 1
          resources: {{ toYaml .Values.resources | nindent 12 }}
          env:
            - name: NODE_ENV
              value: production
            # secrets:
            - name: SERVER_KC_CLIENTID
              valueFrom:
                secretKeyRef:
                  key: username
                  name: {{ include "dgrsc.name" . }}-keycloak-secret
            - name: SERVER_KC_CLIENTSECRET
              valueFrom:
                secretKeyRef:
                  key: password
                  name: {{ include "dgrsc.name" . }}-keycloak-secret
            - name: CDOGS_CLIENTID
              valueFrom:
                secretKeyRef:
                  key: username
                  name: cdogs-service-secret
            - name: CDOGS_CLIENTSECRET
              valueFrom:
                secretKeyRef:
                  key: password
                  name: cdogs-service-secret
          envFrom:
            - configMapRef:
                name: {{ include "dgrsc.configname" . }}-config
      restartPolicy: Always
      terminationGracePeriodSeconds: 30
  test: false
  triggers:
    - type: ConfigChange