|
11 | 11 | threshold: 2 |
12 | 12 | path: /healthz/ready |
13 | 13 | port: 15021 |
| 14 | + hpa: |
| 15 | + minReplicas: 1 # optional |
| 16 | + maxReplicas: 3 # Optional, will default to minReplicas if minReplicas is defined |
| 17 | + averageUtilization: 60 |
14 | 18 | ingressAcls: |
15 | 19 | cidrs: |
16 | 20 | - 0.0.0.0/0 |
| 21 | + pdb: |
| 22 | + minAvailable: "1" |
| 23 | + maxUnavailable: |
17 | 24 | tags: [] |
18 | 25 | # Values required by this blueprint without defaults: |
19 | 26 | # providerConfigName: "example-crossplane-provider-name" |
|
42 | 49 | namespace: {{ .Gateway.metadata.namespace }} |
43 | 50 | annotations: |
44 | 51 | networking.istio.io/service-type: ClusterIP |
| 52 | + sidecar.istio.io/proxyCPU: "1" |
45 | 53 | {{ if .Values.tags }} |
46 | 54 | {{ toYaml .Values.tags | nindent 4 }} |
47 | 55 | {{ end }} |
@@ -337,6 +345,59 @@ spec: |
337 | 345 | tv2.dk/gw: {{ .Gateway.metadata.namespace }}-{{ .Gateway.metadata.name }} |
338 | 346 | toPort: 15021 |
339 | 347 | type: ingress |
| 348 | + hpa: | |
| 349 | + {{ if or (get .Values.hpa "minReplicas") (get .Values.hpa "maxReplicas") }} |
| 350 | + apiVersion: autoscaling/v2 |
| 351 | + kind: HorizontalPodAutoscaler |
| 352 | + metadata: |
| 353 | + labels: |
| 354 | + tv2.dk/gw: {{ .Gateway.metadata.namespace }}-{{ .Gateway.metadata.name }} |
| 355 | + name: gw-{{ .Gateway.metadata.namespace }}-{{ .Gateway.metadata.name }} |
| 356 | + namespace: {{ .Gateway.metadata.namespace }} |
| 357 | + spec: |
| 358 | + scaleTargetRef: |
| 359 | + apiVersion: apps/v1 |
| 360 | + kind: Deployment |
| 361 | + name: {{ .Gateway.metadata.name }}-child-istio |
| 362 | + {{ if get .Values.hpa "minReplicas" }} |
| 363 | + minReplicas: {{ .Values.hpa.minReplicas }} |
| 364 | + {{ end }} |
| 365 | + {{ if get .Values.hpa "maxReplicas" }} |
| 366 | + maxReplicas: {{ .Values.hpa.maxReplicas }} |
| 367 | + {{ else }} # Ensure that max >= min |
| 368 | + {{ if get .Values.hpa "minReplicas" }} |
| 369 | + maxReplicas: {{ .Values.hpa.minReplicas }} |
| 370 | + {{ end }} |
| 371 | + {{ end }} |
| 372 | + metrics: |
| 373 | + - type: Resource |
| 374 | + resource: |
| 375 | + name: cpu |
| 376 | + target: |
| 377 | + type: Utilization |
| 378 | + averageUtilization: {{ .Values.hpa.averageUtilization }} |
| 379 | + {{ end }} |
| 380 | + pdb: | |
| 381 | + {{ if or (get .Values.pdb "minAvailable") (get .Values.pdb "maxUnavailable") }} |
| 382 | + apiVersion: policy/v1 |
| 383 | + kind: PodDisruptionBudget |
| 384 | + metadata: |
| 385 | + labels: |
| 386 | + tv2.dk/gw: {{ .Gateway.metadata.namespace }}-{{ .Gateway.metadata.name }} |
| 387 | + name: gw-{{ .Gateway.metadata.namespace }}-{{ .Gateway.metadata.name }} |
| 388 | + namespace: {{ .Gateway.metadata.namespace }} |
| 389 | + spec: |
| 390 | + {{ if get .Values.pdb "minAvailable" }} |
| 391 | + minAvailable: {{ .Values.pdb.minAvailable }} |
| 392 | + {{ else }} |
| 393 | + maxUnavailable: {{ .Values.pdb.maxUnavailable }} |
| 394 | + {{ end }} |
| 395 | + selector: |
| 396 | + # Match the generated Deployment by label |
| 397 | + matchLabels: |
| 398 | + tv2.dk/gw: {{ .Gateway.metadata.namespace }}-{{ .Gateway.metadata.name }} |
| 399 | + istio.io/gateway-name: {{ .Gateway.metadata.name }}-child |
| 400 | + {{ end }} |
340 | 401 |
|
341 | 402 | # The following are templates used to 'implement' a 'parent' HTTPRoute |
342 | 403 | httpRouteTemplate: |
|
0 commit comments