diff --git a/centos_pkg_dirs b/centos_pkg_dirs index 4aa6b80..517578d 100644 --- a/centos_pkg_dirs +++ b/centos_pkg_dirs @@ -1 +1,2 @@ +metrics-server-helm stx-metrics-server-helm diff --git a/centos_tarball-dl.lst b/centos_tarball-dl.lst new file mode 100644 index 0000000..6e00cfa --- /dev/null +++ b/centos_tarball-dl.lst @@ -0,0 +1 @@ +metrics-server-e67ee73cfc51e27eaf46b2af0ae8debd16c86d26.tgz#metrics-server#https://github.com/kubernetes-sigs/metrics-server/releases/download/metrics-server-helm-chart-3.8.2/metrics-server-3.8.2.tgz#http## diff --git a/debian_pkg_dirs b/debian_pkg_dirs index 4aa6b80..6d48bbe 100644 --- a/debian_pkg_dirs +++ b/debian_pkg_dirs @@ -1 +1,2 @@ stx-metrics-server-helm +metrics-server-helm diff --git a/metrics-server-helm/README.rst b/metrics-server-helm/README.rst new file mode 100644 index 0000000..e69de29 diff --git a/metrics-server-helm/centos/build_srpm.data b/metrics-server-helm/centos/build_srpm.data new file mode 100644 index 0000000..99b3d88 --- /dev/null +++ b/metrics-server-helm/centos/build_srpm.data @@ -0,0 +1,9 @@ +TAR_NAME=metrics-server +SHA=e67ee73cfc51e27eaf46b2af0ae8debd16c86d26 +VERSION=1.0.0 +TAR="$TAR_NAME-$SHA.tgz" + +COPY_LIST="${CGCS_BASE}/downloads/$TAR $PKG_BASE/files/* " + +TIS_PATCH_VER=PKG_GITREVCOUNT + diff --git a/metrics-server-helm/centos/metrics-server-helm.spec b/metrics-server-helm/centos/metrics-server-helm.spec new file mode 100644 index 0000000..213a010 --- /dev/null +++ b/metrics-server-helm/centos/metrics-server-helm.spec @@ -0,0 +1,57 @@ +# Build variables +%global helm_folder /usr/lib/helm + +%global sha e67ee73cfc51e27eaf46b2af0ae8debd16c86d26 + +Summary: Metrics-server helm chart +Name: metrics-server-helm +Version: 1.0 +Release: %{tis_patch_ver}%{?_tis_dist} +License: Apache-2.0 +Group: base +Packager: Wind River +URL: https://github.com/kubernetes-sigs/metrics-server#installation + +Source0: metrics-server-%{sha}.tgz +Source1: repositories.yaml +Source2: index.yaml +Source3: Makefile + +BuildArch: noarch + +Patch01: 0001-PATCH-Add-sample-app-to-metrics-server.patch + +BuildRequires: helm +BuildRequires: chartmuseum + +%description +StarlingX Metrics-Server Helm Charts + +%prep +%setup -n metrics-server + +%patch01 -p1 + +%build +# Host a server for the charts +chartmuseum --debug --port=8879 --context-path='/charts' --storage="local" --storage-local-rootdir="." & +sleep 2 +helm repo add local http://localhost:8879/charts + +# Create the tgz file +cd ../ +cp %{SOURCE3} ./ +make metrics-server + +# terminate helm server (the last backgrounded task) +kill %1 + +%install +cd ../ +install -d -m 755 ${RPM_BUILD_ROOT}%{helm_folder} +install -p -D -m 755 *.tgz ${RPM_BUILD_ROOT}%{helm_folder} + +%files +%defattr(-,root,root,-) +%{helm_folder}/* + diff --git a/metrics-server-helm/debian/deb_folder/changelog b/metrics-server-helm/debian/deb_folder/changelog new file mode 100644 index 0000000..b11d2ff --- /dev/null +++ b/metrics-server-helm/debian/deb_folder/changelog @@ -0,0 +1,5 @@ +metrics-server-helm (1.0) unstable; urgency=medium + + * Initial release. + +-- Luiz Felipe Kina Thu, 24 Mar 2022 17:50: +0000 diff --git a/metrics-server-helm/debian/deb_folder/control b/metrics-server-helm/debian/deb_folder/control new file mode 100644 index 0000000..2191aa7 --- /dev/null +++ b/metrics-server-helm/debian/deb_folder/control @@ -0,0 +1,18 @@ +Source: metrics-server-helm +Section: libs +Priority: optional +Maintainer: StarlingX Developers +Build-Depends: debhelper-compat (= 13), + chartmuseum, + helm, + procps +Standards-Version: 4.5.1 +Homepage: https://www.starlingx.io + +Package: metrics-server-helm +Section: libs +Architecture: any +Depends: ${misc:Depends} +Description: StarlingX Metrics Server Helm Charts + This package contains certificate manager helm charts for the certificate + manager application. diff --git a/metrics-server-helm/debian/deb_folder/copyright b/metrics-server-helm/debian/deb_folder/copyright new file mode 100644 index 0000000..43c8791 --- /dev/null +++ b/metrics-server-helm/debian/deb_folder/copyright @@ -0,0 +1,41 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: metrics-server-helm +Source: https://opendev.org/starlingx/cert-manager-armada-app/ + +Files: * +Copyright: (c) 2013-2021 Wind River Systems, Inc +License: Apache-2 + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + . + https://www.apache.org/licenses/LICENSE-2.0 + . + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + . + On Debian-based systems the full text of the Apache version 2.0 license + can be found in `/usr/share/common-licenses/Apache-2.0'. + +# If you want to use GPL v2 or later for the /debian/* files use +# the following clauses, or change it to suit. Delete these two lines +Files: debian/* +Copyright: 2021 Wind River Systems, Inc +License: Apache-2 + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + . + https://www.apache.org/licenses/LICENSE-2.0 + . + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + . + On Debian-based systems the full text of the Apache version 2.0 license + can be found in `/usr/share/common-licenses/Apache-2.0'. diff --git a/metrics-server-helm/debian/deb_folder/rules b/metrics-server-helm/debian/deb_folder/rules new file mode 100644 index 0000000..d1d7919 --- /dev/null +++ b/metrics-server-helm/debian/deb_folder/rules @@ -0,0 +1,25 @@ +#!/usr/bin/make -f +# export DH_VERBOSE = 1 + +export ROOT = debian/tmp +export METRICS_MGR_PKG="metrics-server-3.8.2.tgz" + +%: + dh $@ + +override_dh_auto_build: + tar xzf $(METRICS_MGR_PKG) + # Host a server for the helm charts. + chartmuseum --debug --port=8879 --context-path='/charts' --storage="local" \ + --storage-local-rootdir="." & + sleep 2 + # Copy Chart yaml file to build folder + cp metrics-server/Chart.yaml debian/Chart.yaml + # Create the TGZ file. + make + # Terminate the helm chart server. + pkill chartmuseum + +override_dh_auto_install: + +override_dh_auto_test: diff --git a/metrics-server-helm/debian/meta_data.yaml b/metrics-server-helm/debian/meta_data.yaml new file mode 100644 index 0000000..0d68dc8 --- /dev/null +++ b/metrics-server-helm/debian/meta_data.yaml @@ -0,0 +1,12 @@ +--- +debname: metrics-server-helm +debver: 1.0 +src_path: files +dl_files: + metrics-server-3.8.2.tgz: + topdir: null + url: https://github.com/kubernetes-sigs/metrics-server/releases/download/metrics-server-helm-chart-3.8.2/metrics-server-3.8.2.tgz + md5sum: 93f38ed20dd55618b4bf67584908b56c +revision: + dist: $STX_DIST + PKG_GITREVCOUNT: true diff --git a/metrics-server-helm/files/0001-PATCH-Add-sample-app-to-metrics-server.patch b/metrics-server-helm/files/0001-PATCH-Add-sample-app-to-metrics-server.patch new file mode 100644 index 0000000..1373f5c --- /dev/null +++ b/metrics-server-helm/files/0001-PATCH-Add-sample-app-to-metrics-server.patch @@ -0,0 +1,145 @@ +From 2df39de8e32eccc76fe62b97eaf0bc5debc58023 Mon Sep 17 00:00:00 2001 +From: Delfino Curado +Date: Thu, 3 Mar 2022 10:36:48 -0300 +Subject: [PATCH] [PATCH] Add sample app to metrics-server + +--- + 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(+) + 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 +--- /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: metric-server-test-app ++ name: access-metrics-api ++roleRef: ++ apiGroup: rbac.authorization.k8s.io ++ kind: ClusterRole ++ name: access-metrics-api ++subjects: ++- kind: ServiceAccount ++ name: metric-server-test-app ++ namespace: metric-server-test-app ++{{- 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 +--- /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: metric-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 0000000..d26498b +--- /dev/null ++++ b/templates/sample-app-deployment.yml +@@ -0,0 +1,25 @@ ++{{- if .Values.sampleApp.create -}} ++apiVersion: apps/v1 ++kind: Deployment ++metadata: ++ name: metric-server-test-app-deployment ++ namespace: metric-server-test-app ++spec: ++ selector: ++ matchLabels: ++ app: metric-server-test-app ++ replicas: 1 ++ template: ++ metadata: ++ labels: ++ app: metric-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: 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 +--- /dev/null ++++ b/templates/sample-app-service-account.yml +@@ -0,0 +1,9 @@ ++{{- if .Values.sampleApp.create -}} ++apiVersion: v1 ++kind: ServiceAccount ++metadata: ++ labels: ++ app: metric-server-test-app ++ name: metric-server-test-app ++ namespace: metric-server-test-app ++{{- end }} +\ No newline at end of file +diff --git a/values.yaml b/values.yaml +index 6a97505..7f40309 100644 +--- a/values.yaml ++++ b/values.yaml +@@ -128,3 +128,12 @@ nodeSelector: {} + tolerations: [] + + affinity: {} ++ ++# 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: master-centos-stable-latest ++ +-- +2.17.1 + diff --git a/metrics-server-helm/files/Makefile b/metrics-server-helm/files/Makefile new file mode 100644 index 0000000..0f838e0 --- /dev/null +++ b/metrics-server-helm/files/Makefile @@ -0,0 +1,41 @@ +# Copyright (c) 2022 Wind River Systems, Inc. +# # +# # SPDX-License-Identifier: Apache-2.0 +# # +# # It's necessary to set this because some environments don't link sh -> bash. +SHELL := /bin/bash +TASK := build + +EXCLUDES := helm-toolkit doc tests tools logs tmp +CHARTS := helm-toolkit $(filter-out $(EXCLUDES), $(patsubst %/.,%,$(wildcard */.))) + +.PHONY: $(EXCLUDES) $(CHARTS) + +all: $(CHARTS) + +$(CHARTS): + @if [ -d $@ ]; then \ + echo; \ + echo "===== Processing [$@] chart ====="; \ + make $(TASK)-$@; \ + fi + +init-%: + if [ -f $*/Makefile ]; then make -C $*; fi + if [ -f $*/requirements.yaml ]; then helm dep up $*; fi + +lint-%: init-% + if [ -d $* ]; then helm lint $*; fi + +build-%: lint-% + if [ -d $* ]; then helm package $*; fi + +clean: + @echo "Clean all build artifacts" + rm -f */templates/_partials.tpl */templates/_globals.tpl + rm -f *tgz */charts/*tgz */requirements.lock + rm -rf */charts */tmpcharts + +%: + @: + diff --git a/metrics-server-helm/files/index.yaml b/metrics-server-helm/files/index.yaml new file mode 100644 index 0000000..2b142ca --- /dev/null +++ b/metrics-server-helm/files/index.yaml @@ -0,0 +1,5 @@ +--- +apiVersion: v1 +entries: {} +generated: 2022-03-01T12:33:46.098166523-06:00 + diff --git a/metrics-server-helm/files/repositories.yaml b/metrics-server-helm/files/repositories.yaml new file mode 100644 index 0000000..115a085 --- /dev/null +++ b/metrics-server-helm/files/repositories.yaml @@ -0,0 +1,13 @@ +--- +apiVersion: v1 +generated: 2022-03-02T15:19:36.215111369-06:00 +repositories: + - caFile: "" + cache: /builddir/.helm/repository/cache/local-index.yaml + certFile: "" + keyFile: "" + name: local + password: "" + url: http://127.0.0.1:8879/charts + username: "" + diff --git a/stx-metrics-server-helm/centos/build_srpm.data b/stx-metrics-server-helm/centos/build_srpm.data index eab950b..4d83916 100644 --- a/stx-metrics-server-helm/centos/build_srpm.data +++ b/stx-metrics-server-helm/centos/build_srpm.data @@ -5,3 +5,8 @@ SRC_BASE_SRCREV=9fa1ccbdbae09c9726642bfbb5b20e27cd729f2c COPY_LIST_TO_TAR="\ $STX_BASE/helm-charts/psp-rolebinding/psp-rolebinding/helm-charts \ " + +OPT_DEP_LIST="\ + $STX_BASE/metrics-server-armada-app/metrics-server-helm \ +" + diff --git a/stx-metrics-server-helm/centos/stx-metrics-server-helm.spec b/stx-metrics-server-helm/centos/stx-metrics-server-helm.spec index 6f37ddf..3c1adf8 100644 --- a/stx-metrics-server-helm/centos/stx-metrics-server-helm.spec +++ b/stx-metrics-server-helm/centos/stx-metrics-server-helm.spec @@ -22,6 +22,7 @@ BuildArch: noarch BuildRequires: helm BuildRequires: chartmuseum +BuildRequires: metrics-server-helm %description StarlingX Metrics Server Armada Helm Charts @@ -53,6 +54,7 @@ cp files/metadata.yaml %{app_staging} cp manifests/*.yaml %{app_staging} mkdir -p %{app_staging}/charts cp helm-charts/*.tgz %{app_staging}/charts +cp %{helm_folder}/metrics*.tgz %{app_staging}/charts cd %{app_staging} # Populate metadata diff --git a/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/Chart.yaml b/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/Chart.yaml deleted file mode 100644 index b3f8203..0000000 --- a/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/Chart.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: v2 -name: metrics-server -description: Helm chart for the Kubernetes Metrics Server. -type: application -version: 1.0.0 -appVersion: 0.4.1 -keywords: - - kubernetes - - metrics-server - - metrics -home: https://github.com/kubernetes-sigs/metrics-server -icon: https://avatars.githubusercontent.com/u/36015203?s=400&v=4 -sources: - - https://github.com/kubernetes-sigs/metrics-server diff --git a/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/templates/_helpers.tpl b/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/templates/_helpers.tpl deleted file mode 100644 index a1ab9dc..0000000 --- a/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/templates/_helpers.tpl +++ /dev/null @@ -1,62 +0,0 @@ -{{/* -Expand the name of the chart. -*/}} -{{- define "metrics-server.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "metrics-server.fullname" -}} -{{- if .Values.fullnameOverride }} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- $name := default .Chart.Name .Values.nameOverride }} -{{- if contains $name .Release.Name }} -{{- .Release.Name | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} -{{- end }} -{{- end }} -{{- end }} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "metrics-server.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Common labels -*/}} -{{- define "metrics-server.labels" -}} -helm.sh/chart: {{ include "metrics-server.chart" . }} -{{ include "metrics-server.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end }} - -{{/* -Selector labels -*/}} -{{- define "metrics-server.selectorLabels" -}} -app.kubernetes.io/name: {{ include "metrics-server.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end }} - -{{/* -Create the name of the service account to use -*/}} -{{- define "metrics-server.serviceAccountName" -}} -{{- if .Values.serviceAccount.create }} -{{- default (include "metrics-server.fullname" .) .Values.serviceAccount.name }} -{{- else }} -{{- default "default" .Values.serviceAccount.name }} -{{- end }} -{{- end }} diff --git a/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/templates/apiservice.yaml b/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/templates/apiservice.yaml deleted file mode 100644 index dd37b5d..0000000 --- a/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/templates/apiservice.yaml +++ /dev/null @@ -1,17 +0,0 @@ -{{- if .Values.apiService.create -}} -apiVersion: apiregistration.k8s.io/v1 -kind: APIService -metadata: - name: v1beta1.metrics.k8s.io - labels: - {{- include "metrics-server.labels" . | nindent 4 }} -spec: - group: metrics.k8s.io - groupPriorityMinimum: 100 - insecureSkipTLSVerify: true - service: - name: {{ include "metrics-server.fullname" . }} - namespace: {{ .Release.Namespace }} - version: v1beta1 - versionPriority: 100 -{{- end -}} diff --git a/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/templates/clusterrole-aggregated-reader.yaml b/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/templates/clusterrole-aggregated-reader.yaml deleted file mode 100644 index d5e8fe1..0000000 --- a/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/templates/clusterrole-aggregated-reader.yaml +++ /dev/null @@ -1,21 +0,0 @@ -{{- if .Values.rbac.create -}} -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: {{ printf "system:%s-aggregated-reader" (include "metrics-server.name" .) }} - labels: - {{- include "metrics-server.labels" . | nindent 4 }} - rbac.authorization.k8s.io/aggregate-to-admin: "true" - rbac.authorization.k8s.io/aggregate-to-edit: "true" - rbac.authorization.k8s.io/aggregate-to-view: "true" -rules: - - apiGroups: - - metrics.k8s.io - resources: - - pods - - nodes - verbs: - - get - - list - - watch -{{- end -}} diff --git a/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/templates/clusterrole.yaml b/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/templates/clusterrole.yaml deleted file mode 100644 index 0636414..0000000 --- a/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/templates/clusterrole.yaml +++ /dev/null @@ -1,32 +0,0 @@ -{{- if .Values.rbac.create -}} -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: {{ printf "system:%s" (include "metrics-server.fullname" .) }} - labels: - {{- include "metrics-server.labels" . | nindent 4 }} -rules: - - apiGroups: - - "" - resources: - - pods - - nodes - - nodes/stats - - namespaces - - configmaps - verbs: - - get - - list - - watch - {{- if .Values.rbac.pspEnabled }} - - apiGroups: - - extensions - - policy - resources: - - podsecuritypolicies - resourceNames: - - {{ printf "privileged-%s" (include "metrics-server.fullname" .) }} - verbs: - - use - {{- end -}} -{{- end -}} diff --git a/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/templates/clusterrolebinding-auth-delegator.yaml b/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/templates/clusterrolebinding-auth-delegator.yaml deleted file mode 100644 index 826c3b7..0000000 --- a/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/templates/clusterrolebinding-auth-delegator.yaml +++ /dev/null @@ -1,16 +0,0 @@ -{{- if .Values.rbac.create -}} -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: {{ printf "%s:system:auth-delegator" (include "metrics-server.fullname" .) }} - labels: - {{- include "metrics-server.labels" . | nindent 4 }} -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: system:auth-delegator -subjects: - - kind: ServiceAccount - name: {{ include "metrics-server.serviceAccountName" . }} - namespace: {{ .Release.Namespace }} -{{- end -}} diff --git a/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/templates/clusterrolebinding.yaml b/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/templates/clusterrolebinding.yaml deleted file mode 100644 index 512cb65..0000000 --- a/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/templates/clusterrolebinding.yaml +++ /dev/null @@ -1,16 +0,0 @@ -{{- if .Values.rbac.create -}} -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: {{ printf "system:%s" (include "metrics-server.fullname" .) }} - labels: - {{- include "metrics-server.labels" . | nindent 4 }} -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: system:{{ template "metrics-server.fullname" . }} -subjects: - - kind: ServiceAccount - name: {{ include "metrics-server.serviceAccountName" . }} - namespace: {{ .Release.Namespace }} -{{- end -}} diff --git a/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/templates/deployment.yaml b/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/templates/deployment.yaml deleted file mode 100644 index c3bd84d..0000000 --- a/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/templates/deployment.yaml +++ /dev/null @@ -1,75 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "metrics-server.fullname" . }} - labels: - {{- include "metrics-server.labels" . | nindent 4 }} -spec: - replicas: {{ .Values.replicas }} - selector: - matchLabels: - {{- include "metrics-server.selectorLabels" . | nindent 6 }} - template: - metadata: - {{- with .Values.podAnnotations }} - annotations: - {{- toYaml . | nindent 8 }} - {{- end }} - labels: - {{- include "metrics-server.selectorLabels" . | nindent 8 }} - app: metrics-server - spec: - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - serviceAccountName: {{ include "metrics-server.serviceAccountName" . }} - securityContext: - {{- toYaml .Values.podSecurityContext | nindent 8 }} - {{- with .Values.priorityClassName }} - priorityClassName: {{ . | quote }} - {{- end }} - {{- if .Values.hostNetwork.enabled }} - hostNetwork: true - {{- end }} - containers: - - name: {{ .Chart.Name }} - securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} - image: {{ printf "%s:%s" .Values.image.repository (.Values.image.tag | default (printf "v%s" .Chart.AppVersion)) }} - imagePullPolicy: {{ .Values.image.pullPolicy }} - args: - - --cert-dir=/tmp - - --secure-port=4443 - - --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname - - --kubelet-use-node-status-port - - --logtostderr - {{- range .Values.args }} - - {{ . }} - {{- end }} - ports: - - name: https - containerPort: 4443 - protocol: TCP - livenessProbe: - {{- toYaml .Values.livenessProbe | nindent 12 }} - readinessProbe: - {{- toYaml .Values.readinessProbe | nindent 12 }} - volumeMounts: - - name: tmp - mountPath: /tmp - volumes: - - name: tmp - emptyDir: {} - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} diff --git a/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/templates/pdb.yaml b/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/templates/pdb.yaml deleted file mode 100644 index cda6b4e..0000000 --- a/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/templates/pdb.yaml +++ /dev/null @@ -1,18 +0,0 @@ -{{- if .Values.podDisruptionBudget.enabled -}} -apiVersion: policy/v1beta1 -kind: PodDisruptionBudget -metadata: - name: {{ include "metrics-server.fullname" . }} - labels: - {{- include "metrics-server.labels" . | nindent 4 }} -spec: - {{- if .Values.podDisruptionBudget.minAvailable }} - minAvailable: {{ .Values.podDisruptionBudget.minAvailable }} - {{- end }} - {{- if .Values.podDisruptionBudget.maxUnavailable }} - maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }} - {{- end }} - selector: - matchLabels: - app.kubernetes.io/name: {{ include "metrics-server.name" . }} -{{- end -}} diff --git a/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/templates/psp.yaml b/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/templates/psp.yaml deleted file mode 100644 index bf8ace1..0000000 --- a/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/templates/psp.yaml +++ /dev/null @@ -1,28 +0,0 @@ -{{- if .Values.rbac.pspEnabled }} -apiVersion: policy/v1beta1 -kind: PodSecurityPolicy -metadata: - name: {{ printf "privileged-%s" (include "metrics-server.fullname" .) }} - labels: - {{- include "metrics-server.labels" . | nindent 4 }} -spec: - allowedCapabilities: - - '*' - fsGroup: - rule: RunAsAny - privileged: true - runAsUser: - rule: RunAsAny - seLinux: - rule: RunAsAny - supplementalGroups: - rule: RunAsAny - volumes: - - '*' - hostPID: true - hostIPC: true - hostNetwork: true - hostPorts: - - min: 1 - max: 65536 -{{- end }} diff --git a/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/templates/rolebinding.yaml b/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/templates/rolebinding.yaml deleted file mode 100644 index 3fda743..0000000 --- a/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/templates/rolebinding.yaml +++ /dev/null @@ -1,17 +0,0 @@ -{{- if .Values.rbac.create -}} -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: {{ printf "%s-auth-reader" (include "metrics-server.fullname" .) }} - namespace: kube-system - labels: - {{- include "metrics-server.labels" . | nindent 4 }} -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: extension-apiserver-authentication-reader -subjects: - - kind: ServiceAccount - name: {{ include "metrics-server.serviceAccountName" . }} - namespace: {{ .Release.Namespace }} -{{- end -}} diff --git a/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/templates/sample-app-cluster-role-binding.yml b/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/templates/sample-app-cluster-role-binding.yml deleted file mode 100644 index ad4e316..0000000 --- a/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/templates/sample-app-cluster-role-binding.yml +++ /dev/null @@ -1,16 +0,0 @@ -{{- if .Values.sampleApp.create -}} -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - labels: - app: metric-server-test-app - name: access-metrics-api -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: access-metrics-api -subjects: -- kind: ServiceAccount - name: metric-server-test-app - namespace: metric-server-test-app -{{- end }} \ No newline at end of file diff --git a/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/templates/sample-app-cluster-role.yml b/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/templates/sample-app-cluster-role.yml deleted file mode 100644 index c78fb28..0000000 --- a/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/templates/sample-app-cluster-role.yml +++ /dev/null @@ -1,17 +0,0 @@ -{{- if .Values.sampleApp.create -}} -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - labels: - app: metric-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/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/templates/sample-app-deployment.yml b/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/templates/sample-app-deployment.yml deleted file mode 100644 index c318dd9..0000000 --- a/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/templates/sample-app-deployment.yml +++ /dev/null @@ -1,25 +0,0 @@ -{{- if .Values.sampleApp.create -}} -apiVersion: apps/v1 -kind: Deployment -metadata: - name: metric-server-test-app-deployment - namespace: metric-server-test-app -spec: - selector: - matchLabels: - app: metric-server-test-app - replicas: 1 - template: - metadata: - labels: - app: metric-server-test-app - spec: - containers: - - name: sample-app - image: docker.io/starlingx/stx-metrics-server-sample-app - imagePullPolicy: IfNotPresent - env: - - name: TOKEN_PATH - value: /var/run/secrets/kubernetes.io/serviceaccount/token - serviceAccountName: metric-server-test-app -{{- end -}} diff --git a/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/templates/sample-app-namespace.yml b/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/templates/sample-app-namespace.yml deleted file mode 100644 index 5a83759..0000000 --- a/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/templates/sample-app-namespace.yml +++ /dev/null @@ -1,6 +0,0 @@ -{{- if .Values.sampleApp.create -}} -apiVersion: v1 -kind: Namespace -metadata: - name: metric-server-test-app -{{- end }} diff --git a/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/templates/sample-app-service-account.yml b/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/templates/sample-app-service-account.yml deleted file mode 100644 index 5e116c0..0000000 --- a/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/templates/sample-app-service-account.yml +++ /dev/null @@ -1,9 +0,0 @@ -{{- if .Values.sampleApp.create -}} -apiVersion: v1 -kind: ServiceAccount -metadata: - labels: - app: metric-server-test-app - name: metric-server-test-app - namespace: metric-server-test-app -{{- end }} \ No newline at end of file diff --git a/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/templates/service.yaml b/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/templates/service.yaml deleted file mode 100644 index abbb659..0000000 --- a/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/templates/service.yaml +++ /dev/null @@ -1,22 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ include "metrics-server.fullname" . }} - {{- with .Values.service.annotations }} - annotations: - {{ toYaml . | nindent 4 }} - {{- end }} - labels: - {{- include "metrics-server.labels" . | nindent 4 }} - {{- with .Values.service.labels -}} - {{ toYaml . | nindent 4 }} - {{- end }} -spec: - type: {{ .Values.service.type }} - ports: - - name: https - port: {{ .Values.service.port }} - protocol: TCP - targetPort: https - selector: - {{- include "metrics-server.selectorLabels" . | nindent 4 }} diff --git a/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/templates/serviceaccount.yaml b/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/templates/serviceaccount.yaml deleted file mode 100644 index 12f7724..0000000 --- a/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/templates/serviceaccount.yaml +++ /dev/null @@ -1,12 +0,0 @@ -{{- if .Values.serviceAccount.create -}} -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ template "metrics-server.serviceAccountName" . }} - {{- with .Values.serviceAccount.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} - labels: - {{- include "metrics-server.labels" . | nindent 4 }} -{{- end -}} diff --git a/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/values.yaml b/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/values.yaml deleted file mode 100644 index 69ca3e2..0000000 --- a/stx-metrics-server-helm/stx-metrics-server-helm/helm-charts/metrics-server/values.yaml +++ /dev/null @@ -1,104 +0,0 @@ -# Default values for metrics-server. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -image: - repository: k8s.gcr.io/metrics-server/metrics-server - # Overrides the image tag whose default is jetty-v{{ .Chart.AppVersion }} - tag: "" - pullPolicy: IfNotPresent - -imagePullSecrets: [] -# - registrySecretName - -nameOverride: "" -fullnameOverride: "" - -serviceAccount: - # Specifies whether a service account should be created - create: true - # Annotations to add to the service account - 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: "" - -rbac: - # Specifies whether RBAC resources should be created - create: true - pspEnabled: false - -apiService: - # Specifies if the v1beta1.metrics.k8s.io API service should be created. - # - # You typically want this enabled! If you disable API service creation you have to - # manage it outside of this chart for e.g horizontal pod autoscaling to - # work with this release. - create: true - -podAnnotations: {} - -podSecurityContext: {} - -securityContext: - allowPrivilegeEscalation: false - capabilities: - drop: ["all"] - readOnlyRootFilesystem: true - runAsGroup: 10001 - runAsNonRoot: true - runAsUser: 10001 - -priorityClassName: "system-cluster-critical" - -hostNetwork: - # Specifies if metrics-server should be started in hostNetwork mode. - # - # You would require this enabled if you use alternate overlay networking for pods and - # API server unable to communicate with metrics-server. As an example, this is required - # if you use Weave network on EKS - enabled: false - -replicas: 1 - -args: [] - -livenessProbe: - httpGet: - path: /healthz - port: https - scheme: HTTPS - initialDelaySeconds: 20 - -readinessProbe: - httpGet: - path: /healthz - port: https - scheme: HTTPS - initialDelaySeconds: 20 - -service: - annotations: {} - labels: {} - # Add these labels to have metrics-server show up in `kubectl cluster-info` - # kubernetes.io/cluster-service: "true" - # kubernetes.io/name: "Metrics-server" - port: 443 - type: ClusterIP - -nodeSelector: {} - -tolerations: [] - -affinity: {} - -podDisruptionBudget: - # https://kubernetes.io/docs/tasks/run-application/configure-pdb/ - enabled: false - minAvailable: - maxUnavailable: - -# If you want to deploy a sample app application to test metrics server -# Set the create value to true -sampleApp: - create: false diff --git a/stx-metrics-server-helm/stx-metrics-server-helm/manifests/metrics-server_manifest.yaml b/stx-metrics-server-helm/stx-metrics-server-helm/manifests/metrics-server_manifest.yaml index 5b5418a..94fbc2c 100644 --- a/stx-metrics-server-helm/stx-metrics-server-helm/manifests/metrics-server_manifest.yaml +++ b/stx-metrics-server-helm/stx-metrics-server-helm/manifests/metrics-server_manifest.yaml @@ -57,7 +57,7 @@ data: replicas: 1 image: repository: k8s.gcr.io/metrics-server/metrics-server - tag: "v0.4.1" + tag: "v0.6.1" tolerations: - key: "node-role.kubernetes.io/master" operator: "Exists" @@ -66,7 +66,7 @@ data: node-role.kubernetes.io/master: "" source: type: tar - location: http://172.17.0.1/helm_charts/stx-platform/metrics-server-1.0.0.tgz + location: http://172.17.0.1/helm_charts/stx-platform/metrics-server-3.8.2.tgz subpath: metrics-server reference: master dependencies: [] @@ -89,4 +89,4 @@ metadata: data: release_prefix: ms chart_groups: - - metrics-server \ No newline at end of file + - metrics-server