
Upgrade metrics-server helm charts version from 3.11.0 to 3.12.0 and metrics-server image version from 0.6.4 to 0.7.0. The new version supports k8s 1.24 - 1.29. Furthermore, the name of the example application, which was in the singular, and the readme, which was inconsistent, were corrected. Test Plan: PASS: Build package PASS: App upload/apply/update/remove/delete PASS: Check application version PASS: Run sample application Story: 2010681 Task: 49567 Change-Id: Ie592c03147b3cf40e9eeb631c18725d25460becf Signed-off-by: Erickson Silva de Oliveira <Erickson.SilvadeOliveira@windriver.com>
138 lines
4.1 KiB
Diff
138 lines
4.1 KiB
Diff
From 358191904954c1568f8e7545ea19c0764c338fb0 Mon Sep 17 00:00:00 2001
|
|
From: Erickson Silva de Oliveira <Erickson.SilvadeOliveira@windriver.com>
|
|
Date: Tue, 13 Feb 2024 09:13:29 -0300
|
|
Subject: [PATCH 1/2] Add sample app to metrics-server
|
|
|
|
This patch allows the creation of a metrics-server sample-app. It adds
|
|
the necessary elements to templates to create a sample-app pod on a
|
|
metrics-server namespace.
|
|
|
|
Signed-off-by: Erickson Silva de Oliveira <Erickson.SilvadeOliveira@windriver.com>
|
|
Signed-off-by: Luiz Felipe Kina <LuizFelipe.EiskeKina@windriver.com>
|
|
---
|
|
templates/sample-app-cluster-role-binding.yml | 16 ++++++++++++
|
|
templates/sample-app-cluster-role.yml | 17 +++++++++++++
|
|
templates/sample-app-deployment.yml | 25 +++++++++++++++++++
|
|
templates/sample-app-service-account.yml | 11 ++++++++
|
|
values.yaml | 8 ++++++
|
|
5 files changed, 77 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-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 00000000..cffc2f1a
|
|
--- /dev/null
|
|
+++ b/templates/sample-app-cluster-role-binding.yml
|
|
@@ -0,0 +1,16 @@
|
|
+{{- if .Values.sampleApp.create -}}
|
|
+apiVersion: rbac.authorization.k8s.io/v1
|
|
+kind: ClusterRoleBinding
|
|
+metadata:
|
|
+ labels:
|
|
+ app: metrics-server-test-app
|
|
+ name: access-metrics-api
|
|
+roleRef:
|
|
+ apiGroup: rbac.authorization.k8s.io
|
|
+ kind: ClusterRole
|
|
+ name: access-metrics-api
|
|
+subjects:
|
|
+- kind: ServiceAccount
|
|
+ name: metrics-server-test-app
|
|
+ namespace: metrics-server
|
|
+{{- end }}
|
|
diff --git a/templates/sample-app-cluster-role.yml b/templates/sample-app-cluster-role.yml
|
|
new file mode 100644
|
|
index 00000000..c78fb282
|
|
--- /dev/null
|
|
+++ b/templates/sample-app-cluster-role.yml
|
|
@@ -0,0 +1,17 @@
|
|
+{{- if .Values.sampleApp.create -}}
|
|
+apiVersion: rbac.authorization.k8s.io/v1
|
|
+kind: ClusterRole
|
|
+metadata:
|
|
+ labels:
|
|
+ app: metrics-server-test-app
|
|
+ name: access-metrics-api
|
|
+rules:
|
|
+- apiGroups:
|
|
+ - metrics.k8s.io
|
|
+ resources:
|
|
+ - pods
|
|
+ - nodes
|
|
+ verbs:
|
|
+ - get
|
|
+ - list
|
|
+{{- end }}
|
|
\ 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 00000000..26de1cc9
|
|
--- /dev/null
|
|
+++ b/templates/sample-app-deployment.yml
|
|
@@ -0,0 +1,25 @@
|
|
+{{- if .Values.sampleApp.create -}}
|
|
+apiVersion: apps/v1
|
|
+kind: Deployment
|
|
+metadata:
|
|
+ name: metrics-server-test-app-deployment
|
|
+ namespace: metrics-server
|
|
+spec:
|
|
+ selector:
|
|
+ matchLabels:
|
|
+ app: metrics-server-test-app
|
|
+ replicas: 1
|
|
+ template:
|
|
+ metadata:
|
|
+ labels:
|
|
+ app: metrics-server-test-app
|
|
+ spec:
|
|
+ containers:
|
|
+ - name: sample-app
|
|
+ image: {{ printf "%s:%s" .Values.sampleApp.image.repository (.Values.sampleApp.image.tag | default "latest") }}
|
|
+ imagePullPolicy: IfNotPresent
|
|
+ env:
|
|
+ - name: TOKEN_PATH
|
|
+ value: /var/run/secrets/kubernetes.io/serviceaccount/token
|
|
+ serviceAccountName: metrics-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 00000000..81b0ef6a
|
|
--- /dev/null
|
|
+++ b/templates/sample-app-service-account.yml
|
|
@@ -0,0 +1,11 @@
|
|
+{{- if .Values.sampleApp.create -}}
|
|
+apiVersion: v1
|
|
+imagePullSecrets:
|
|
+- name: default-registry-key
|
|
+kind: ServiceAccount
|
|
+metadata:
|
|
+ labels:
|
|
+ app: metrics-server-test-app
|
|
+ name: metrics-server-test-app
|
|
+ namespace: metrics-server
|
|
+{{- end }}
|
|
diff --git a/values.yaml b/values.yaml
|
|
index 4f6b9219..54567451 100644
|
|
--- a/values.yaml
|
|
+++ b/values.yaml
|
|
@@ -195,5 +195,13 @@ deploymentAnnotations: {}
|
|
|
|
schedulerName: ""
|
|
|
|
+# If you want to deploy a sample app application to test metrics server
|
|
+# Set the create value to true
|
|
+sampleApp:
|
|
+ create: false
|
|
+ image:
|
|
+ repository: docker.io/starlingx/stx-metrics-server-sample-app
|
|
+ tag: stx.7.0-v1.0.0
|
|
+
|
|
tmpVolume:
|
|
emptyDir: {}
|
|
--
|
|
2.34.1
|