Skip to content

Commit a8dfbe6

Browse files
author
Ravi Kumar
committed
v1.2.7 Heml chart addition
V1.2.7 added node bind mount to reduce api calls. V1.2.7 added helm chart to deploy V1.2.7 added heml package V1.2.7 added heml package V1.2.7 added repo tz file V1.2.7 added readme file
1 parent 7dae7b9 commit a8dfbe6

File tree

17 files changed

+654
-30
lines changed

17 files changed

+654
-30
lines changed

deploy/helm/README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Hammerspace CSI Helm Charts
2+
3+
This repository provides Helm charts to deploy the Hammerspace CSI driver components in a Kubernetes cluster. It supports deploying both **Controller** and **Node** plugins, along with configurable options such as timeouts and retry intervals.
4+
5+
---
6+
## 🚀 How to Deploy the Chart
7+
8+
1. **Add the Helm repository** (Published to GitHub Pages):
9+
```bash
10+
helm repo add hscsi https://github.com/hammer-space/csi-plugin/deploy/helm/repo
11+
helm repo update
12+
```
13+
14+
2. **Install the chart into your cluster:**
15+
```
16+
helm install hscsi hscsi/ --namespace kube-system --create-namespace
17+
```
18+
---
19+
20+
## 📦 How to Package a New Version
21+
22+
#### Navigate to the chart directory:
23+
```
24+
cd deploy/helm/hammerspace-helm-chart
25+
```
26+
#### Create new package
27+
```
28+
helm package .
29+
```
30+
31+
#### Move the .tgz to your repo directory (e.g., deploy/helm/repo/) and regenerate the index.yaml:
32+
```
33+
mv hammerspace-csi-<version>.tgz ../../repo/
34+
cd ../../repo
35+
helm repo index .
36+
```
37+
38+
#### If hosted on GitHub Pages:
39+
40+
Ensure index.yaml and .tgz files are committed to the branch (typically gh-pages)
41+
42+
Add or update artifacthub-repo.yml next to index.yaml for Artifact Hub metadata
43+
44+
#### How to Create a New Helm Chart
45+
If you need to add a new chart:
46+
```
47+
helm create new-chart
48+
```
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: v2
2+
name: hammerspace-csi
3+
description: A Helm chart for the Hammerspace CSI driver
4+
version: 1.2.7
5+
appVersion: "v1.2.7"
6+
icon: https://www.hammerspace.com/favicon.ico
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: csi-env-config
5+
namespace: {{ .Values.namespace | default "kube-system" }}
6+
data:
7+
MOUNT_CHECK_TIMEOUT: "{{ .Values.env.MOUNT_CHECK_TIMEOUT }}"
8+
UNMOUNT_RETRY_COUNT: "{{ .Values.env.UNMOUNT_RETRY_COUNT }}"
9+
UNMOUNT_RETRY_INTERVAL: "{{ .Values.env.UNMOUNT_RETRY_INTERVAL }}"
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# This file is part of the Hammerspace CSI Driver project.
2+
# It defines the RBAC roles and bindings for the CSI provisioner component.
3+
# The provisioner is responsible for creating and managing PersistentVolumes
4+
# based on PersistentVolumeClaims in Kubernetes.
5+
apiVersion: v1
6+
kind: ServiceAccount
7+
metadata:
8+
name: csi-provisioner
9+
namespace: {{ .Values.namespace }}
10+
---
11+
# This ClusterRole defines the permissions required by the CSI provisioner.
12+
# It allows the provisioner to manage PersistentVolumes, PersistentVolumeClaims,
13+
# and other related resources in the Kubernetes cluster.
14+
# It also allows the provisioner to interact with storage classes and volume snapshots.
15+
# The ClusterRole is bound to the csi-provisioner ServiceAccount.
16+
# This ClusterRoleBinding binds the csi-provisioner ServiceAccount to the csi-provisioner ClusterRole.
17+
# This allows the provisioner to perform the actions defined in the ClusterRole.
18+
# The ClusterRoleBinding is created in the same namespace as the provisioner ServiceAccount.
19+
# The ClusterRoleBinding is necessary for the provisioner to have the required permissions
20+
# to manage storage resources in the cluster.
21+
# The ClusterRoleBinding is created in the same namespace as the provisioner ServiceAccount.
22+
# This ClusterRoleBinding is specifically for the provisioner to manage volume attachments.
23+
# It allows the provisioner to update the status of volume attachments.
24+
# This is necessary for the provisioner to properly manage the lifecycle of volumes
25+
# and ensure that they are correctly attached to nodes.
26+
# The ClusterRoleBinding is created in the same namespace as the provisioner ServiceAccount.
27+
# This ClusterRoleBinding is specifically for the provisioner to manage volume attachment status.
28+
# It allows the provisioner to update the status of volume attachments.
29+
# This is necessary for the provisioner to properly manage the lifecycle of volumes
30+
# and ensure that they are correctly attached to nodes.
31+
# The ClusterRoleBinding is created in the same namespace as the provisioner ServiceAccount.
32+
# The ClusterRoleBinding is necessary for the provisioner to have the required permissions
33+
# to manage storage resources in the cluster.
34+
35+
apiVersion: rbac.authorization.k8s.io/v1
36+
kind: ClusterRole
37+
metadata:
38+
name: csi-provisioner
39+
rules:
40+
- apiGroups: [""]
41+
resources: ["pods", "persistentvolumes", "persistentvolumeclaims", "nodes", "events", "endpoints", "secrets"]
42+
verbs: ["list", "watch", "get", "create", "delete", "update", "patch"]
43+
- apiGroups: ["storage.k8s.io", "snapshot.storage.k8s.io", "apiextensions.k8s.io"]
44+
resources: ["storageclasses", "volumeattachments", "volumeattachments/status", "volumesnapshotcontents/status", "volumesnapshots", "volumesnapshotcontents", "volumesnapshotclasses", "customresourcedefinitions"]
45+
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
46+
---
47+
# This ClusterRoleBinding binds the csi-provisioner ServiceAccount to the csi-provisioner ClusterRole.
48+
# It allows the provisioner to perform the actions defined in the ClusterRole.
49+
# The ClusterRoleBinding is created in the same namespace as the provisioner ServiceAccount.
50+
# This ClusterRoleBinding is necessary for the provisioner to have the required permissions
51+
# to manage storage resources in the cluster.
52+
# The ClusterRoleBinding is created in the same namespace as the provisioner ServiceAccount.
53+
# This ClusterRoleBinding is specifically for the provisioner to manage volume attachments.
54+
# It allows the provisioner to update the status of volume attachments.
55+
# This is necessary for the provisioner to properly manage the lifecycle of volumes
56+
# and ensure that they are correctly attached to nodes.
57+
# The ClusterRoleBinding is created in the same namespace as the provisioner ServiceAccount.
58+
# This ClusterRoleBinding is specifically for the provisioner to manage volume attachment status.
59+
# It allows the provisioner to update the status of volume attachments.
60+
# This is necessary for the provisioner to properly manage the lifecycle of volumes
61+
# and ensure that they are correctly attached to nodes.
62+
# The ClusterRoleBinding is created in the same namespace as the provisioner ServiceAccount.
63+
apiVersion: rbac.authorization.k8s.io/v1
64+
kind: ClusterRoleBinding
65+
metadata:
66+
name: csi-provisioner-binding
67+
subjects:
68+
- kind: ServiceAccount
69+
name: csi-provisioner
70+
namespace: {{ .Values.namespace }}
71+
roleRef:
72+
kind: ClusterRole
73+
name: csi-provisioner
74+
apiGroup: rbac.authorization.k8s.io
75+
---
76+
# This ClusterRoleBinding is specifically for the provisioner to manage volume attachment status.
77+
# It allows the provisioner to update the status of volume attachments.
78+
# This is necessary for the provisioner to properly manage the lifecycle of volumes
79+
# and ensure that they are correctly attached to nodes.
80+
# The ClusterRoleBinding is created in the same namespace as the provisioner ServiceAccount.
81+
# This ClusterRoleBinding is necessary for the provisioner to have the required permissions
82+
# to manage storage resources in the cluster.
83+
apiVersion: rbac.authorization.k8s.io/v1
84+
kind: ClusterRoleBinding
85+
metadata:
86+
name: csi-provisioner
87+
subjects:
88+
- kind: ServiceAccount
89+
name: csi-provisioner
90+
namespace: {{ .Values.namespace }}
91+
roleRef:
92+
kind: ClusterRole
93+
name: csi-provisioner
94+
apiGroup: rbac.authorization.k8s.io
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# This file is part of the Hammerspace CSI Driver Helm Chart.
2+
# It defines the service for the CSI provisioner component.
3+
# The service is a headless service that allows the StatefulSet to manage the pods.
4+
kind: Service
5+
apiVersion: v1
6+
metadata:
7+
name: csi-provisioner
8+
namespace: {{ .Values.namespace }}
9+
labels:
10+
app: csi-provisioner
11+
spec:
12+
type: ClusterIP
13+
clusterIP: None
14+
# This is needed for the StatefulSet to work properly
15+
# as it uses a headless service to manage the pods.
16+
# The StatefulSet will create a DNS entry for the pods
17+
# in the format <pod-name>.<service-name>.<namespace>.svc.cluster.local
18+
# where <pod-name> is the name of the pod, <service-name> is the name of the service,
19+
# and <namespace> is the namespace of the service.
20+
# This allows the pods to communicate with each other using DNS.
21+
# The StatefulSet will also create a DNS entry for the service in the format <service-name>.<namespace>.svc.cluster.local
22+
# which allows the pods to communicate with the service
23+
selector:
24+
app: csi-provisioner
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
apiVersion: apps/v1
2+
kind: StatefulSet
3+
metadata:
4+
name: csi-provisioner
5+
namespace: {{ .Values.namespace }}
6+
spec:
7+
serviceName: "csi-provisioner"
8+
replicas: {{ .Values.controller.replicas }}
9+
selector:
10+
matchLabels:
11+
app: csi-provisioner
12+
template:
13+
metadata:
14+
labels:
15+
app: csi-provisioner
16+
spec:
17+
serviceAccountName: csi-provisioner
18+
hostNetwork: true
19+
containers:
20+
- name: csi-provisioner
21+
imagePullPolicy: Always
22+
image: {{ .Values.image.provisioner }}
23+
args:
24+
- "--csi-address=$(CSI_ENDPOINT)"
25+
- "--timeout=60s" # Recommended as shares may take some time to create
26+
- "--v=5"
27+
env:
28+
- name: CSI_ENDPOINT
29+
value: /var/lib/csi/hs-csi.sock
30+
volumeMounts:
31+
- name: socket-dir
32+
mountPath: /var/lib/csi/
33+
- name: csi-attacher
34+
imagePullPolicy: Always
35+
image: {{ .Values.image.attacher }}
36+
args:
37+
- "--csi-address=$(CSI_ENDPOINT)"
38+
- "--v=5"
39+
env:
40+
- name: CSI_ENDPOINT
41+
value: /var/lib/csi/hs-csi.sock
42+
volumeMounts:
43+
- name: socket-dir
44+
mountPath: /var/lib/csi/
45+
- name: csi-snapshotter
46+
imagePullPolicy: Always
47+
image: {{ .Values.image.snapshotter }}
48+
args:
49+
- "--csi-address=$(CSI_ENDPOINT)"
50+
- "--v=5"
51+
env:
52+
- name: CSI_ENDPOINT
53+
value: /var/lib/csi/hs-csi.sock
54+
volumeMounts:
55+
- name: socket-dir
56+
mountPath: /var/lib/csi/
57+
- name: csi-resizer
58+
imagePullPolicy: Always
59+
image: {{ .Values.image.resizer }}
60+
args:
61+
- "--csi-address=$(CSI_ENDPOINT)"
62+
- "--v=5"
63+
env:
64+
- name: CSI_ENDPOINT
65+
value: /var/lib/csi/hs-csi.sock
66+
volumeMounts:
67+
- name: socket-dir
68+
mountPath: /var/lib/csi/
69+
- name: hs-csi-plugin-controller
70+
securityContext:
71+
privileged: true
72+
capabilities:
73+
add: ["SYS_ADMIN"]
74+
allowPrivilegeEscalation: true
75+
imagePullPolicy: Always
76+
image: {{ .Values.image.csiPlugin }}
77+
envFrom:
78+
- configMapRef:
79+
name: csi-env-config
80+
env:
81+
- name: CSI_ENDPOINT
82+
value: /var/lib/csi/hs-csi.sock
83+
- name: HS_USERNAME
84+
valueFrom:
85+
secretKeyRef:
86+
name: com.hammerspace.csi.credentials
87+
key: username
88+
- name: HS_PASSWORD
89+
valueFrom:
90+
secretKeyRef:
91+
name: com.hammerspace.csi.credentials
92+
key: password
93+
- name: HS_ENDPOINT
94+
valueFrom:
95+
secretKeyRef:
96+
name: com.hammerspace.csi.credentials
97+
key: endpoint
98+
- name: HS_TLS_VERIFY
99+
value: "false"
100+
- name: CSI_MAJOR_VERSION
101+
value: "1"
102+
volumeMounts:
103+
- name: socket-dir
104+
mountPath: /var/lib/csi/
105+
- name: staging-dir
106+
mountPath: /tmp
107+
mountPropagation: Bidirectional
108+
volumes:
109+
- name: socket-dir
110+
emptyDir: {}
111+
- name: staging-dir
112+
hostPath:
113+
path: /tmp
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: storage.k8s.io/v1
2+
kind: CSIDriver
3+
metadata:
4+
name: com.hammerspace.csi
5+
spec:
6+
podInfoOnMount: true
7+
requiresRepublish: true
8+
volumeLifecycleModes:
9+
- Persistent
10+
storageCapacity: true

0 commit comments

Comments
 (0)