Use helm for install

dev
Ruakij 4 months ago
parent a3414c37dd
commit 629fbef620

@ -4,6 +4,12 @@
This is a repository for webdav csi driver, csi plugin name: `webdav.csi.io`. This driver supports dynamic provisioning of Persistent Volumes via Persistent Volume Claims by creating a new sub directory under webdav server.
### Deploy CSI
#### With Helm
```bash
helm install -n webdav-csi-driver webdav-csi-driver helm/
```
### Quick start with kind
#### Build plugin image
@ -24,10 +30,7 @@ kind load docker-image registry.k8s.io/sig-storage/csi-node-driver-registrar:v2.
kind load docker-image localhost:5000/webdavplugin:v0.0.1
```
### Deploy CSI
```bash
kubectl apply -f deploy/
```
### Tests
```bash

@ -0,0 +1,4 @@
apiVersion: v2
name: webdav-csi-driver
description: A Helm chart for deploying CSI WebDAV Storage Driver
version: 0.0.1

@ -1,24 +1,23 @@
---
kind: Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: csi-webdav-controller
namespace: kube-system
name: webdav-csi-controller
namespace: {{ .Release.Namespace }}
spec:
replicas: 1
replicas: {{ .Values.controller.replicas }}
selector:
matchLabels:
app: csi-webdav-controller
app: webdav-csi-controller
template:
metadata:
labels:
app: csi-webdav-controller
app: webdav-csi-controller
spec:
hostNetwork: true # controller also needs to mount webdav to create dir
dnsPolicy: ClusterFirstWithHostNet # available values: Default, ClusterFirstWithHostNet, ClusterFirst
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
serviceAccountName: webdav-csi-sa
nodeSelector:
kubernetes.io/os: linux # add "kubernetes.io/role: master" to run controller on master node
kubernetes.io/os: linux
priorityClassName: system-cluster-critical
securityContext:
seccompProfile:
@ -35,8 +34,8 @@ spec:
effect: "NoSchedule"
containers:
- name: csi-provisioner
image: registry.k8s.io/sig-storage/csi-provisioner:v3.6.2
imagePullPolicy: IfNotPresent
image: {{ .Values.csiProvisioner.image.name }}:{{ .Values.csiProvisioner.image.tag }}
imagePullPolicy: {{ .Values.csiProvisioner.image.pullPolicy }}
args:
- "-v=2"
- "--csi-address=$(ADDRESS)"
@ -52,13 +51,13 @@ spec:
name: socket-dir
resources:
limits:
memory: 400Mi
memory: {{ .Values.controller.resources.limits.memory }}
requests:
cpu: 10m
memory: 20Mi
cpu: {{ .Values.controller.resources.requests.cpu }}
memory: {{ .Values.controller.resources.requests.memory }}
- name: liveness-probe
image: registry.k8s.io/sig-storage/livenessprobe:v2.11.0
imagePullPolicy: IfNotPresent
image: {{ .Values.livenessProbe.image.name }}:{{ .Values.livenessProbe.image.tag }}
imagePullPolicy: {{ .Values.livenessProbe.image.pullPolicy }}
args:
- --csi-address=/csi/csi.sock
- --probe-timeout=3s
@ -74,8 +73,8 @@ spec:
cpu: 10m
memory: 20Mi
- name: webdav
image: localhost:5000/webdavplugin:v0.0.1
imagePullPolicy: IfNotPresent
image: {{ .Values.controller.image.name }}:{{ .Values.controller.image.tag }}
imagePullPolicy: {{ .Values.controller.image.pullPolicy }}
securityContext:
privileged: true
capabilities:
@ -112,10 +111,10 @@ spec:
name: socket-dir
resources:
limits:
memory: 200Mi
memory: {{ .Values.controller.resources.limits.memory }}
requests:
cpu: 10m
memory: 20Mi
cpu: {{ .Values.controller.resources.requests.cpu }}
memory: {{ .Values.controller.resources.requests.memory }}
volumes:
- name: pods-mount-dir
hostPath:

@ -0,0 +1,13 @@
{{- if .Values.defaultStorageClass }}
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: {{ .Values.defaultStorageClass.name }}
provisioner: webdav.csi.io
parameters:
{{- toYaml .Values.defaultStorageClass.parameters | nindent 2 }}
reclaimPolicy: {{ .Values.defaultStorageClass.reclaimPolicy }}
volumeBindingMode: {{ .Values.defaultStorageClass.volumeBindingMode }}
mountOptions:
{{- toYaml .Values.defaultStorageClass.mountOptions | nindent 2 }}
{{- end }}

@ -1,4 +1,3 @@
---
apiVersion: storage.k8s.io/v1
kind: CSIDriver
metadata:

