-
Notifications
You must be signed in to change notification settings - Fork 143
/
Copy pathvalues.yaml
377 lines (352 loc) · 13.1 KB
/
values.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
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
#
# Author: Hari Sekhon
# Date: 2022-01-05 12:24:42 +0000 (Wed, 05 Jan 2022)
#
# vim:ts=2:sts=2:sw=2:et
# lint: k8s
#
# https://github.com/HariSekhon/Kubernetes-configs
#
# License: see accompanying Hari Sekhon LICENSE file
#
# If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish
#
# https://www.linkedin.com/in/HariSekhon
#
# ============================================================================ #
# N g i n x I n g r e s s C h a r t V a l u e s
# ============================================================================ #
# helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
#
# helm show values ingress-nginx/ingress-nginx >> values.yaml
# Noteable Advanced Configuration items:
#
# - spreads ingress controllers across hosts and availability zones for maximum HA
# - sets high-priority class for scheduling (requires priorityclass.yaml)
# - disallows scheduling to Spot / Preemptible VMs
# - resource requests enabled for better scheduling and avoiding resource contention
# - restricts source addresses to Private and Cloudflare Proxied addresses XXX: delete this if you really intend for this to support a public website
# - enables Mod Security and OWASP rules
---
# fullnameOverride is needed for a second internal-only ingress because otherwise new clusterrole and clusterrolebindings
# aren't created and the old ones don't give permission to the new ingress-nginx-internal namespace
# see comments further down about why two ingresses are needed near service.internal and ingressClassResource sections
#fullnameOverride: ingress-nginx-internal
controller:
name: controller
replicaCount: 3 # XXX: capped by podAntiAffinity of zones vs number of zones - would have to relax that to have more ingress controllers
minAvailable: 2
# XXX: requires priorityclass.yaml
priorityClassName: high-priority
# copied from deployment.yaml - see there for comments and more details
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
# gke-preemptible not valid on GKE AutoPilot clusters - remove in that case and leave only gke-spot
- key: cloud.google.com/gke-preemptible
operator: DoesNotExist
- key: cloud.google.com/gke-spot
operator: DoesNotExist
- key: eks.amazonaws.com/capacityType
operator: NotIn
values:
- SPOT
- key: kubernetes.azure.com/scalesetpriority
operator: NotIn
values:
- spot
podAntiAffinity:
# XXX: relax this to preferred if doing internal-only ingresses
requiredDuringSchedulingIgnoredDuringExecution:
- topologyKey: topology.kubernetes.io/zone # XXX: replace this with topologySpreadConstraints below
labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- ingress-nginx
- key: app.kubernetes.io/instance
operator: In
values:
- ingress-nginx
- key: app.kubernetes.io/component
operator: In
values:
- controller
- topologyKey: kubernetes.io/hostname
labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- ingress-nginx
- key: app.kubernetes.io/instance
operator: In
values:
- ingress-nginx
- key: app.kubernetes.io/component
operator: In
values:
- controller
# -- Topology spread constraints rely on node labels to identify the topology domain(s) that each Node is in.
## Ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/
##
topologySpreadConstraints: []
# - maxSkew: 1
# topologyKey: topology.kubernetes.io/zone
# whenUnsatisfiable: DoNotSchedule
# labelSelector:
# matchLabels:
# app.kubernetes.io/instance: ingress-nginx-internal
## Define requests resources to avoid probe issues due to CPU utilization in busy nodes
## ref: https://github.com/kubernetes/ingress-nginx/issues/4735#issuecomment-551204903
## Ideally, there should be no limits.
## https://engineering.indeedblog.com/blog/2019/12/cpu-throttling-regression-fix/
resources:
requests:
cpu: 100m
memory: 90Mi
limits:
cpu: "1"
memory: 512Mi
# HPA (Mutually exclusive with keda autoscaling)
#autoscaling:
# enabled: false
# minReplicas: 2
# maxReplicas: 11
# targetCPUUtilizationPercentage: 50
# targetMemoryUtilizationPercentage: 50
# behavior: {}
# # scaleDown:
# # stabilizationWindowSeconds: 300
# # policies:
# # - type: Pods
# # value: 1
# # periodSeconds: 180
# # scaleUp:
# # stabilizationWindowSeconds: 300
# # policies:
# # - type: Pods
# # value: 2
# # periodSeconds: 60
#
#autoscalingTemplate: []
## Custom or additional autoscaling metrics
## ref: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-custom-metrics
## - type: Pods
## pods:
## metric:
## name: nginx_ingress_controller_nginx_process_requests_total
## target:
## type: AverageValue
## averageValue: 10000m
# Mutually exclusive with HPA autoscaling
#keda:
# apiVersion: "keda.sh/v1alpha1"
# ## apiVersion changes with keda 1.x vs 2.x
# ## 2.x = keda.sh/v1alpha1
# ## 1.x = keda.k8s.io/v1alpha1
# enabled: false
# minReplicas: 1
# maxReplicas: 11
# pollingInterval: 30
# cooldownPeriod: 300
# restoreToOriginalReplicaCount: false
# scaledObject:
# annotations: {}
# # Custom annotations for ScaledObject resource
# # annotations:
# # key: value
# triggers: []
# # - type: prometheus
# # metadata:
# # serverAddress: http://<prometheus-host>:9090
# # metricName: http_requests_total
# # threshold: '100'
# # query: sum(rate(http_requests_total{deployment="my-deployment"}[2m]))
# behavior: {}
## scaleDown:
## stabilizationWindowSeconds: 300
## policies:
## - type: Pods
## value: 1
## periodSeconds: 180
## scaleUp:
## stabilizationWindowSeconds: 300
## policies:
## - type: Pods
## value: 2
## periodSeconds: 60
service:
external:
enabled: true
internal:
# -- Enables an additional internal load balancer (besides the external one).
#
# XXX: don't set this in addition to external.enabled=True because there is no differentiated ingressClass so apps will go to the wrong one
#
# https://github.com/kubernetes/ingress-nginx/issues/10057
#
enabled: false
# -- Annotations are mandatory for the load balancer to come up. Varies with the cloud service.
annotations:
cloud.google.com/load-balancer-type: Internal
# loadBalancerIP: ""
loadBalancerSourceRanges:
- 10.0.0.0/8
- 172.16.0.0/16
- 192.168.0.0/16
annotations:
kubernetes.io/ingress.global-static-ip-name: kubernetes-ingress
# -- Used by cloud providers to connect the resulting `LoadBalancer` to a pre-existing static IP according to https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer
#loadBalancerIP: "" # XXX: override this per environment in a Kustomize overlay
loadBalancerSourceRanges:
- 10.0.0.0/8
- 172.16.0.0/16
- 192.168.0.0/16
#
# Cloudflare IPs - https://www.cloudflare.com/vi-vn/ips/
#
# Quickly obtain the latest IPs using the script from adjacent DevOps-Bash-tools repo:
#
# https://github.com/HariSekhon/DevOps-Bash-tools
#
# cloudflare_ip_ranges.sh | sort | sed 's/^/ - /'
#
- 103.21.244.0/22
- 103.22.200.0/22
- 103.31.4.0/22
- 104.16.0.0/13
- 104.24.0.0/14
- 108.162.192.0/18
- 131.0.72.0/22
- 141.101.64.0/18
- 162.158.0.0/15
- 172.64.0.0/13
- 173.245.48.0/20
- 188.114.96.0/20
- 190.93.240.0/20
- 197.234.240.0/22
- 198.41.128.0/17
- 2400:cb00::/32
- 2405:8100::/32
- 2405:b500::/32
- 2606:4700::/32
- 2803:f800::/32
- 2a06:98c0::/29
- 2c0f:f248::/32
# XXX: enable this instead of service.internal.enabled=True and service.external.enabled=False
# since it can only be one or the other for practical purposes - see comment with GitHub issue above
# XXX: you must uncomment fullnameOverride at the top of this config because otherwise clusterrole and
# clusterrolebindings won't be created with the right permissions for the ingress-nginx-internal namespace
#ingressClassResource:
# name: nginx-internal
# enabled: true
# default: true
# controllerValue: "k8s.io/ingress-nginx-internal"
#ingressClass: nginx-internal
# For global settings to apply to all ingresses using this ingress controller
# https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/configmap/
# https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/docs/examples/customization/custom-configuration/configmap.yaml
config:
ssl-redirect: "true"
force-ssl-redirect: "true"
whitelist-source-range: |
10.0.0.0/8,
172.16.0.0/16,
192.168.0.0/16
#denylist-source-range: |
enable-modsecurity: "true"
enable-owasp-modsecurity-crs: "true"
#block-user-agents: # csv separated strings or regex - https://nginx.org/en/docs/http/ngx_http_map_module.html#map
#block-referers:
#enable-syslog: true
#syslog-host: x.x.x.x
#syslog-port: 514
#zipkin-collector-host: zipkin.default.svc.cluster.local
#zipkin-collector-port: 9411
#zipkin-service-name: nginx
#zipkin-sample-rate: 1.0
#jaeger-collector-host: jaeger-agent.default.svc.cluster.local
#jaeger-collector-port: 6831
##jaeger-endpoint: # takes priority over jaeger-collector-host/port
#jaeger-service-name: nginx
#datadog-collector-host: datadog-agent.default.svc.cluster.local
#datadog-collector-port: 8126
#datadog-service-name: nginx
#datadog-environmen: prod
#enable-opentelemetry: true
#otlp-collector-host: otlp-collector.default.svc.cluster.local
#otlp-collector-port: 4317
#otel-service-name: nginx
#main-snippet: # add to nginx main{} section
#http-snippet: # add to nginx http{} section
#server-snippet: # add to nginx servers
#stream-snippet:
#location-snippet:
# AWS EKS
#
# https://aws.amazon.com/premiumsupport/knowledge-center/eks-configure-nginx-ingress-controller/
#
# more settings needed in the ingress - see ingress.yaml
#
#proxy-body-size: 8m
#proxy-read-timeout: "120" # default: "60"
#proxy-send-timeout: "120" # default: "60"
podSecurityContext: {}
# -- Additional command line arguments to pass to nginx-ingress-controller
# E.g. to specify the default SSL certificate you can use
extraArgs: {}
## extraArgs:
## default-ssl-certificate: "<namespace>/<secret_name>"
# -- Additional environment variables to set
extraEnvs: []
# extraEnvs:
# - name: FOO
# valueFrom:
# secretKeyRef:
# key: FOO
# name: secret-resource
# # clusterIP: ""
# ## List of IP addresses at which the controller services are available
# ## Ref: https://kubernetes.io/docs/user-guide/services/#external-ips
# ##
# #externalIPs: []
#
# # loadBalancerIP: ""
# loadBalancerSourceRanges: []
#
# #enableHttp: true
# #enableHttps: true
#
# ## Set external traffic policy to: "Local" to preserve source IP on providers supporting it.
# ## Ref: https://kubernetes.io/docs/tutorials/services/source-ip/#source-ip-for-services-with-typeloadbalancer
# # externalTrafficPolicy: ""
#
# ## Must be either "None" or "ClientIP" if set. Kubernetes will default to "None".
# ## Ref: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies
# # sessionAffinity: ""
#
# type: LoadBalancer
# external:
# enabled: true
#
# ## Enables an additional internal load balancer (besides the external one).
# ## Annotations are mandatory for the load balancer to come up. Varies with the cloud service.
# internal:
# enabled: false
# annotations: {}
#
# # loadBalancerIP: ""
#
# ## Restrict access For LoadBalancer service. Defaults to 0.0.0.0/0.
# loadBalancerSourceRanges: []
#
# ## Set external traffic policy to: "Local" to preserve source IP on
# ## providers supporting it
# ## Ref: https://kubernetes.io/docs/tutorials/services/source-ip/#source-ip-for-services-with-typeloadbalancer
# # externalTrafficPolicy: ""
opentelemetry:
enabled: false