Created
April 20, 2021 10:40
-
-
Save sjwaight/b93c5485886061fdbc927b6888b26ce4 to your computer and use it in GitHub Desktop.
Sample Helm deployment file showing how to pull a secret into an evironment variable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: {{ include "mvcmusicstoreweb.fullname" . }} | |
labels: | |
{{- include "mvcmusicstoreweb.labels" . | nindent 4 }} | |
spec: | |
{{- if not .Values.autoscaling.enabled }} | |
replicas: {{ .Values.replicaCount }} | |
{{- end }} | |
selector: | |
matchLabels: | |
{{- include "mvcmusicstoreweb.selectorLabels" . | nindent 6 }} | |
template: | |
metadata: | |
{{- with .Values.podAnnotations }} | |
annotations: | |
{{- toYaml . | nindent 8 }} | |
{{- end }} | |
labels: | |
{{- include "mvcmusicstoreweb.selectorLabels" . | nindent 8 }} | |
spec: | |
{{- with .Values.imagePullSecrets }} | |
imagePullSecrets: | |
{{- toYaml . | nindent 8 }} | |
{{- end }} | |
serviceAccountName: {{ include "mvcmusicstoreweb.serviceAccountName" . }} | |
securityContext: | |
{{- toYaml .Values.podSecurityContext | nindent 8 }} | |
containers: | |
- name: {{ .Chart.Name }} | |
securityContext: | |
{{- toYaml .Values.securityContext | nindent 12 }} | |
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" | |
imagePullPolicy: {{ .Values.image.pullPolicy }} | |
env: | |
- name: MusicStoreEntities | |
valueFrom: | |
secretKeyRef: | |
key: connstring | |
name: dbconnection | |
ports: | |
- name: http | |
containerPort: 80 | |
protocol: TCP | |
livenessProbe: | |
httpGet: | |
path: / | |
port: http | |
readinessProbe: | |
httpGet: | |
path: / | |
port: http | |
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 }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment