-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnodeAffinty-Deploy.yml
118 lines (118 loc) · 3.56 KB
/
nodeAffinty-Deploy.yml
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "sample-chart.fullname" . }}
labels:
{{- include "sample-chart.labels" . | nindent 4 }}
spec:
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 10%
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "sample-chart.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "sample-chart.selectorLabels" . | nindent 8 }}
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: topology.kubernetes.io/zone
operator: In
values:
- us-east-1d
- us-east-1a
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
preference:
matchExpressions:
- key: topology.kubernetes.io/zone
operator: In
values:
- us-east-1
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "sample-chart.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
{{- if .Values.vault.enabled }}
initContainers:
- name: vault-fetch
image: {{ .Values.vault.templateImage }}
imagePullPolicy: {{ .Values.vault.templatePullPolicy }}
volumeMounts:
- mountPath: {{ .Values.vault.volumeMount }}
name: {{ .Values.vault.volumeName }}
command:
- bash
- "-c"
- |-
#!/bin/bash
set -e
set -o pipefail
echo "Hi"
{{- end }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- if .Values.vault.enabled }}
volumeMounts:
- mountPath: {{ .Values.vault.volumeMount }}
name: {{ .Values.vault.volumeName }}
{{- end }}
env:
{{- toYaml .Values.environmentVariables | nindent 12}}
ports:
- name: http
containerPort: 8080
protocol: TCP
livenessProbe:
httpGet:
path: /actuator/health
port: http
initialDelaySeconds: 30
periodSeconds: 5
failureThreshold: 3
readinessProbe:
httpGet:
path: /actuator/health
port: http
initialDelaySeconds: 30
periodSeconds: 5
failureThreshold: 3
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 }}
{{- if .Values.vault.enabled }}
volumes:
- name: {{ .Values.vault.volumeName }}
emptyDir: {}
{{- end }}