@ -1,9 +1,8 @@
---
kind: DaemonSet
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: csi-webdav-node
namespace: kube-system
name: webdav-csi-node
namespace: {{ .Release.Namespace }}
spec:
updateStrategy:
rollingUpdate:
@ -11,14 +10,14 @@ spec:
type: RollingUpdate
selector:
matchLabels:
app: csi-webdav-node
app: webdav-csi-node
template:
metadata:
labels:
app: csi-webdav-node
app: webdav-csi-node
spec:
hostNetwork: true # original webdav connection would be broken without hostNetwork setting
dnsPolicy: ClusterFirstWithHostNet # available values: Default, ClusterFirstWithHostNet, ClusterFirst
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
serviceAccountName: webdav-csi-sa
priorityClassName: system-node-critical
securityContext:
@ -30,8 +29,8 @@ spec:
- operator: "Exists"
containers:
- name: liveness-probe
image: registry.k8s.io/sig-storage/livenessprobe:v2.11.0
imagePullPolicy: IfNotPresent
image: {{ .Values.livenessProbe.image.name }}:{{ .Values.livenessProbe.image.tag }}
imagePullPolicy: {{ .Values.livenessProbe.image.pullPolicy }}
args:
- --csi-address=/csi/csi.sock
- --probe-timeout=3s
@ -63,7 +62,7 @@ spec:
timeoutSeconds: 15
env:
- name: DRIVER_REG_SOCK_PATH
value: /var/lib/kubelet/plugins/csi-webdavplugin/csi.sock
value: /var/lib/kubelet/plugins/webdav-csiplugin/csi.sock
- name: KUBE_NODE_NAME
valueFrom:
fieldRef:
@ -85,8 +84,8 @@ spec:
capabilities:
add: ["SYS_ADMIN"]
allowPrivilegeEscalation: true
image: localhost:5000/webdavplugin:v0.0.1
imagePullPolicy: IfNotPresent
image: {{ .Values.node.image.name }}:{{ .Values.node.image.tag }}
imagePullPolicy: {{ .Values.node.image.pullPolicy }}
args:
- "-v=5"
- "--nodeid=$(NODE_ID)"
@ -110,7 +109,6 @@ spec:
initialDelaySeconds: 30
timeoutSeconds: 10
periodSeconds: 30
imagePullPolicy: "IfNotPresent"
volumeMounts:
- name: socket-dir
mountPath: /csi
@ -119,14 +117,14 @@ spec:
mountPropagation: "Bidirectional"
resources:
limits:
memory: 300Mi
memory: {{ .Values.node.resources.limits.memory }}
requests:
cpu: 10m
memory: 20Mi
cpu: {{ .Values.node.resources.requests.cpu }}
memory: {{ .Values.node.resources.requests.memory }}
volumes:
- name: socket-dir
hostPath:
path: /var/lib/kubelet/plugins/csi-webdavplugin
path: /var/lib/kubelet/plugins/webdav-csiplugin
type: DirectoryOrCreate
- name: pods-mount-dir
hostPath:

@ -1,9 +1,8 @@
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: webdav-csi-sa
namespace: kube-system
namespace: {{ .Release.Namespace }}
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
@ -42,7 +41,7 @@ metadata:
subjects:
- kind: ServiceAccount
name: webdav-csi-sa
namespace: kube-system
namespace: {{ .Release.Namespace }}
roleRef:
kind: ClusterRole
name: webdav-csi-cr

@ -0,0 +1,50 @@
controller:
replicas: 1
image:
name: ghcr.io/ruakij/webdav-csi-driver
tag: dev
pullPolicy: Always
resources:
limits:
memory: 200Mi
requests:
cpu: 10m
memory: 20Mi
node:
image:
name: ghcr.io/ruakij/webdav-csi-driver
tag: dev
pullPolicy: Always
resources:
limits:
memory: 300Mi
requests:
cpu: 10m
memory: 20Mi
livenessProbe:
image:
name: registry.k8s.io/sig-storage/livenessprobe
tag: v2.11.0
pullPolicy: IfNotPresent
csiProvisioner:
image:
name: registry.k8s.io/sig-storage/csi-provisioner
tag: v3.6.2
pullPolicy: IfNotPresent
# Configuration for the default storage class
defaultStorageClass: {}
# name: "webdav"
# parameters:
# # alist folder webdav address
# share: http://ip:port/dav/media
# csi.storage.k8s.io/provisioner-secret-name: "webdav-secrect"
# csi.storage.k8s.io/provisioner-secret-namespace: "default"
# csi.storage.k8s.io/node-publish-secret-name: "webdav-secrect"
# csi.storage.k8s.io/node-publish-secret-namespace: "default"
# reclaimPolicy: "Delete"
# volumeBindingMode: Immediate
# mountOptions: {}
Loading…
Cancel
Save