-
Notifications
You must be signed in to change notification settings - Fork 282
Expand file tree
/
Copy pathdeployment.yaml
More file actions
176 lines (176 loc) · 6.12 KB
/
Copy pathdeployment.yaml
File metadata and controls
176 lines (176 loc) · 6.12 KB
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "apisix-ingress-controller-manager.name.fullname" . }}
namespace: {{ .Release.Namespace }}
annotations:
{{- range $key, $value := .Values.deployment.annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
labels:
{{- include "apisix-ingress-controller-manager.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.deployment.replicas }}
selector:
matchLabels:
{{- include "apisix-ingress-controller-manager.selectorLabels" . | nindent 6 }}
template:
metadata:
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
{{- if .Values.deployment.podAnnotations }}
{{- range $key, $value := $.Values.deployment.podAnnotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
labels:
{{- include "apisix-ingress-controller-manager.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.deployment.priorityClassName }}
priorityClassName: {{ . }}
{{- end }}
{{- $imagePullSecrets := .Values.deployment.imagePullSecrets | default ((.Values.global).imagePullSecrets | default list) }}
{{- with $imagePullSecrets }}
imagePullSecrets:
{{- range $imagePullSecrets }}
- name: {{ . }}
{{- end }}
{{- end }}
containers:
- env:
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: ADC_SERVER_URL
value: "unix:/sockets/adc.sock"
image: "{{ .Values.deployment.image.repository }}:{{ .Values.deployment.image.tag }}"
imagePullPolicy: {{ .Values.deployment.image.pullPolicy }}
ports:
- containerPort: {{ splitList ":" .Values.config.metricsAddr | last | int }}
name: metrics
protocol: TCP
{{- if .Values.webhook.enabled }}
- containerPort: {{ .Values.webhook.port }}
name: webhook
protocol: TCP
{{- end }}
volumeMounts:
- name: {{ .Release.Name }}-ingress-config
mountPath: /app/conf/config.yaml
subPath: config.yaml
- name: socket-volume
mountPath: /sockets
{{- if .Values.webhook.enabled }}
- name: webhook-certs
mountPath: /certs
readOnly: true
{{- end }}
livenessProbe:
httpGet:
path: /healthz
port: 8081
initialDelaySeconds: 15
periodSeconds: 20
name: manager
readinessProbe:
httpGet:
path: /readyz
port: 8081
initialDelaySeconds: 5
periodSeconds: 10
resources:
{{- toYaml .Values.deployment.resources | nindent 10 }}
securityContext:
{{- toYaml .Values.deployment.securityContext | nindent 10 }}
- name: adc-server
image: "{{ .Values.deployment.adcContainer.image.repository }}:{{ .Values.deployment.adcContainer.image.tag }}"
imagePullPolicy: {{ .Values.deployment.image.pullPolicy }}
args:
- "server"
- "--listen"
- "unix:/sockets/adc.sock"
- "--listen-status"
- "3001"
env:
- name: ADC_RUNNING_MODE
value: "ingress"
- name: ADC_EXPERIMENTAL_FEATURE_FLAGS
value: "remote-state-file,parallel-backend-request"
- name: ADC_INGRESS_LOG_LEVEL
value: "{{ .Values.deployment.adcContainer.config.logLevel }}"
ports:
- name: http-status
containerPort: 3001
protocol: TCP
livenessProbe:
httpGet:
path: /healthz/ready
port: 3001
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 10
readinessProbe:
httpGet:
path: /healthz/ready
port: 3001
initialDelaySeconds: 5
periodSeconds: 5
volumeMounts:
- name: socket-volume
mountPath: /sockets
resources:
{{- toYaml .Values.deployment.resources | nindent 10 }}
securityContext:
{{- toYaml .Values.deployment.securityContext | nindent 10 }}
{{- with .Values.deployment.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.deployment.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.deployment.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.deployment.topologySpreadConstraints }}
topologySpreadConstraints:
{{- tpl (. | toYaml) $ | nindent 8 }}
{{- end }}
volumes:
- name: {{ .Release.Name }}-ingress-config
configMap:
name: {{ .Release.Name }}-ingress-config
- name: socket-volume
emptyDir: {}
{{- if .Values.webhook.enabled }}
- name: webhook-certs
secret:
secretName: {{ include "apisix-ingress-controller-manager.webhook.secretName" . }}
{{- end }}
securityContext:
{{- toYaml .Values.deployment.podSecurityContext | nindent 8 }}
serviceAccountName: {{ .Release.Name }}
terminationGracePeriodSeconds: 10