Skip to content

Commit c95c6d5

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/*` 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-external-snapshotter/index.yaml, by: helm repo add external-snapshotter https://alvistack.github.io/kubernetes-csi-external-snapshotter helm repo update helm search repo external-snapshotter Before each stable tag release, maintainers only required to: 1. Run the `./deploy/util/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 2c37c1c commit c95c6d5

27 files changed

+5111
-2
lines changed

.github/workflows/release.yml

Lines changed: 27 additions & 0 deletions
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 }}"

charts/csi-snapshotter/.helmignore

Lines changed: 23 additions & 0 deletions
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/

charts/csi-snapshotter/Chart.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
apiVersion: v2
2+
name: csi-snapshotter
3+
description: A Helm chart for deploy the CSI snapshotter together with the hostpath CSI 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: v8.4.0
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: v8.4.0
Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
apiVersion: apiextensions.k8s.io/v1
2+
kind: CustomResourceDefinition
3+
metadata:
4+
annotations:
5+
api-approved.kubernetes.io: https://github.com/kubernetes-csi/external-snapshotter/pull/1337
6+
controller-gen.kubebuilder.io/version: v0.15.0
7+
name: volumegroupsnapshotclasses.groupsnapshot.storage.k8s.io
8+
spec:
9+
group: groupsnapshot.storage.k8s.io
10+
names:
11+
kind: VolumeGroupSnapshotClass
12+
listKind: VolumeGroupSnapshotClassList
13+
plural: volumegroupsnapshotclasses
14+
shortNames:
15+
- vgsclass
16+
- vgsclasses
17+
singular: volumegroupsnapshotclass
18+
scope: Cluster
19+
versions:
20+
- additionalPrinterColumns:
21+
- jsonPath: .driver
22+
name: Driver
23+
type: string
24+
- description: Determines whether a VolumeGroupSnapshotContent created through the VolumeGroupSnapshotClass should be deleted when its bound VolumeGroupSnapshot is deleted.
25+
jsonPath: .deletionPolicy
26+
name: DeletionPolicy
27+
type: string
28+
- jsonPath: .metadata.creationTimestamp
29+
name: Age
30+
type: date
31+
deprecated: true
32+
name: v1beta1
33+
schema:
34+
openAPIV3Schema:
35+
description: |-
36+
VolumeGroupSnapshotClass specifies parameters that a underlying storage system
37+
uses when creating a volume group snapshot. A specific VolumeGroupSnapshotClass
38+
is used by specifying its name in a VolumeGroupSnapshot object.
39+
VolumeGroupSnapshotClasses are non-namespaced.
40+
properties:
41+
apiVersion:
42+
description: |-
43+
APIVersion defines the versioned schema of this representation of an object.
44+
Servers should convert recognized schemas to the latest internal value, and
45+
may reject unrecognized values.
46+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
47+
type: string
48+
deletionPolicy:
49+
description: |-
50+
DeletionPolicy determines whether a VolumeGroupSnapshotContent created
51+
through the VolumeGroupSnapshotClass should be deleted when its bound
52+
VolumeGroupSnapshot is deleted.
53+
Supported values are "Retain" and "Delete".
54+
"Retain" means that the VolumeGroupSnapshotContent and its physical group
55+
snapshot on underlying storage system are kept.
56+
"Delete" means that the VolumeGroupSnapshotContent and its physical group
57+
snapshot on underlying storage system are deleted.
58+
Required.
59+
enum:
60+
- Delete
61+
- Retain
62+
type: string
63+
driver:
64+
description: |-
65+
Driver is the name of the storage driver expected to handle this VolumeGroupSnapshotClass.
66+
Required.
67+
type: string
68+
kind:
69+
description: |-
70+
Kind is a string value representing the REST resource this object represents.
71+
Servers may infer this from the endpoint the client submits requests to.
72+
Cannot be updated.
73+
In CamelCase.
74+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
75+
type: string
76+
metadata:
77+
type: object
78+
parameters:
79+
additionalProperties:
80+
type: string
81+
description: |-
82+
Parameters is a key-value map with storage driver specific parameters for
83+
creating group snapshots.
84+
These values are opaque to Kubernetes and are passed directly to the driver.
85+
type: object
86+
required:
87+
- deletionPolicy
88+
- driver
89+
type: object
90+
served: true
91+
storage: false
92+
subresources: {}
93+
- additionalPrinterColumns:
94+
- jsonPath: .driver
95+
name: Driver
96+
type: string
97+
- description: Determines whether a VolumeGroupSnapshotContent created through the VolumeGroupSnapshotClass should be deleted when its bound VolumeGroupSnapshot is deleted.
98+
jsonPath: .deletionPolicy
99+
name: DeletionPolicy
100+
type: string
101+
- jsonPath: .metadata.creationTimestamp
102+
name: Age
103+
type: date
104+
name: v1beta2
105+
schema:
106+
openAPIV3Schema:
107+
description: |-
108+
VolumeGroupSnapshotClass specifies parameters that a underlying storage system
109+
uses when creating a volume group snapshot. A specific VolumeGroupSnapshotClass
110+
is used by specifying its name in a VolumeGroupSnapshot object.
111+
VolumeGroupSnapshotClasses are non-namespaced.
112+
properties:
113+
apiVersion:
114+
description: |-
115+
APIVersion defines the versioned schema of this representation of an object.
116+
Servers should convert recognized schemas to the latest internal value, and
117+
may reject unrecognized values.
118+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
119+
type: string
120+
deletionPolicy:
121+
description: |-
122+
DeletionPolicy determines whether a VolumeGroupSnapshotContent created
123+
through the VolumeGroupSnapshotClass should be deleted when its bound
124+
VolumeGroupSnapshot is deleted.
125+
Supported values are "Retain" and "Delete".
126+
"Retain" means that the VolumeGroupSnapshotContent and its physical group
127+
snapshot on underlying storage system are kept.
128+
"Delete" means that the VolumeGroupSnapshotContent and its physical group
129+
snapshot on underlying storage system are deleted.
130+
Required.
131+
enum:
132+
- Delete
133+
- Retain
134+
type: string
135+
x-kubernetes-validations:
136+
- message: deletionPolicy is immutable once set
137+
rule: self == oldSelf
138+
driver:
139+
description: |-
140+
Driver is the name of the storage driver expected to handle this VolumeGroupSnapshotClass.
141+
Required.
142+
type: string
143+
x-kubernetes-validations:
144+
- message: driver is immutable once set
145+
rule: self == oldSelf
146+
kind:
147+
description: |-
148+
Kind is a string value representing the REST resource this object represents.
149+
Servers may infer this from the endpoint the client submits requests to.
150+
Cannot be updated.
151+
In CamelCase.
152+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
153+
type: string
154+
metadata:
155+
type: object
156+
parameters:
157+
additionalProperties:
158+
type: string
159+
description: |-
160+
Parameters is a key-value map with storage driver specific parameters for
161+
creating group snapshots.
162+
These values are opaque to Kubernetes and are passed directly to the driver.
163+
type: object
164+
x-kubernetes-validations:
165+
- message: parameters are immutable once set
166+
rule: self == oldSelf
167+
required:
168+
- deletionPolicy
169+
- driver
170+
type: object
171+
served: true
172+
storage: true
173+
subresources: {}

0 commit comments

Comments
 (0)