Skip to content

Instantly share code, notes, and snippets.

@tomaustin700
Created May 26, 2019 12:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomaustin700/c5ae694a0065b2b0732bdf1437c35280 to your computer and use it in GitHub Desktop.
Save tomaustin700/c5ae694a0065b2b0732bdf1437c35280 to your computer and use it in GitHub Desktop.
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: {{ template "api.fullname" . }}
labels:
app: {{ template "api.name" . }}
chart: {{ template "api.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: {{ template "api.name" . }}
release: {{ .Release.Name }}
template:
metadata:
labels:
app: {{ template "api.name" . }}
release: {{ .Release.Name }}
spec:
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: {{ .Values.service.port }}
protocol: TCP
livenessProbe:
httpGet:
path: /api/values
port: http
readinessProbe:
httpGet:
path: /api/values
port: http
env:
- name: APPINSIGHTS_INSTRUMENTATIONKEY
value: {{ .Values.applicationInsights.InstrumentationKey }}
{{- $root := . }}
{{- range $ref, $values := .Values.secrets }}
{{- range $key, $value := $values }}
- name: {{ $ref | upper }}_{{ $key | upper }}
valueFrom:
secretKeyRef:
name: {{ template "api.fullname" $root }}-{{ $ref }}
key: {{ $key }}
{{- end }}
{{- end }}
resources:
{{ toYaml .Values.resources | indent 12 }}
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{- range .Values.imagePullSecrets }}
- name: {{.}}
{{- end}}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment