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: Ic8d4454913fc4c65d1e17adb971f08200631f4d0
Story: 2007000
Task: 39713
Depends-On: https://review.opendev.org/719962
Signed-off-by: Jim Gauld <james.gauld@windriver.com>
This commit is contained in:
Jim Gauld 2020-05-08 17:52:01 -04:00
parent c3b37cebac
commit f786b4bf8a
2 changed files with 27 additions and 21 deletions
stx-nginx-ingress-controller-helm

@ -31,8 +31,10 @@ Source5: nginx_ingress_controller_manifest.yaml
BuildArch: noarch
BuildRequires: helm
BuildRequires: chartmuseum
Patch01: 0001-Update-for-kubernetes-API-1.16.patch
Patch02: 0002-Update-nginx-ingress-chart-for-Helm-v3.patch
%description
StarlingX Nginx Ingress Controller Application Armada Helm Charts
@ -41,30 +43,12 @@ StarlingX Nginx Ingress Controller Application Armada Helm Charts
%setup -n helm-charts
%patch01 -p1
%patch02 -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 file

@ -0,0 +1,22 @@
From 01e491844ccf4bc89533251c1868fd9e8bbb5483 Mon Sep 17 00:00:00 2001
From: Jim Gauld <james.gauld@windriver.com>
Date: Wed, 29 Apr 2020 16:36:02 -0400
Subject: [PATCH] Update nginx-ingress chart for Helm v3
Signed-off-by: Jim Gauld <james.gauld@windriver.com>
---
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