til.duyet.net
Search…
Helm: Public Helm chart repository with GitHub Pages

1. Create Helm Chart repo

2. Chart testing and linting

1
name: Helm Template Validation
2
​
3
on: [push, pull_request]
4
​
5
jobs:
6
chart-lint:
7
runs-on: ubuntu-latest
8
steps:
9
- uses: actions/[email protected]
10
11
- name: Fetch history
12
run: git fetch --prune --unshallow
13
14
- name: Run chart-testing (lint)
15
id: lint
16
uses: helm/chart-testing-[email protected]-rc.1
17
with:
18
config: .github/ct-lint.yaml
19
command: lint
20
​
21
- name: Create kind cluster
22
uses: helm/kind-[email protected]-alpha.3
23
# Only build a kind cluster if there are chart changes to test.
24
if: steps.lint.outputs.changed == 'true'
25
​
26
- name: Run chart-testing (install)
27
uses: helm/chart-testing-[email protected]-rc.1
28
with:
29
config: .github/ct-install.yaml
30
command: install
Copied!

3. Build helm chart

1
# helm package <chartname>/*
2
helm package amundsen/*
3
helm package spark-shuffle-service/*
4
​
5
# Successfully packaged chart and saved it to: ./amundsen-1.0.0.tgz
6
# Successfully packaged chart and saved it to: ./spark-shuffle-0.1.0.tgz
Copied!
Create the Helm chart repository index
According to Helm:
A repository is characterized primarily by the presence of a special file called index.yaml that has a list of all of the packages supplied by the repository, together with metadata that allows retrieving and verifying those packages.
Bash
cat index.yaml
1
helm repo index --url https://duyet.github.io/charts .
Copied!
1
apiVersion: v1
2
entries:
3
amundsen:
4
- apiVersion: v1
5
created: "2020-08-28T15:52:17.747491+07:00"
6
dependencies:
7
- condition: elasticsearch.enabled
8
name: elasticsearch
9
repository: https://kubernetes-charts.storage.googleapis.com/
10
version: 1.32.5
11
description: Amundsen is a metadata driven application for improving the productivity
12
of data analysts, data scientists and engineers when interacting with data.
13
digest: 92a30cb7c9e6523d277464eb381d0c96de5e496416270735283ba0a150a8c924
14
home: https://github.com/lyft/amundsen
15
icon: https://github.com/lyft/amundsen/blob/master/docs/img/logos/amundsen_logo_on_light.svg
16
keywords:
17
- metadata
18
- data
19
- amundsen
20
maintainers:
21
22
name: Duyet Le
23
name: amundsen
24
sources:
25
- https://github.com/lyft/amundsen
26
- https://github.com/duyet/charts/amundsen
27
urls:
28
- https://duyet.github.io/charts/amundsen-1.0.0.tgz
29
version: 1.0.0
30
- apiVersion: v1
31
created: "2020-08-28T15:52:17.754643+07:00"
32
dependencies:
33
- condition: elasticsearch.enabled
34
name: elasticsearch
35
repository: https://kubernetes-charts.storage.googleapis.com/
36
version: 1.32.5
37
description: Amundsen is a metadata driven application for improving the productivity
38
of data analysts, data scientists and engineers when interacting with data.
39
digest: b0cfdb0a9add154134299c72da8ff005da5686f6181b869820e046aafd8ef58e
40
home: https://github.com/lyft/amundsen
41
icon: https://github.com/lyft/amundsen/blob/master/docs/img/logos/amundsen_logo_on_light.svg
42
keywords:
43
- metadata
44
- data
45
- amundsen
46
maintainers:
47
48
name: Duyet Le
49
name: amundsen
50
sources:
51
- https://github.com/lyft/amundsen
52
- https://github.com/duyet/charts/amundsen
53
urls:
54
- https://duyet.github.io/charts/.dist/amundsen-1.0.0.tgz
55
version: 1.0.0
56
spark-shuffle:
57
- apiVersion: v1
58
appVersion: "1.0"
59
created: "2020-08-28T15:52:17.748015+07:00"
60
description: A Helm chart to deploy Spark shuffle service deamon set for Kubernetes
61
digest: 1da1d6b7f6121f2aefba4073974df472b2ce337433edd79a7cf2a1d799dee618
62
home: https://github.com/duyet/charts/tree/master/spark-shuffle-service
63
maintainers:
64
65
name: duyet
66
url: https://github.com/duyet/
67
name: spark-shuffle
68
urls:
69
- https://duyet.github.io/charts/spark-shuffle-0.1.0.tgz
70
version: 0.1.0
71
generated: "2020-08-28T15:52:17.741837+07:00"
72
​
Copied!
Automated to scan and build helm in subfolders:
build.sh
1
#!/bin/bash
2
set -x
3
​
4
for chart in ./*; do
5
if [ -f "$chart/Chart.yaml" ]; then
6
helm package $chart
7
fi
8
done
9
​
10
helm repo index --url https://duyet.github.io/charts .
Copied!

4. Public helm chart

You can commit the helm package to the master branch, then public all content by Github pages.
Settings > Github Pages

5. Github Workflows Action for build and publish

1
name: Publish helm packages
2
​
3
on:
4
push:
5
branches:
6
- release
7
​
8
jobs:
9
chart-lint-and-build:
10
runs-on: ubuntu-latest
11
steps:
12
- uses: actions/[email protected]
13
​
14
- name: Fetch history
15
run: git fetch --prune --unshallow
16
​
17
- name: Run chart-testing (lint)
18
id: lint
19
uses: helm/chart-testing-[email protected]-rc.1
20
with:
21
config: .github/ct-lint.yaml
22
command: lint
23
​
24
- name: Create kind cluster
25
uses: helm/kind-[email protected]-alpha.3
26
# Only build a kind cluster if there are chart changes to test.
27
if: steps.lint.outputs.changed == 'true'
28
​
29
- name: Run chart-testing (install)
30
uses: helm/chart-testing-[email protected]-rc.1
31
with:
32
config: .github/ct-install.yaml
33
command: install
34
​
35
- name: Helm build packages
36
run: ./build.sh
Copied!

6. Configure helm client for testing

1
$ helm repo add duyet https://duyet.github.io/charts/
2
# β€œduyet” has been added to your repositories
Copied!
Test the Helm chart repository
1
$ helm search commento
2
NAME CHART VERSION APP VERSION DESCRIPTION
3
[…]
4
duyet/commento 0.1.0 1.0 A Helm chart for Kubernetes
5
[…]
Copied!
​