Skip to content

Commit 139810d

Browse files
committed
Create Helm Chart from Static Manifests
**What type of PR is this?** /kind feature **What this PR does / why we need it**: This PR convert our static deployment manifests from `deploy/kubernetes-latest/*` into Helm Charts under `charts/*`, by running a convert script under `deploy/util/chart-releaser.sh`. Moreover, it handle the chart release with branch `gh-pages`, by integrate with https://github.com/helm/chart-releaser-action. The sample helm repo could find from https://alvistack.github.io/kubernetes-csi-csi-driver-host-path/index.yaml, by: helm repo add csi-driver-host-path https://alvistack.github.io/kubernetes-csi-csi-driver-host-path/ helm repo update helm search repo csi-driver-host-path Before each stable tag release, maintainers only required to: 1. Run the `./deploy/kubernetes-latest/chart-releaser.sh` and update templates under `charts/*/templates/*` 2. Double confirm `charts/*/values.yml` with correct values, e.g. image tags 3. `git add --all --force charts/* && git commit` Signed-off-by: Wong Hoi Sing Edison <[email protected]>
1 parent a7a88c4 commit 139810d

16 files changed

+1439
-0
lines changed

Diff for: .github/workflows/release.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Release Charts
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
release:
10+
permissions:
11+
contents: write
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Configure Git
20+
run: |
21+
git config user.name "$GITHUB_ACTOR"
22+
git config user.email "[email protected]"
23+
24+
- name: Run chart-releaser
25+
uses: helm/[email protected]
26+
env:
27+
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

Diff for: charts/csi-hostpathplugin/.helmignore

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/

