Skip to content

Instantly share code, notes, and snippets.

@phroggyy
Created August 11, 2020 11:53
Show Gist options
  • Save phroggyy/6a8e28ebd61885437fa644aa2c36e704 to your computer and use it in GitHub Desktop.
Save phroggyy/6a8e28ebd61885437fa644aa2c36e704 to your computer and use it in GitHub Desktop.
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "kubernetes.fullname" . }}
labels:
app.kubernetes.io/name: {{ include "kubernetes.fullname" . }}
helm.sh/chart: {{ include "kubernetes.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "kubernetes.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
helm.sh/chart: {{ include "kubernetes.chart" . }}
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "kubernetes.name" . }}
helm.sh/chart: {{ include "kubernetes.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
volumes:
- name: nginx-config
configMap:
name: "{{ .Release.Name }}-nginx-config"
containers:
- name: "{{ .Chart.Name }}"
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
volumeMounts:
- mountPath: /etc/nginx/nginx.conf
name: nginx-config
subPath: nginx.conf
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 }}
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app.kubernetes.io/instance
operator: In
values:
- {{ .Release.Name }}
topologyKey: kubernetes.io/hostname
{{- 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