test/chart/templates/deploymant-db.yaml
ston1th 951fc96548
All checks were successful
the build was successful
first helm test
2019-01-18 20:23:46 +01:00

71 lines
2.4 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "testapp.fullname" . }}-db
labels:
app: {{ template "testapp.name" . }}-db
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
component: db
spec:
replicas: {{ .Values.db.replicas }}
template:
metadata:
annotations:
{{- if .Values.db.annotations }}
{{ toYaml .Values.db.annotations | indent 8 }}
{{- end }}
labels:
app: {{ template "testapp.name" . }}-db
release: "{{ .Release.Name }}"
component: db
spec:
{{- if .Values.db.schedulerName }}
schedulerName: "{{ .Values.db.schedulerName }}"
{{- end }}
{{- if .Values.db.affinity }}
affinity:
{{ toYaml .Values.db.affinity | indent 8 }}
{{- end }}
{{- if .Values.db.nodeSelector }}
nodeSelector:
{{ toYaml .Values.db.nodeSelector | indent 8 }}
{{- end }}
containers:
- name: {{ template "testapp.fullname" . }}-db
image: "{{ .Values.images.db.repository }}:{{ .Values.images.db.tag }}"
imagePullPolicy: {{ .Values.images.db.pullPolicy }}
ports:
- name: http
containerPort: 8080
protocol: TCP
env:
{{- range $key, $value := .Values.db.env }}
- name: {{ $key }}
value: {{ $value | quote }}
{{- end }}
resources:
{{ toYaml .Values.db.resources | indent 10 }}
{{- if .Values.db.livenessProbe.enabled }}
livenessProbe:
httpGet:
path: "/healthz"
port: http
initialDelaySeconds: {{ .Values.db.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.db.livenessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.db.livenessProbe.timeoutSeconds }}
successThreshold: {{ .Values.db.livenessProbe.successThreshold }}
failureThreshold: {{ .Values.db.livenessProbe.failureThreshold }}
{{- end }}
{{- if .Values.db.readinessProbe.enabled }}
readinessProbe:
httpGet:
path: "/healthz"
port: http
initialDelaySeconds: {{ .Values.db.readinessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.db.readinessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.db.readinessProbe.timeoutSeconds }}
successThreshold: {{ .Values.db.readinessProbe.successThreshold }}
failureThreshold: {{ .Values.db.readinessProbe.failureThreshold }}
{{- end }}