|
| 1 | +apiVersion: apps/v1 |
| 2 | +kind: Deployment |
| 3 | +metadata: |
| 4 | + name: {{ include "statping.fullname" . }} |
| 5 | + labels: |
| 6 | + {{- include "statping.labels" . | nindent 4 }} |
| 7 | +spec: |
| 8 | +{{- if not .Values.autoscaling.enabled }} |
| 9 | + replicas: {{ .Values.replicaCount }} |
| 10 | +{{- end }} |
| 11 | + selector: |
| 12 | + matchLabels: |
| 13 | + {{- include "statping.selectorLabels" . | nindent 6 }} |
| 14 | + template: |
| 15 | + metadata: |
| 16 | + {{- with .Values.podAnnotations }} |
| 17 | + annotations: |
| 18 | + {{- toYaml . | nindent 8 }} |
| 19 | + {{- end }} |
| 20 | + labels: |
| 21 | + {{- include "statping.selectorLabels" . | nindent 8 }} |
| 22 | + spec: |
| 23 | + {{- with .Values.imagePullSecrets }} |
| 24 | + imagePullSecrets: |
| 25 | + {{- toYaml . | nindent 8 }} |
| 26 | + {{- end }} |
| 27 | + serviceAccountName: {{ include "statping.serviceAccountName" . }} |
| 28 | + securityContext: |
| 29 | + {{- toYaml .Values.podSecurityContext | nindent 8 }} |
| 30 | + containers: |
| 31 | + - name: {{ .Chart.Name }} |
| 32 | + securityContext: |
| 33 | + {{- toYaml .Values.securityContext | nindent 12 }} |
| 34 | + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" |
| 35 | + imagePullPolicy: {{ .Values.image.pullPolicy }} |
| 36 | + env: |
| 37 | + {{- if .Values.statping.name }} |
| 38 | + - name: NAME |
| 39 | + value: {{ .Values.statping.name | quote }} |
| 40 | + {{- end }} |
| 41 | + {{- if .Values.statping.description }} |
| 42 | + - name: DESCRIPTION |
| 43 | + value: {{ .Values.statping.description | quote }} |
| 44 | + {{- end }} |
| 45 | + {{- if .Values.statping.domain }} |
| 46 | + - name: DOMAIN |
| 47 | + value: {{ .Values.statping.domain | quote }} |
| 48 | + {{- end }} |
| 49 | + - name: ADMIN_USER |
| 50 | + valueFrom: |
| 51 | + secretKeyRef: |
| 52 | + {{- if .Values.statping.admin.existingSecret.enabled }} |
| 53 | + name: {{ .Values.statping.admin.existingSecret.name | quote }} |
| 54 | + key: {{ .Values.statping.admin.existingSecret.userKey | quote }} |
| 55 | + {{- else }} |
| 56 | + name: {{ include "statping.fullname" . }} |
| 57 | + key: admin-user |
| 58 | + {{- end }} |
| 59 | + - name: ADMIN_PASSWORD |
| 60 | + valueFrom: |
| 61 | + secretKeyRef: |
| 62 | + {{- if .Values.statping.admin.existingSecret.enabled }} |
| 63 | + name: {{ .Values.statping.admin.existingSecret.name | quote }} |
| 64 | + key: {{ .Values.statping.admin.existingSecret.passwordKey | quote }} |
| 65 | + {{- else }} |
| 66 | + name: {{ include "statping.fullname" . }} |
| 67 | + key: admin-password |
| 68 | + {{- end }} |
| 69 | + - name: ADMIN_EMAIL |
| 70 | + valueFrom: |
| 71 | + secretKeyRef: |
| 72 | + {{- if .Values.statping.admin.existingSecret.enabled }} |
| 73 | + name: {{ .Values.statping.admin.existingSecret.name | quote }} |
| 74 | + key: {{ .Values.statping.admin.existingSecret.emailKey | quote }} |
| 75 | + {{- else }} |
| 76 | + name: {{ include "statping.fullname" . }} |
| 77 | + key: admin-email |
| 78 | + {{- end }} |
| 79 | + {{- if eq .Values.postgres.type "kubedb" }} |
| 80 | + - name: DB_CONN |
| 81 | + value: postgres |
| 82 | + - name: DB_HOST |
| 83 | + value: postgres-{{ template "statping.fullname" . }} |
| 84 | + - name: DB_DATABASE |
| 85 | + value: statup |
| 86 | + - name: DB_USER |
| 87 | + valueFrom: |
| 88 | + secretKeyRef: |
| 89 | + name: postgres-{{ template "statping.fullname" . }}-auth |
| 90 | + key: POSTGRES_USER |
| 91 | + - name: DB_PASS |
| 92 | + valueFrom: |
| 93 | + secretKeyRef: |
| 94 | + name: postgres-{{ template "statping.fullname" . }}-auth |
| 95 | + key: POSTGRES_PASSWORD |
| 96 | + {{- end }} |
| 97 | + {{- with .Values.env }} |
| 98 | + {{- toYaml . | nindent 12 }} |
| 99 | + {{- end }} |
| 100 | + ports: |
| 101 | + - name: http |
| 102 | + containerPort: 8080 |
| 103 | + protocol: TCP |
| 104 | + livenessProbe: |
| 105 | + httpGet: |
| 106 | + path: / |
| 107 | + port: http |
| 108 | + readinessProbe: |
| 109 | + httpGet: |
| 110 | + path: / |
| 111 | + port: http |
| 112 | + volumeMounts: |
| 113 | + - mountPath: /app |
| 114 | + name: config |
| 115 | + {{- if .Values.persistence.subPath }} |
| 116 | + subPath: {{ .Values.persistence.subPath }} |
| 117 | + {{- end }} |
| 118 | + {{- if .Values.additionalVolumeMounts }} |
| 119 | + {{- toYaml .Values.additionalVolumes | nindent 12 }} |
| 120 | + {{- end }} |
| 121 | + resources: |
| 122 | + {{- toYaml .Values.resources | nindent 12 }} |
| 123 | + volumes: |
| 124 | + - name: config |
| 125 | + {{- if .Values.persistence.enabled }} |
| 126 | + persistentVolumeClaim: |
| 127 | + claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ template "statping.fullname" . }}{{- end }} |
| 128 | + {{- else }} |
| 129 | + emptyDir: {} |
| 130 | + {{- end }} |
| 131 | + {{- if .Values.additionalVolumes }} |
| 132 | + {{- toYaml .Values.additionalVolumes | nindent 8 }} |
| 133 | + {{- end }} |
| 134 | + {{- with .Values.nodeSelector }} |
| 135 | + nodeSelector: |
| 136 | + {{- toYaml . | nindent 8 }} |
| 137 | + {{- end }} |
| 138 | + {{- with .Values.affinity }} |
| 139 | + affinity: |
| 140 | + {{- toYaml . | nindent 8 }} |
| 141 | + {{- end }} |
| 142 | + {{- with .Values.tolerations }} |
| 143 | + tolerations: |
| 144 | + {{- toYaml . | nindent 8 }} |
| 145 | + {{- end }} |
0 commit comments