-
Notifications
You must be signed in to change notification settings - Fork 163
/
deployment.yaml
108 lines (108 loc) · 3.74 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
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
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "application-gateway-kubernetes-ingress.fullname" . }}
labels:
app: {{ template "application-gateway-kubernetes-ingress.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
spec:
replicas: 1 # TODO: Make configurable when leader election is supported.
selector:
matchLabels:
app: {{ template "application-gateway-kubernetes-ingress.name" . }}
release: {{ .Release.Name }}
template:
metadata:
labels:
app: {{ template "application-gateway-kubernetes-ingress.name" . }}
release: {{ .Release.Name }}
{{- if .Values.armAuth }}
{{- if eq .Values.armAuth.type "aadPodIdentity"}}
aadpodidbinding: {{ template "application-gateway-kubernetes-ingress.fullname" . }}
{{- end }}
{{- end }}
annotations:
checksum/config: {{ print .Values | sha256sum }}
prometheus.io/scrape: "true"
prometheus.io/port: {{ .Values.kubernetes.httpServicePort | quote}}
{{- range $key, $value := .Values.podAnnotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.kubernetes.securityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ template "application-gateway-kubernetes-ingress.serviceaccountname" . }}
containers:
- name: {{ .Chart.Name }}
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
readinessProbe:
httpGet:
path: /health/ready
port: {{ .Values.kubernetes.httpServicePort }}
initialDelaySeconds: 5
periodSeconds: 10
livenessProbe:
httpGet:
path: /health/alive
port: {{ .Values.kubernetes.httpServicePort }}
initialDelaySeconds: 15
periodSeconds: 20
env:
- name: AZURE_CLOUD_PROVIDER_LOCATION
value: /etc/appgw/azure.json
- name: AGIC_POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: AGIC_POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
{{- if .Values.armAuth }}
{{- if eq .Values.armAuth.type "servicePrincipal"}}
- name: AZURE_AUTH_LOCATION
value: /etc/Azure/Networking-AppGW/auth/armAuth.json
{{- end}}
{{- end}}
envFrom:
- configMapRef:
name: {{ template "application-gateway-kubernetes-ingress.configmapname" . }}
volumeMounts:
- mountPath: /etc/appgw/azure.json
name: azure
{{- if .Values.armAuth }}
{{- if eq .Values.armAuth.type "servicePrincipal"}}
- name: networking-appgw-k8s-azure-service-principal-mount
mountPath: /etc/Azure/Networking-AppGW/auth
readOnly: true
{{- end}}
{{- end}}
volumes:
- name: azure
hostPath:
path: /etc/kubernetes/azure.json
type: File
{{- if .Values.armAuth }}
{{- if eq .Values.armAuth.type "servicePrincipal"}}
- name: networking-appgw-k8s-azure-service-principal-mount
secret:
secretName: networking-appgw-k8s-azure-service-principal
{{- end}}
{{- end}}
{{- with .Values.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
{{- end}}
{{- if .Values.image.pullSecrets }}
imagePullSecrets:
- name: {{ .Values.image.pullSecrets }}
{{- end }}