Diff for: charts/csi-hostpathplugin/Chart.yaml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
apiVersion: v2
2+
name: csi-hostpathplugin
3+
description: A Helm chart for deploy the CSI Hostpath driver
4+
5+
# A chart can be either an 'application' or a 'library' chart.
6+
#
7+
# Application charts are a collection of templates that can be packaged into versioned archives
8+
# to be deployed.
9+
#
10+
# Library charts provide useful utilities or functions for the chart developer. They're included as
11+
# a dependency of application charts to inject those utilities and functions into the rendering
12+
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
13+
type: application
14+
15+
# This is the chart version. This version number should be incremented each time you make changes
16+
# to the chart and its templates, including the app version.
17+
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18+
version: v1.16.1
19+
20+
# This is the version number of the application being deployed. This version number should be
21+
# incremented each time you make changes to the application. Versions are not expected to
22+
# follow Semantic Versioning. They should reflect the version the application is using.
23+
# It is recommended to use it with quotes.
24+
appVersion: v1.16.1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
apiVersion: v1
2+
kind: ServiceAccount
3+
metadata:
4+
name: csi-attacher
5+
namespace: {{ .Release.Namespace }}
6+
---
7+
kind: ClusterRole
8+
apiVersion: rbac.authorization.k8s.io/v1
9+
metadata:
10+
name: external-attacher-runner
11+
rules:
12+
- apiGroups:
13+
- ""
14+
resources:
15+
- persistentvolumes
16+
verbs:
17+
- get
18+
- list
19+
- watch
20+
- patch
21+
- apiGroups:
22+
- storage.k8s.io
23+
resources:
24+
- csinodes
25+
verbs:
26+
- get
27+
- list
28+
- watch
29+
- apiGroups:
30+
- storage.k8s.io
31+
resources:
32+
- volumeattachments
33+
verbs:
34+
- get
35+
- list
36+
- watch
37+
- patch
38+
- apiGroups:
39+
- storage.k8s.io
40+
resources:
41+
- volumeattachments/status
42+
verbs:
43+
- patch
44+
---
45+
kind: ClusterRoleBinding
46+
apiVersion: rbac.authorization.k8s.io/v1
47+
metadata:
48+
name: csi-attacher-role
49+
subjects:
50+
- kind: ServiceAccount
51+
name: csi-attacher
52+
namespace: {{ .Release.Namespace }}
53+
roleRef:
54+
kind: ClusterRole
55+
name: external-attacher-runner
56+
apiGroup: rbac.authorization.k8s.io
57+
---
58+
kind: Role
59+
apiVersion: rbac.authorization.k8s.io/v1
60+
metadata:
61+
namespace: {{ .Release.Namespace }}
62+
name: external-attacher-cfg
63+
rules:
64+
- apiGroups:
65+
- coordination.k8s.io
66+
resources:
67+
- leases
68+
verbs:
69+
- get
70+
- watch
71+
- list
72+
- delete
73+
- update
74+
- create
75+
---
76+
kind: RoleBinding
77+
apiVersion: rbac.authorization.k8s.io/v1
78+
metadata:
79+
name: csi-attacher-role-cfg
80+
namespace: {{ .Release.Namespace }}
81+
subjects:
82+
- kind: ServiceAccount
83+
name: csi-attacher
84+
namespace: {{ .Release.Namespace }}
85+
roleRef:
86+
kind: Role
87+
name: external-attacher-cfg
88+
apiGroup: rbac.authorization.k8s.io
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
apiVersion: v1
2+
kind: ServiceAccount
3+
metadata:
4+
name: csi-external-health-monitor-controller
5+
namespace: {{ .Release.Namespace }}
6+
---
7+
kind: ClusterRole
8+
apiVersion: rbac.authorization.k8s.io/v1
9+
metadata:
10+
name: external-health-monitor-controller-runner
11+
rules:
12+
- apiGroups:
13+
- ""
14+
resources:
15+
- persistentvolumes
16+
verbs:
17+
- get
18+
- list
19+
- watch
20+
- apiGroups:
21+
- ""
22+
resources:
23+
- persistentvolumeclaims
24+
verbs:
25+
- get
26+
- list
27+
- watch
28+
- apiGroups:
29+
- ""
30+
resources:
31+
- nodes
32+
verbs:
33+
- get
34+
- list
35+
- watch
36+
- apiGroups:
37+
- ""
38+
resources:
39+
- pods
40+
verbs:
41+
- get
42+
- list
43+
- watch
44+
- apiGroups:
45+
- ""
46+
resources:
47+
- events
48+
verbs:
49+
- get
50+
- list
51+
- watch
52+
- create
53+
- patch
54+
---
55+
kind: ClusterRoleBinding
56+
apiVersion: rbac.authorization.k8s.io/v1
57+
metadata:
58+
name: csi-external-health-monitor-controller-role
59+
subjects:
60+
- kind: ServiceAccount
61+
name: csi-external-health-monitor-controller
62+
namespace: {{ .Release.Namespace }}
63+
roleRef:
64+
kind: ClusterRole
65+
name: external-health-monitor-controller-runner
66+
apiGroup: rbac.authorization.k8s.io
67+
---
68+
kind: Role
69+
apiVersion: rbac.authorization.k8s.io/v1
70+
metadata:
71+
namespace: {{ .Release.Namespace }}
72+
name: external-health-monitor-controller-cfg
73+
rules:
74+
- apiGroups:
75+
- coordination.k8s.io
76+
resources:
77+
- leases
78+
verbs:
79+
- get
80+
- watch
81+
- list
82+
- delete
83+
- update
84+
- create
85+
---
86+
kind: RoleBinding
87+
apiVersion: rbac.authorization.k8s.io/v1
88+
metadata:
89+
name: csi-external-health-monitor-controller-role-cfg
90+
namespace: {{ .Release.Namespace }}
91+
subjects:
92+
- kind: ServiceAccount
93+
name: csi-external-health-monitor-controller
94+
namespace: {{ .Release.Namespace }}
95+
roleRef:
96+
kind: Role
97+
name: external-health-monitor-controller-cfg
98+
apiGroup: rbac.authorization.k8s.io

0 commit comments

Comments
 (0)