marcells/node-build-monitor

View on GitHub
charts/build-monitor/templates/deployment.yaml

Summary

Maintainability
Test Coverage
apiVersion: apps/v1beta2
kind: Deployment
metadata:
  name: {{ include "build-monitor.fullname" . }}
  labels:
    app.kubernetes.io/name: {{ include "build-monitor.name" . }}
    helm.sh/chart: {{ include "build-monitor.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 "build-monitor.name" . }}
      app.kubernetes.io/instance: {{ .Release.Name }}
  template:
    metadata:
      labels:
        app.kubernetes.io/name: {{ include "build-monitor.name" . }}
        app.kubernetes.io/instance: {{ .Release.Name }}
    spec:
      containers:
        - name: {{ .Chart.Name }}
          image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
          imagePullPolicy: {{ .Values.image.pullPolicy }}
          volumeMounts:
          - mountPath: /build-mon/app/config.json
            subPath: config.json
            name: config-volume
          env:          
          - name: "PORT"
            value: {{ .Values.port | quote }}
          - name: "NODE_TLS_REJECT_UNAUTHORIZED"
            value: {{ .Values.rejectTls | quote }}
          ports:
            - name: http
              containerPort: 3000
              protocol: TCP
          livenessProbe:
            httpGet:
              path: /
              port: http
          readinessProbe:
            httpGet:
              path: /
              port: http
          resources:
{{ toYaml .Values.resources | indent 12 }}
      volumes:
          - name: config-volume
            configMap:
              name: config-file
    {{- with .Values.nodeSelector }}
      nodeSelector:
{{ toYaml . | indent 8 }}
    {{- end }}
    {{- with .Values.affinity }}
      affinity:
{{ toYaml . | indent 8 }}
    {{- end }}
    {{- with .Values.tolerations }}
      tolerations:
{{ toYaml . | indent 8 }}
    {{- end }}