From 3d0428e3c619ecbc3364ea795f018232e09195a9 Mon Sep 17 00:00:00 2001 From: sallaman Date: Tue, 6 Dec 2022 16:04:34 +0000 Subject: [PATCH 01/18] add TopologySpreadConstraint for scheduling --- kubernetes/helm/ecsdemo-frontend/templates/deployment.yaml | 4 ++++ kubernetes/helm/ecsdemo-frontend/values.yaml | 2 ++ 2 files changed, 6 insertions(+) diff --git a/kubernetes/helm/ecsdemo-frontend/templates/deployment.yaml b/kubernetes/helm/ecsdemo-frontend/templates/deployment.yaml index a98689b..849f81e 100644 --- a/kubernetes/helm/ecsdemo-frontend/templates/deployment.yaml +++ b/kubernetes/helm/ecsdemo-frontend/templates/deployment.yaml @@ -64,3 +64,7 @@ spec: tolerations: {{- toYaml . | nindent 8 }} {{- end }} + {{- with .Values.topologySpreadConstraints }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} \ No newline at end of file diff --git a/kubernetes/helm/ecsdemo-frontend/values.yaml b/kubernetes/helm/ecsdemo-frontend/values.yaml index 7ff1783..d54c38a 100644 --- a/kubernetes/helm/ecsdemo-frontend/values.yaml +++ b/kubernetes/helm/ecsdemo-frontend/values.yaml @@ -84,3 +84,5 @@ nodeSelector: {} tolerations: [] affinity: {} + +topologySpreadConstraints: [] \ No newline at end of file From 2359a682ef30bcb9ded1849e0af2ef5520f4a9f1 Mon Sep 17 00:00:00 2001 From: sallaman Date: Tue, 6 Dec 2022 17:28:07 +0000 Subject: [PATCH 02/18] add timeout for load testing --- kubernetes/helm/ecsdemo-frontend/templates/deployment.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kubernetes/helm/ecsdemo-frontend/templates/deployment.yaml b/kubernetes/helm/ecsdemo-frontend/templates/deployment.yaml index 849f81e..bfdc96c 100644 --- a/kubernetes/helm/ecsdemo-frontend/templates/deployment.yaml +++ b/kubernetes/helm/ecsdemo-frontend/templates/deployment.yaml @@ -46,10 +46,12 @@ spec: httpGet: path: / port: http + timeoutSeconds: 10 readinessProbe: httpGet: path: / port: http + timeoutSeconds: 10 resources: {{- toYaml .Values.resources | nindent 12 }} {{- with .Values.nodeSelector }} From 0f217cbce03b0ca32f6743be0340896aedab3b4a Mon Sep 17 00:00:00 2001 From: sallaman Date: Tue, 6 Dec 2022 17:48:30 +0000 Subject: [PATCH 03/18] Fix Topology --- kubernetes/helm/ecsdemo-frontend/templates/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kubernetes/helm/ecsdemo-frontend/templates/deployment.yaml b/kubernetes/helm/ecsdemo-frontend/templates/deployment.yaml index bfdc96c..fd3eb46 100644 --- a/kubernetes/helm/ecsdemo-frontend/templates/deployment.yaml +++ b/kubernetes/helm/ecsdemo-frontend/templates/deployment.yaml @@ -67,6 +67,6 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.topologySpreadConstraints }} - tolerations: + topologySpreadConstraints: {{- toYaml . | nindent 8 }} {{- end }} \ No newline at end of file From a6f35a69916c3aa11bf8f78db621068aefd0f7a3 Mon Sep 17 00:00:00 2001 From: sallaman Date: Thu, 8 Dec 2022 12:28:13 +0000 Subject: [PATCH 04/18] liveness probe add initial delay --- .../helm/ecsdemo-frontend/templates/deployment.yaml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/kubernetes/helm/ecsdemo-frontend/templates/deployment.yaml b/kubernetes/helm/ecsdemo-frontend/templates/deployment.yaml index fd3eb46..40cc551 100644 --- a/kubernetes/helm/ecsdemo-frontend/templates/deployment.yaml +++ b/kubernetes/helm/ecsdemo-frontend/templates/deployment.yaml @@ -39,18 +39,27 @@ spec: protocol: TCP env: - name: CRYSTAL_URL - value: http://ecsdemo-crystal.{{ .Values.ecsdemoCrystal.namespace }}.svc.cluster.local/crystal + value: http://ecsdemo-crystal.{{ .Values.ecsdemoCrystal.namespace }}.svc.cluster.local./crystal - name: NODEJS_URL - value: http://ecsdemo-nodejs.{{ .Values.ecsdemoNodejs.namespace }}.svc.cluster.local/ + value: http://ecsdemo-nodejs.{{ .Values.ecsdemoNodejs.namespace }}.svc.cluster.local./ livenessProbe: + failureThreshold: 3 httpGet: path: / port: http + scheme: HTTP + periodSeconds: 10 + successThreshold: 1 timeoutSeconds: 10 + initialDelaySeconds: 15 readinessProbe: + failureThreshold: 3 httpGet: path: / port: http + scheme: HTTP + periodSeconds: 10 + successThreshold: 1 timeoutSeconds: 10 resources: {{- toYaml .Values.resources | nindent 12 }} From 932ea510f133bf3c33513b30a894d49b5645b86b Mon Sep 17 00:00:00 2001 From: sallaman Date: Fri, 9 Dec 2022 17:03:24 +0000 Subject: [PATCH 05/18] increase initial delay --- kubernetes/helm/ecsdemo-frontend/templates/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kubernetes/helm/ecsdemo-frontend/templates/deployment.yaml b/kubernetes/helm/ecsdemo-frontend/templates/deployment.yaml index 40cc551..ebbd91a 100644 --- a/kubernetes/helm/ecsdemo-frontend/templates/deployment.yaml +++ b/kubernetes/helm/ecsdemo-frontend/templates/deployment.yaml @@ -51,7 +51,7 @@ spec: periodSeconds: 10 successThreshold: 1 timeoutSeconds: 10 - initialDelaySeconds: 15 + initialDelaySeconds: 60 readinessProbe: failureThreshold: 3 httpGet: From 4a052eff9c105e38728f48404862ca006c2c84b7 Mon Sep 17 00:00:00 2001 From: sallaman Date: Mon, 12 Dec 2022 15:49:40 +0000 Subject: [PATCH 06/18] add preStop lifecycle for ELB integration --- kubernetes/helm/ecsdemo-frontend/templates/deployment.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kubernetes/helm/ecsdemo-frontend/templates/deployment.yaml b/kubernetes/helm/ecsdemo-frontend/templates/deployment.yaml index ebbd91a..babee3d 100644 --- a/kubernetes/helm/ecsdemo-frontend/templates/deployment.yaml +++ b/kubernetes/helm/ecsdemo-frontend/templates/deployment.yaml @@ -61,6 +61,10 @@ spec: periodSeconds: 10 successThreshold: 1 timeoutSeconds: 10 + lifecycle: + preStop: + exec: + command: ["/bin/sh", "-c", "sleep 180"] resources: {{- toYaml .Values.resources | nindent 12 }} {{- with .Values.nodeSelector }} From 4f6114feeb8ed09278bd34b40140a83649e70976 Mon Sep 17 00:00:00 2001 From: sallaman Date: Mon, 12 Dec 2022 17:09:19 +0000 Subject: [PATCH 07/18] update call to authenticate on IMDSV2 --- startup-cdk.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/startup-cdk.sh b/startup-cdk.sh index fe513bd..77524e2 100755 --- a/startup-cdk.sh +++ b/startup-cdk.sh @@ -67,18 +67,20 @@ if [[ "${orchestrator}" == 'kubernetes' ]]; then fi fi +TOKEN=`curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600" + if [[ ${orchestrator} == 'unknown' ]]; then - zone=$(curl -m2 -s http://169.254.169.254/latest/dynamic/instance-identity/document | jq -r '.availabilityZone' | grep -o .$) + zone=$(curl -H "X-aws-ec2-metadata-token: $TOKEN" -m2 -s http://169.254.169.254/latest/dynamic/instance-identity/document | jq -r '.availabilityZone' | grep -o .$) fi # Am I on ec2 instances? if [[ ${zone} == "unknown" ]]; then - zone=$(curl -m2 -s http://169.254.169.254/latest/dynamic/instance-identity/document | jq -r '.availabilityZone' | grep -o .$) + zone=$(curl -H "X-aws-ec2-metadata-token: $TOKEN" -m2 -s http://169.254.169.254/latest/dynamic/instance-identity/document | jq -r '.availabilityZone' | grep -o .$) fi # Still no luck? Perhaps we're running fargate! if [[ -z ${zone} ]]; then - zone=$(curl -s ${ECS_CONTAINER_METADATA_URI_V4}/task | jq -r '.AvailabilityZone' | grep -o .$) + zone=$(curl -H "X-aws-ec2-metadata-token: $TOKEN" -s ${ECS_CONTAINER_METADATA_URI_V4}/task | jq -r '.AvailabilityZone' | grep -o .$) fi export CODE_HASH="$(cat code_hash.txt)" From 3f61394dddead66c8b73984fcf1ce398c21f75a2 Mon Sep 17 00:00:00 2001 From: sallaman Date: Tue, 13 Dec 2022 08:36:38 +0000 Subject: [PATCH 08/18] small fix --- startup-cdk.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/startup-cdk.sh b/startup-cdk.sh index 77524e2..af422ea 100755 --- a/startup-cdk.sh +++ b/startup-cdk.sh @@ -67,7 +67,7 @@ if [[ "${orchestrator}" == 'kubernetes' ]]; then fi fi -TOKEN=`curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600" +TOKEN=`curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600"` if [[ ${orchestrator} == 'unknown' ]]; then zone=$(curl -H "X-aws-ec2-metadata-token: $TOKEN" -m2 -s http://169.254.169.254/latest/dynamic/instance-identity/document | jq -r '.availabilityZone' | grep -o .$) From 68d104c4fdf1351f1318f74e5e56f4042c024f8f Mon Sep 17 00:00:00 2001 From: sallaman Date: Tue, 13 Dec 2022 08:42:26 +0000 Subject: [PATCH 09/18] add initial delay for frontend --- kubernetes/helm/ecsdemo-frontend/templates/deployment.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/kubernetes/helm/ecsdemo-frontend/templates/deployment.yaml b/kubernetes/helm/ecsdemo-frontend/templates/deployment.yaml index babee3d..1d4c6fb 100644 --- a/kubernetes/helm/ecsdemo-frontend/templates/deployment.yaml +++ b/kubernetes/helm/ecsdemo-frontend/templates/deployment.yaml @@ -61,6 +61,7 @@ spec: periodSeconds: 10 successThreshold: 1 timeoutSeconds: 10 + initialDelaySeconds: 60 lifecycle: preStop: exec: From 4a5311cd5c1c48cb4643051af3774ea40966739b Mon Sep 17 00:00:00 2001 From: sallaman Date: Wed, 14 Dec 2022 18:12:23 +0000 Subject: [PATCH 10/18] remote TOKEN from call to ECS metadata API --- startup-cdk.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/startup-cdk.sh b/startup-cdk.sh index af422ea..8180c9c 100755 --- a/startup-cdk.sh +++ b/startup-cdk.sh @@ -80,7 +80,7 @@ fi # Still no luck? Perhaps we're running fargate! if [[ -z ${zone} ]]; then - zone=$(curl -H "X-aws-ec2-metadata-token: $TOKEN" -s ${ECS_CONTAINER_METADATA_URI_V4}/task | jq -r '.AvailabilityZone' | grep -o .$) + zone=$(curl -s ${ECS_CONTAINER_METADATA_URI_V4}/task | jq -r '.AvailabilityZone' | grep -o .$) fi export CODE_HASH="$(cat code_hash.txt)" From 87ae3f4cd47b4bfc2c575d3fb047bca34dc38309 Mon Sep 17 00:00:00 2001 From: sallaman Date: Mon, 19 Dec 2022 15:55:45 +0000 Subject: [PATCH 11/18] add pdb to secure deployment --- app/views/layouts/application.html.erb | 2 +- kubernetes/helm/ecsdemo-frontend/templates/pdb.yaml | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 kubernetes/helm/ecsdemo-frontend/templates/pdb.yaml diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index df42962..334d263 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -4,7 +4,7 @@ ExampleApp diff --git a/kubernetes/helm/ecsdemo-frontend/templates/pdb.yaml b/kubernetes/helm/ecsdemo-frontend/templates/pdb.yaml new file mode 100644 index 0000000..8b8b3b5 --- /dev/null +++ b/kubernetes/helm/ecsdemo-frontend/templates/pdb.yaml @@ -0,0 +1,13 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: {{ include "ecsdemo-frontend.fullname" . }} + labels: + {{- include "ecsdemo-frontend.labels" . | nindent 4 }} +spec: + maxUnavailable: 1 + selector: + matchLabels: + {{- include "ecsdemo-frontend.labels" . | nindent 4 }} +{{- end }} \ No newline at end of file From 0b13f08acd92cd2ffed3b7b8b2e58e4419463317 Mon Sep 17 00:00:00 2001 From: sallaman Date: Mon, 19 Dec 2022 15:59:12 +0000 Subject: [PATCH 12/18] add pdb to secure deployment2 --- .../helm/ecsdemo-frontend/templates/pdb.yaml | 4 +-- kubernetes/helm/ecsdemo-frontend/values.yaml | 27 ++++++++++++------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/kubernetes/helm/ecsdemo-frontend/templates/pdb.yaml b/kubernetes/helm/ecsdemo-frontend/templates/pdb.yaml index 8b8b3b5..a6a15b6 100644 --- a/kubernetes/helm/ecsdemo-frontend/templates/pdb.yaml +++ b/kubernetes/helm/ecsdemo-frontend/templates/pdb.yaml @@ -1,4 +1,4 @@ -{{- if .Values.autoscaling.enabled }} +{{- if .Values.pdb.enabled }} apiVersion: policy/v1 kind: PodDisruptionBudget metadata: @@ -9,5 +9,5 @@ spec: maxUnavailable: 1 selector: matchLabels: - {{- include "ecsdemo-frontend.labels" . | nindent 4 }} + app.kubernetes.io/name=ecsdemo-frontend {{- end }} \ No newline at end of file diff --git a/kubernetes/helm/ecsdemo-frontend/values.yaml b/kubernetes/helm/ecsdemo-frontend/values.yaml index d54c38a..edca06e 100644 --- a/kubernetes/helm/ecsdemo-frontend/values.yaml +++ b/kubernetes/helm/ecsdemo-frontend/values.yaml @@ -12,11 +12,11 @@ image: repository: public.ecr.aws/aws-containers/ecsdemo-frontend pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. - tag: "latest" + tag: 'latest' imagePullSecrets: [] -nameOverride: "" -fullnameOverride: "" +nameOverride: '' +fullnameOverride: '' serviceAccount: # Specifies whether a service account should be created @@ -25,14 +25,16 @@ serviceAccount: annotations: {} # The name of the service account to use. # If not set and create is true, a name is generated using the fullname template - name: "" + name: '' podAnnotations: {} -podSecurityContext: {} +podSecurityContext: + {} # fsGroup: 2000 -securityContext: {} +securityContext: + {} # capabilities: # drop: # - ALL @@ -46,8 +48,9 @@ service: ingress: enabled: false - className: "" - annotations: {} + className: '' + annotations: + {} # kubernetes.io/ingress.class: nginx # kubernetes.io/tls-acme: "true" hosts: @@ -60,7 +63,8 @@ ingress: # hosts: # - chart-example.local -resources: {} +resources: + {} # We usually recommend not to specify default resources and to leave this as a conscious # choice for the user. This also increases chances charts run on environments with little # resources, such as Minikube. If you do want to specify resources, uncomment the following @@ -79,10 +83,13 @@ autoscaling: targetCPUUtilizationPercentage: 80 # targetMemoryUtilizationPercentage: 80 +pdb: + enabled: true + nodeSelector: {} tolerations: [] affinity: {} -topologySpreadConstraints: [] \ No newline at end of file +topologySpreadConstraints: [] From 52b68468cf263fdaf13b5d2921b877d337134548 Mon Sep 17 00:00:00 2001 From: sallaman Date: Mon, 19 Dec 2022 16:00:44 +0000 Subject: [PATCH 13/18] add pdb to secure deployment3 --- kubernetes/helm/ecsdemo-frontend/templates/pdb.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kubernetes/helm/ecsdemo-frontend/templates/pdb.yaml b/kubernetes/helm/ecsdemo-frontend/templates/pdb.yaml index a6a15b6..0c129df 100644 --- a/kubernetes/helm/ecsdemo-frontend/templates/pdb.yaml +++ b/kubernetes/helm/ecsdemo-frontend/templates/pdb.yaml @@ -9,5 +9,5 @@ spec: maxUnavailable: 1 selector: matchLabels: - app.kubernetes.io/name=ecsdemo-frontend + - app.kubernetes.io/name: {{ include "ecsdemo-frontend.fullname" . }} {{- end }} \ No newline at end of file From 7d42794d244f415840859ec20a4b2dc95155c994 Mon Sep 17 00:00:00 2001 From: sallaman Date: Mon, 19 Dec 2022 16:10:45 +0000 Subject: [PATCH 14/18] add pdb to secure deployment4 --- kubernetes/helm/ecsdemo-frontend/templates/pdb.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kubernetes/helm/ecsdemo-frontend/templates/pdb.yaml b/kubernetes/helm/ecsdemo-frontend/templates/pdb.yaml index 0c129df..db1e0d5 100644 --- a/kubernetes/helm/ecsdemo-frontend/templates/pdb.yaml +++ b/kubernetes/helm/ecsdemo-frontend/templates/pdb.yaml @@ -9,5 +9,5 @@ spec: maxUnavailable: 1 selector: matchLabels: - - app.kubernetes.io/name: {{ include "ecsdemo-frontend.fullname" . }} + app.kubernetes.io/name: {{ include "ecsdemo-frontend.fullname" . }} {{- end }} \ No newline at end of file From 4f23e207e2f79240fa78d142e48607ebd215c1eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Allamand?= Date: Tue, 20 Dec 2022 17:26:29 +0100 Subject: [PATCH 15/18] Update startup-cdk.sh --- startup-cdk.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/startup-cdk.sh b/startup-cdk.sh index 8180c9c..5b7804a 100755 --- a/startup-cdk.sh +++ b/startup-cdk.sh @@ -67,14 +67,16 @@ if [[ "${orchestrator}" == 'kubernetes' ]]; then fi fi -TOKEN=`curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600"` + if [[ ${orchestrator} == 'unknown' ]]; then + TOKEN=`curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600"` zone=$(curl -H "X-aws-ec2-metadata-token: $TOKEN" -m2 -s http://169.254.169.254/latest/dynamic/instance-identity/document | jq -r '.availabilityZone' | grep -o .$) fi # Am I on ec2 instances? if [[ ${zone} == "unknown" ]]; then + TOKEN=`curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600"` zone=$(curl -H "X-aws-ec2-metadata-token: $TOKEN" -m2 -s http://169.254.169.254/latest/dynamic/instance-identity/document | jq -r '.availabilityZone' | grep -o .$) fi From 842322cc7539c0f0784c67bfc17596d0612cf07b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Allamand?= Date: Tue, 28 Feb 2023 17:35:46 +0100 Subject: [PATCH 16/18] add service topology annotation --- kubernetes/helm/ecsdemo-frontend/templates/service.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kubernetes/helm/ecsdemo-frontend/templates/service.yaml b/kubernetes/helm/ecsdemo-frontend/templates/service.yaml index 0d2bbb9..a3bb8bd 100644 --- a/kubernetes/helm/ecsdemo-frontend/templates/service.yaml +++ b/kubernetes/helm/ecsdemo-frontend/templates/service.yaml @@ -4,6 +4,8 @@ metadata: name: {{ include "ecsdemo-frontend.fullname" . }} labels: {{- include "ecsdemo-frontend.labels" . | nindent 4 }} + annotations: + service.kubernetes.io/topology-aware-hints: auto spec: type: {{ .Values.service.type }} ports: From f70e758c3f66f1c1e24584621e209e6d442b6864 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Allamand?= Date: Tue, 4 Jul 2023 14:53:34 +0200 Subject: [PATCH 17/18] Update hpa.yaml --- kubernetes/helm/ecsdemo-frontend/templates/hpa.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kubernetes/helm/ecsdemo-frontend/templates/hpa.yaml b/kubernetes/helm/ecsdemo-frontend/templates/hpa.yaml index 350be88..f697f6f 100644 --- a/kubernetes/helm/ecsdemo-frontend/templates/hpa.yaml +++ b/kubernetes/helm/ecsdemo-frontend/templates/hpa.yaml @@ -1,5 +1,5 @@ {{- if .Values.autoscaling.enabled }} -apiVersion: autoscaling/v2beta1 +apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: {{ include "ecsdemo-frontend.fullname" . }} From 467dddfda449889bb0749b47c7d55c8dd49a8638 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Allamand?= Date: Tue, 4 Jul 2023 14:58:41 +0200 Subject: [PATCH 18/18] Update hpa.yaml --- kubernetes/helm/ecsdemo-frontend/templates/hpa.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/kubernetes/helm/ecsdemo-frontend/templates/hpa.yaml b/kubernetes/helm/ecsdemo-frontend/templates/hpa.yaml index f697f6f..d9eb80d 100644 --- a/kubernetes/helm/ecsdemo-frontend/templates/hpa.yaml +++ b/kubernetes/helm/ecsdemo-frontend/templates/hpa.yaml @@ -17,12 +17,16 @@ spec: - type: Resource resource: name: cpu - targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} {{- end }} {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - type: Resource resource: name: memory - targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} {{- end }} {{- end }}