From 2778e0f1c6775ea5bc604eb5da4f930e0a47abca Mon Sep 17 00:00:00 2001 From: Luiz Felipe Kina Date: Fri, 22 Sep 2023 09:04:04 -0300 Subject: [PATCH] Change metric-server-sample-app namespace Metric-server-sample-app is being deployed on a namespace created by the patch 0001-Add-sample-app-to-metrics-server.patch named metric-server-test-app. Due to this, when metric-server-sample-app tries to use it's docker image on localhost it doesn't have the necessary permissions since default-registry-key wasn't created on this namespace. Changing the sample-app to the metrics-server namespace as to use the resources that were created when deploying metrics-server app and having authorization to use the necessary docker image to work as expected. Test Plan: PASS: Upload and apply metrics-server, apply helm overrides to set sampleApp.create=true and re-apply metrics-server. Check if sample-app pod is up and healthy. PASS: Application-update with older version with sample-app enabled Closes-Bug: 2037081 Depends-On: https://review.opendev.org/c/starlingx/metrics-server-armada-app/+/891624 Change-Id: I5dafab3410981046ab36bded7e56ee27d0124f2d Signed-off-by: Luiz Felipe Kina --- ...001-Add-sample-app-to-metrics-server.patch | 40 +++++-------------- 1 file changed, 11 insertions(+), 29 deletions(-) diff --git a/metrics-server-helm/files/0001-Add-sample-app-to-metrics-server.patch b/metrics-server-helm/files/0001-Add-sample-app-to-metrics-server.patch index 5134b2f..0cb40eb 100644 --- a/metrics-server-helm/files/0001-Add-sample-app-to-metrics-server.patch +++ b/metrics-server-helm/files/0001-Add-sample-app-to-metrics-server.patch @@ -1,26 +1,23 @@ -From a85c2dad038d2538a58a2c34a3e659ce73b0f601 Mon Sep 17 00:00:00 2001 -From: Fernando Santos -Date: Wed, 9 Aug 2023 20:00:20 +0000 +From da1d57493657751bc5cce4379f254182e3ea0e73 Mon Sep 17 00:00:00 2001 +From: Luiz Felipe Kina +Date: Thu, 21 Sep 2023 15:24:19 -0300 Subject: [PATCH] Add sample app to metrics-server -Signed-off-by: Fernando Santos --- templates/sample-app-cluster-role-binding.yml | 16 ++++++++++++ templates/sample-app-cluster-role.yml | 17 +++++++++++++ templates/sample-app-deployment.yml | 25 +++++++++++++++++++ - templates/sample-app-namespace.yml | 6 +++++ templates/sample-app-service-account.yml | 9 +++++++ values.yaml | 9 +++++++ - 6 files changed, 82 insertions(+) + 5 files changed, 76 insertions(+) create mode 100644 templates/sample-app-cluster-role-binding.yml create mode 100644 templates/sample-app-cluster-role.yml create mode 100644 templates/sample-app-deployment.yml - create mode 100644 templates/sample-app-namespace.yml create mode 100644 templates/sample-app-service-account.yml diff --git a/templates/sample-app-cluster-role-binding.yml b/templates/sample-app-cluster-role-binding.yml new file mode 100644 -index 0000000..ad4e316 +index 0000000..cffc2f1 --- /dev/null +++ b/templates/sample-app-cluster-role-binding.yml @@ -0,0 +1,16 @@ @@ -38,9 +35,8 @@ index 0000000..ad4e316 +subjects: +- kind: ServiceAccount + name: metric-server-test-app -+ namespace: metric-server-test-app ++ namespace: metrics-server +{{- end }} -\ No newline at end of file diff --git a/templates/sample-app-cluster-role.yml b/templates/sample-app-cluster-role.yml new file mode 100644 index 0000000..c78fb28 @@ -67,7 +63,7 @@ index 0000000..c78fb28 \ No newline at end of file diff --git a/templates/sample-app-deployment.yml b/templates/sample-app-deployment.yml new file mode 100644 -index 0000000..d26498b +index 0000000..26de1cc --- /dev/null +++ b/templates/sample-app-deployment.yml @@ -0,0 +1,25 @@ @@ -76,7 +72,7 @@ index 0000000..d26498b +kind: Deployment +metadata: + name: metric-server-test-app-deployment -+ namespace: metric-server-test-app ++ namespace: metrics-server +spec: + selector: + matchLabels: @@ -96,21 +92,9 @@ index 0000000..d26498b + value: /var/run/secrets/kubernetes.io/serviceaccount/token + serviceAccountName: metric-server-test-app +{{- end -}} -diff --git a/templates/sample-app-namespace.yml b/templates/sample-app-namespace.yml -new file mode 100644 -index 0000000..5a83759 ---- /dev/null -+++ b/templates/sample-app-namespace.yml -@@ -0,0 +1,6 @@ -+{{- if .Values.sampleApp.create -}} -+apiVersion: v1 -+kind: Namespace -+metadata: -+ name: metric-server-test-app -+{{- end }} diff --git a/templates/sample-app-service-account.yml b/templates/sample-app-service-account.yml new file mode 100644 -index 0000000..5e116c0 +index 0000000..8c799c2 --- /dev/null +++ b/templates/sample-app-service-account.yml @@ -0,0 +1,9 @@ @@ -121,9 +105,8 @@ index 0000000..5e116c0 + labels: + app: metric-server-test-app + name: metric-server-test-app -+ namespace: metric-server-test-app ++ namespace: metrics-server +{{- end }} -\ No newline at end of file diff --git a/values.yaml b/values.yaml index fba10aa..b31a5fb 100644 --- a/values.yaml @@ -142,5 +125,4 @@ index fba10aa..b31a5fb 100644 + tag: stx.7.0-v1.0.0 + -- -2.17.1 - +2.25.1