Init commit
This commit is contained in:
11
charts/testing/templates/deployment/_deployment.tpl
Normal file
11
charts/testing/templates/deployment/_deployment.tpl
Normal file
@ -0,0 +1,11 @@
|
||||
{{- define "lib.deployment" -}}
|
||||
# ---------------------------------------------------------------------
|
||||
# The deployment is build withing the helm library
|
||||
# please check the lib/tempaltes/deployment/base
|
||||
# ---------------------------------------------------------------------
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
{{- include "lib.metadata" (dict "Context" . "customName" "")}}
|
||||
{{- include "deployment.spec" . }}
|
||||
{{- end -}}
|
||||
|
61
charts/testing/templates/deployment/_spec.tpl
Normal file
61
charts/testing/templates/deployment/_spec.tpl
Normal file
@ -0,0 +1,61 @@
|
||||
{{/*
|
||||
This is a builder for deployments
|
||||
*/}}
|
||||
{{- define "deployment.spec" }}
|
||||
spec:
|
||||
replicas: {{ .Values.workload.replicas }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{ include "metadata.selectorLabels" . | indent 6 }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
{{ include "metadata.labels" . | indent 8 }}
|
||||
spec:
|
||||
{{ include "lib.securityContext" . | indent 6 }}
|
||||
{{- if or .Values.storage .Values.extraVolumes }}
|
||||
volumes:
|
||||
{{- if .Values.storage }}
|
||||
{{- range $k, $v := .Values.storage }}
|
||||
- name: {{ $k }}
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ include "chart.fullname" $ }}-data
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
containers:
|
||||
{{- range $k,$v := .Values.workload.containers }}
|
||||
- name: {{ $k }}
|
||||
{{ include "lib.containerSecurityContext" . | indent 8 }}
|
||||
image: {{ index $.Chart.Annotations "helm.badhouseplants.net/registry" }}:{{ $.Chart.AppVersion }}
|
||||
{{- with $v.ports }}
|
||||
ports:
|
||||
{{- range $p := $v.ports}}
|
||||
- containerPort: {{ index (index $.Values.service.ports $p) "targetPort" }}
|
||||
|
||||
{{- if $v.envFrom }}
|
||||
envFrom:
|
||||
{{- range $k := $v.envFrom }}
|
||||
{{- if kindIs "string" $k }}
|
||||
{{- if (index $.Values.env $k) }}
|
||||
{{- if (index $.Values.env $k).sensitive }}
|
||||
- secretRef:
|
||||
{{- else }}
|
||||
- configMapRef:
|
||||
{{- end }}
|
||||
name: {{ printf "%s-%s" (include "chart.fullname" $) $k }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- range $k, $v := $k }}
|
||||
- {{ $k }}:
|
||||
{{ toYaml $v | indent 14 }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
||||
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
Reference in New Issue
Block a user