Strimoid/Strimoid

View on GitHub
chart/templates/deployment-web.yaml

Summary

Maintainability
Test Coverage
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "strimoid.fullname" . }}-web
  labels:
    app.kubernetes.io/name: {{ include "strimoid.name" . }}
    app.kubernetes.io/component: web
    helm.sh/chart: {{ include "strimoid.chart" . }}
    app.kubernetes.io/instance: {{ .Release.Name }}
    app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
  replicas: {{ .Values.replicaCount }}
  selector:
    matchLabels:
      app.kubernetes.io/name: {{ include "strimoid.name" . }}
      app.kubernetes.io/component: web
      app.kubernetes.io/instance: {{ .Release.Name }}
  template:
    metadata:
      annotations:
        checksum/configmap: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
      labels:
        app.kubernetes.io/name: {{ include "strimoid.name" . }}
        app.kubernetes.io/component: web
        app.kubernetes.io/instance: {{ .Release.Name }}
    spec:
      containers:
        - name: {{ .Chart.Name }}
          image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
          imagePullPolicy: {{ .Values.image.pullPolicy }}
          envFrom:
            - configMapRef:
                name: {{ template "strimoid.fullname" . }}
            - secretRef:
                name: {{ template "strimoid.fullname" . }}
          {{- if .Values.persistence.enabled }}
          volumeMounts:
            - name: storage
              mountPath: /src/storage/uploads
              subPath: uploads
          {{- end }}
          ports:
            - name: http
              containerPort: 80
              protocol: TCP
          resources:
            {{- toYaml .Values.resources | nindent 12 }}
      {{- with .Values.nodeSelector }}
      nodeSelector:
        {{- toYaml . | nindent 8 }}
      {{- end }}
    {{- with .Values.affinity }}
      affinity:
        {{- toYaml . | nindent 8 }}
    {{- end }}
    {{- with .Values.tolerations }}
      tolerations:
        {{- toYaml . | nindent 8 }}
    {{- end }}
    {{- if .Values.persistence.enabled }}
      volumes:
        - name: storage
          persistentVolumeClaim:
            claimName: {{ .Values.persistence.existingClaim | default (include "strimoid.fullname" .) }}
    {{- end -}}