From ebc6c72214fddb274b118aeeca6b59d97a9d958e Mon Sep 17 00:00:00 2001 From: Jim Gauld Date: Thu, 9 Apr 2020 11:31:15 -0400 Subject: [PATCH] Add support for Helm v3 This adds support for Helm v3. - 'helm init' and initialization is no longer required - 'chartmuseum' is used as a drop-in replacement for 'helm serv' - all Charts require the tag: apiVersion: v1 (or v2) This updates nginx-ingress chart to specify apiVersion. Change-Id: I6d084dafccbbc192ba5e1f5a998540e2728c9e22 Story: 2007000 Task: 39328 Depends-On: https://review.opendev.org/719962 Signed-off-by: Jim Gauld --- .../centos/monitor-helm-elastic.spec | 24 +++-------------- monitor-helm/centos/monitor-helm.spec | 26 ++++--------------- ...date-nginx-ingress-chart-for-Helm-v3.patch | 22 ++++++++++++++++ 3 files changed, 30 insertions(+), 42 deletions(-) create mode 100644 monitor-helm/files/0018-Update-nginx-ingress-chart-for-Helm-v3.patch diff --git a/monitor-helm-elastic/centos/monitor-helm-elastic.spec b/monitor-helm-elastic/centos/monitor-helm-elastic.spec index 0bb5f9b..f4f78a3 100644 --- a/monitor-helm-elastic/centos/monitor-helm-elastic.spec +++ b/monitor-helm-elastic/centos/monitor-helm-elastic.spec @@ -31,6 +31,7 @@ Patch11: 0011-Fix-Elasticsearch-readiness-probe-http-endpoint.patch Patch12: 0012-Add-logstash-ingress.patch BuildRequires: helm +BuildRequires: chartmuseum %description Monitor Helm elasticsearch charts @@ -50,28 +51,9 @@ Monitor Helm elasticsearch charts %patch12 -p1 %build -# initialize helm and build the toolkit -# helm init --client-only does not work if there is no networking -# The following commands do essentially the same as: helm init -%define helm_home %{getenv:HOME}/.helm -mkdir %{helm_home} -mkdir %{helm_home}/repository -mkdir %{helm_home}/repository/cache -mkdir %{helm_home}/repository/local -mkdir %{helm_home}/plugins -mkdir %{helm_home}/starters -mkdir %{helm_home}/cache -mkdir %{helm_home}/cache/archive - -# Stage a repository file that only has a local repo -cp %{SOURCE1} %{helm_home}/repository/repositories.yaml - -# Stage a local repo index that can be updated by the build -cp %{SOURCE2} %{helm_home}/repository/local/index.yaml - # Host a server for the charts -helm serve --repo-path . & -helm repo rm local +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 files diff --git a/monitor-helm/centos/monitor-helm.spec b/monitor-helm/centos/monitor-helm.spec index b639ab4..d7268a7 100644 --- a/monitor-helm/centos/monitor-helm.spec +++ b/monitor-helm/centos/monitor-helm.spec @@ -35,8 +35,10 @@ Patch14: 0014-Add-rbac-replicasets-to-apps-apigroup-commit-1717e2d.patch Patch15: 0015-script-flexibility.patch Patch16: 0016-use-main-container-image-for-initcontainer.patch Patch17: 0017-stable-nginx-ingress-allow-nodePort-for-tcp-udp-serv.patch +Patch18: 0018-Update-nginx-ingress-chart-for-Helm-v3.patch BuildRequires: helm +BuildRequires: chartmuseum %description Monitor Helm charts @@ -60,30 +62,12 @@ Monitor Helm charts %patch15 -p1 %patch16 -p1 %patch17 -p1 +%patch18 -p1 %build -# initialize helm and build the toolkit -# helm init --client-only does not work if there is no networking -# The following commands do essentially the same as: helm init -%define helm_home %{getenv:HOME}/.helm -mkdir %{helm_home} -mkdir %{helm_home}/repository -mkdir %{helm_home}/repository/cache -mkdir %{helm_home}/repository/local -mkdir %{helm_home}/plugins -mkdir %{helm_home}/starters -mkdir %{helm_home}/cache -mkdir %{helm_home}/cache/archive - -# Stage a repository file that only has a local repo -cp %{SOURCE1} %{helm_home}/repository/repositories.yaml - -# Stage a local repo index that can be updated by the build -cp %{SOURCE2} %{helm_home}/repository/local/index.yaml - # Host a server for the charts -helm serve --repo-path . & -helm repo rm local +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 files diff --git a/monitor-helm/files/0018-Update-nginx-ingress-chart-for-Helm-v3.patch b/monitor-helm/files/0018-Update-nginx-ingress-chart-for-Helm-v3.patch new file mode 100644 index 0000000..9b5ebfa --- /dev/null +++ b/monitor-helm/files/0018-Update-nginx-ingress-chart-for-Helm-v3.patch @@ -0,0 +1,22 @@ +From 8f31965ee80e72ef57b50481c2eec6ba30d89d13 Mon Sep 17 00:00:00 2001 +From: Jim Gauld +Date: Thu, 9 Apr 2020 10:50:50 -0400 +Subject: [PATCH] Update nginx-ingress chart for Helm v3 + +Signed-off-by: Jim Gauld +--- + stable/nginx-ingress/Chart.yaml | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/stable/nginx-ingress/Chart.yaml b/stable/nginx-ingress/Chart.yaml +index a9d64ed..6574c3f 100644 +--- a/stable/nginx-ingress/Chart.yaml ++++ b/stable/nginx-ingress/Chart.yaml +@@ -1,3 +1,4 @@ ++apiVersion: v1 + name: nginx-ingress + version: 1.4.0 + appVersion: 0.23.0 +-- +1.8.3.1 +