Skip to content

Commit f397938

Browse files
committed
make charts
Signed-off-by: Vicente Cheng <[email protected]>
1 parent 71fba78 commit f397938

File tree

13 files changed

+568
-0
lines changed

13 files changed

+568
-0
lines changed
Binary file not shown.
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/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
annotations:
2+
catalog.cattle.io/certified: rancher
3+
catalog.cattle.io/display-name: Harvester CSI Driver
4+
catalog.cattle.io/kube-version: '>= 1.23.0-0 < 1.29.0-0'
5+
catalog.cattle.io/namespace: kube-system
6+
catalog.cattle.io/os: linux
7+
catalog.cattle.io/permits-os: linux
8+
catalog.cattle.io/rancher-version: '>= 2.8.0-0 < 2.9.0-0'
9+
catalog.cattle.io/release-name: harvester-csi-driver
10+
catalog.cattle.io/ui-component: harvester-csi-driver
11+
catalog.cattle.io/upstream-version: 0.1.23
12+
apiVersion: v2
13+
appVersion: v0.2.2
14+
description: A Helm chart for Harvester CSI driver
15+
keywords:
16+
- infrastructure
17+
- harvester
18+
maintainers:
19+
- name: harvester
20+
name: harvester-csi-driver
21+
type: application
22+
version: 103.0.6+up0.1.23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
categories:
2+
- infrastructure
3+
- harvester
4+
namespace: kube-system
5+
questions:
6+
- variable: cloudConfig.hostPath
7+
label: Cloud config file path
8+
description: "Specify the path of the cloud config."
9+
group: "Default"
10+
type: string
11+
default: "/etc/kubernetes/cloud-config"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Successfully deployed Harvester CSI driver to the {{ .Release.Namespace }} namespace.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{{/* vim: set filetype=mustache: */}}
2+
{{/*
3+
Expand the name of the chart.
4+
*/}}
5+
{{- define "harvester-csi-driver.name" -}}
6+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
7+
{{- end }}
8+
9+
{{/*
10+
Create a default fully qualified app name.
11+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
12+
If release name contains chart name it will be used as a full name.
13+
*/}}
14+
{{- define "harvester-csi-driver.fullname" -}}
15+
{{- if .Values.fullnameOverride }}
16+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
17+
{{- else }}
18+
{{- $name := default .Chart.Name .Values.nameOverride }}
19+
{{- if contains $name .Release.Name }}
20+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
21+
{{- else }}
22+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
23+
{{- end }}
24+
{{- end }}
25+
{{- end }}
26+
27+
{{/*
28+
Create chart name and version as used by the chart label.
29+
*/}}
30+
{{- define "harvester-csi-driver.chart" -}}
31+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
32+
{{- end }}
33+
34+
{{/*
35+
Common labels
36+
*/}}
37+
{{- define "harvester-csi-driver.labels" -}}
38+
helm.sh/chart: {{ include "harvester-csi-driver.chart" . }}
39+
{{ include "harvester-csi-driver.selectorLabels" . }}
40+
{{- if .Chart.AppVersion }}
41+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
42+
{{- end }}
43+
{{- end }}
44+
45+
{{/*
46+
Selector labels
47+
*/}}
48+
{{- define "harvester-csi-driver.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "harvester-csi-driver.name" . }}
50+
app.kubernetes.io/instance: {{ .Release.Name }}
51+
{{- end }}
52+
53+
{{/*
54+
Global system default registry
55+
*/}}
56+
{{- define "system_default_registry" -}}
57+
{{- if .Values.global.cattle.systemDefaultRegistry -}}
58+
{{- printf "%s/" .Values.global.cattle.systemDefaultRegistry -}}
59+
{{- else -}}
60+
{{- "" -}}
61+
{{- end -}}
62+
{{- end -}}
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: driver.harvesterhci.io
5+
spec:
6+
attachRequired: true
7+
fsGroupPolicy: ReadWriteOnceWithFSType
8+
podInfoOnMount: true
9+
volumeLifecycleModes:
10+
- Persistent
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
apiVersion: apps/v1
2+
kind: DaemonSet
3+
metadata:
4+
name: {{ include "harvester-csi-driver.name" . }}
5+
namespace: {{ .Release.Namespace }}
6+
labels:
7+
{{- include "harvester-csi-driver.labels" . | nindent 4 }}
8+
spec:
9+
selector:
10+
matchLabels:
11+
component: csi-driver
12+
{{- include "harvester-csi-driver.selectorLabels" . | nindent 6 }}
13+
template:
14+
metadata:
15+
labels:
16+
component: csi-driver
17+
{{- include "harvester-csi-driver.selectorLabels" . | nindent 8 }}
18+
spec:
19+
containers:
20+
- args:
21+
- --v=5
22+
- --csi-address=$(ADDRESS)
23+
- --kubelet-registration-path={{ .Values.kubeletRootDir }}/harvester-plugins/driver.harvesterhci.io/csi.sock
24+
env:
25+
- name: ADDRESS
26+
value: /csi/csi.sock
27+
image: {{ template "system_default_registry" . }}{{ .Values.image.csi.nodeDriverRegistrar.repository }}:{{ .Values.image.csi.nodeDriverRegistrar.tag }}
28+
imagePullPolicy: {{ .Values.image.pullPolicy }}
29+
lifecycle:
30+
preStop:
31+
exec:
32+
command:
33+
- /bin/sh
34+
- -c
35+
- rm -rf /registration/driver.harvesterhci.io-reg.sock
36+
/csi//*
37+
name: node-driver-registrar
38+
securityContext:
39+
privileged: true
40+
volumeMounts:
41+
- mountPath: /csi/
42+
name: socket-dir
43+
- mountPath: /registration
44+
name: registration-dir
45+
- args:
46+
- --nodeid=$(NODE_ID)
47+
- --endpoint=$(CSI_ENDPOINT)
48+
- --kubeconfig=/var/lib/harvester/cloud-provider-config
49+
{{- if .Values.hostStorageClass }}
50+
- --host-storage-class={{ .Values.hostStorageClass }}
51+
{{- end }}
52+
env:
53+
- name: NODE_ID
54+
valueFrom:
55+
fieldRef:
56+
apiVersion: v1
57+
fieldPath: spec.nodeName
58+
- name: CSI_ENDPOINT
59+
value: unix:///csi/csi.sock
60+
image: {{ template "system_default_registry" . }}{{ .Values.image.harvester.csiDriver.repository }}:{{ .Values.image.harvester.csiDriver.tag | default .Chart.AppVersion }}
61+
imagePullPolicy: {{ .Values.image.pullPolicy }}
62+
lifecycle:
63+
preStop:
64+
exec:
65+
command:
66+
- /bin/sh
67+
- -c
68+
- rm -f /csi//*
69+
name: harvester-csi-driver
70+
securityContext:
71+
allowPrivilegeEscalation: true
72+
capabilities:
73+
add:
74+
- SYS_ADMIN
75+
privileged: true
76+
volumeMounts:
77+
- name: cloud-config
78+
readOnly: true
79+
mountPath: /var/lib/harvester
80+
- name: kubernetes
81+
readOnly: true
82+
mountPath: /etc/kubernetes
83+
- mountPath: {{ .Values.kubeletRootDir }}/plugins/kubernetes.io/csi
84+
mountPropagation: Bidirectional
85+
name: kubernetes-csi-dir
86+
- mountPath: /csi/
87+
name: socket-dir
88+
- mountPath: {{ .Values.kubeletRootDir }}/pods
89+
mountPropagation: Bidirectional
90+
name: pods-mount-dir
91+
- mountPath: /dev
92+
name: host-dev
93+
- mountPath: /sys
94+
name: host-sys
95+
- mountPath: /rootfs
96+
mountPropagation: Bidirectional
97+
name: host
98+
- mountPath: /lib/modules
99+
name: lib-modules
100+
readOnly: true
101+
hostPID: true
102+
serviceAccountName: {{ include "harvester-csi-driver.name" . }}
103+
{{- with .Values.nodeSelector }}
104+
nodeSelector:
105+
{{- toYaml . | nindent 8 }}
106+
{{- end }}
107+
{{- with .Values.tolerations }}
108+
tolerations:
109+
{{- toYaml . | nindent 8 }}
110+
{{- end }}
111+
volumes:
112+
- name: cloud-config
113+
{{- if .Values.cloudConfig.secretName }}
114+
secret:
115+
secretName: {{ .Values.cloudConfig.secretName }}
116+
{{- else }}
117+
hostPath:
118+
path: {{ .Values.cloudConfig.hostPath }}
119+
type: DirectoryOrCreate
120+
{{- end }}
121+
- hostPath:
122+
path: /etc/kubernetes
123+
type: DirectoryOrCreate
124+
name: kubernetes
125+
- hostPath:
126+
path: {{ .Values.kubeletRootDir }}/plugins/kubernetes.io/csi
127+
type: DirectoryOrCreate
128+
name: kubernetes-csi-dir
129+
- hostPath:
130+
path: {{ .Values.kubeletRootDir }}/plugins_registry
131+
type: Directory
132+
name: registration-dir
133+
- hostPath:
134+
path: {{ .Values.kubeletRootDir }}/harvester-plugins/driver.harvesterhci.io
135+
type: DirectoryOrCreate
136+
name: socket-dir
137+
- hostPath:
138+
path: {{ .Values.kubeletRootDir }}/pods
139+
type: DirectoryOrCreate
140+
name: pods-mount-dir
141+
- hostPath:
142+
path: /dev
143+
name: host-dev
144+
- hostPath:
145+
path: /sys
146+
name: host-sys
147+
- hostPath:
148+
path: /
149+
name: host
150+
- hostPath:
151+
path: /lib/modules
152+
name: lib-modules

0 commit comments

Comments
 (0)