-
Notifications
You must be signed in to change notification settings - Fork 25
/
deployment.yaml
73 lines (73 loc) · 2.53 KB
/
deployment.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "snapscheduler.fullname" . }}
labels:
{{- include "snapscheduler.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "snapscheduler.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "snapscheduler.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "snapscheduler.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ default .Chart.AppVersion .Values.image.tagOverride }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: WATCH_NAMESPACE
value: ""
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: OPERATOR_NAME
value: "snapscheduler"
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- /*
The horrible-ness below related to nodeSelector is because the node labels
removed the beta prefix in 1.14.
We want to have a default that ensures amd64/linux by default, but users must
be able to override that, including removing all selectors. If we didn't have
to determine at render-time the proper label name, the default labels should
be in the values.yaml and the template would look just like affinity, below.
The values.yaml file would set the labels like it does for resources.
When support for 1.13 is dropped, please fix this!
*/ -}}
{{- if quote .Values.nodeSelector | ne "" }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- else }}
nodeSelector:
{{- if semverCompare ">=1.14" .Capabilities.KubeVersion.Version }}
kubernetes.io/arch: amd64
kubernetes.io/os: linux
{{- else }}
beta.kubernetes.io/arch: amd64
beta.kubernetes.io/os: linux
{{- end }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}