doc: cut v3.0.0 release
This commit is contained in:
parent
6b243d093e
commit
9d6279ab96
@ -9,6 +9,7 @@ This is a repository for [NFS](https://en.wikipedia.org/wiki/Network_File_System
|
|||||||
|driver version | supported k8s version |
|
|driver version | supported k8s version |
|
||||||
|----------------|-----------------------|
|
|----------------|-----------------------|
|
||||||
|master branch | 1.19+ |
|
|master branch | 1.19+ |
|
||||||
|
|v3.0.0 | 1.19+ |
|
||||||
|v2.0.0 | 1.14+ |
|
|v2.0.0 | 1.14+ |
|
||||||
|
|
||||||
### Requirements
|
### Requirements
|
||||||
@ -16,7 +17,7 @@ This is a repository for [NFS](https://en.wikipedia.org/wiki/Network_File_System
|
|||||||
This driver requires existing NFSv3 or NFSv4 server.
|
This driver requires existing NFSv3 or NFSv4 server.
|
||||||
|
|
||||||
### Install driver on a Kubernetes cluster
|
### Install driver on a Kubernetes cluster
|
||||||
- install by [kubectl](./docs/install-csi-driver.md)
|
- install by [kubectl](./docs/install-nfs-csi-driver.md)
|
||||||
- install by [helm charts](./charts)
|
- install by [helm charts](./charts)
|
||||||
|
|
||||||
### Driver parameters
|
### Driver parameters
|
||||||
|
|||||||
@ -3,20 +3,29 @@ entries:
|
|||||||
csi-driver-nfs:
|
csi-driver-nfs:
|
||||||
- apiVersion: v1
|
- apiVersion: v1
|
||||||
appVersion: latest
|
appVersion: latest
|
||||||
created: 2021-02-05T13:28:16.728034918Z
|
created: "2021-11-29T05:33:58.291335863Z"
|
||||||
description: CSI NFS Driver for Kubernetes
|
description: CSI NFS Driver for Kubernetes
|
||||||
digest: aa12e668649d4f9fc979389618992c1195847feff048dab0f2413ef02fbcc837
|
digest: d915fea55b4c764a1534754048210835ff42834c4c787768293b02272b5331f7
|
||||||
name: csi-driver-nfs
|
name: csi-driver-nfs
|
||||||
urls:
|
urls:
|
||||||
- https://raw.githubusercontent.com/kubernetes-csi/csi-driver-nfs/master/charts/latest/csi-driver-nfs-v3.0.0.tgz
|
- https://raw.githubusercontent.com/kubernetes-csi/csi-driver-nfs/master/charts/latest/csi-driver-nfs-v3.0.0.tgz
|
||||||
version: v3.0.0
|
version: v3.0.0
|
||||||
|
- apiVersion: v1
|
||||||
|
appVersion: latest
|
||||||
|
created: "2021-11-29T05:33:58.293553676Z"
|
||||||
|
description: CSI NFS Driver for Kubernetes
|
||||||
|
digest: 360f0c7737201103c6248f1df93f44271bec501322c6a2b848e267b121abf9ae
|
||||||
|
name: csi-driver-nfs
|
||||||
|
urls:
|
||||||
|
- https://raw.githubusercontent.com/kubernetes-csi/csi-driver-nfs/master/charts/v3.0.0/csi-driver-nfs-v3.0.0.tgz
|
||||||
|
version: v3.0.0
|
||||||
- apiVersion: v1
|
- apiVersion: v1
|
||||||
appVersion: v2.0.0
|
appVersion: v2.0.0
|
||||||
created: 2021-02-05T13:28:16.728270519Z
|
created: "2021-11-29T05:33:58.292906172Z"
|
||||||
description: CSI NFS Driver for Kubernetes
|
description: CSI NFS Driver for Kubernetes
|
||||||
digest: f537a133eaa965f1c053ffac130f82c9b2b624e1f8bd42937c9c48818464eaac
|
digest: f537a133eaa965f1c053ffac130f82c9b2b624e1f8bd42937c9c48818464eaac
|
||||||
name: csi-driver-nfs
|
name: csi-driver-nfs
|
||||||
urls:
|
urls:
|
||||||
- https://raw.githubusercontent.com/kubernetes-csi/csi-driver-nfs/master/charts/v2.0.0/csi-driver-nfs-v2.0.0.tgz
|
- https://raw.githubusercontent.com/kubernetes-csi/csi-driver-nfs/master/charts/v2.0.0/csi-driver-nfs-v2.0.0.tgz
|
||||||
version: v2.0.0
|
version: v2.0.0
|
||||||
generated: 2021-02-05T13:28:16.727677516Z
|
generated: "2021-11-29T05:33:58.290504458Z"
|
||||||
|
|||||||
Binary file not shown.
@ -1,7 +1,7 @@
|
|||||||
image:
|
image:
|
||||||
nfs:
|
nfs:
|
||||||
repository: mcr.microsoft.com/k8s/csi/nfs-csi
|
repository: mcr.microsoft.com/k8s/csi/nfs-csi
|
||||||
tag: latest
|
tag: v3.0.0
|
||||||
pullPolicy: IfNotPresent
|
pullPolicy: IfNotPresent
|
||||||
csiProvisioner:
|
csiProvisioner:
|
||||||
repository: k8s.gcr.io/sig-storage/csi-provisioner
|
repository: k8s.gcr.io/sig-storage/csi-provisioner
|
||||||
|
|||||||
BIN
charts/v3.0.0/csi-driver-nfs-v3.0.0.tgz
Normal file
BIN
charts/v3.0.0/csi-driver-nfs-v3.0.0.tgz
Normal file
Binary file not shown.
22
charts/v3.0.0/csi-driver-nfs/.helmignore
Executable file
22
charts/v3.0.0/csi-driver-nfs/.helmignore
Executable file
@ -0,0 +1,22 @@
|
|||||||
|
# Patterns to ignore when building packages.
|
||||||
|
# This supports shell glob matching, relative path matching, and
|
||||||
|
# negation (prefixed with !). Only one pattern per line.
|
||||||
|
.DS_Store
|
||||||
|
# Common VCS dirs
|
||||||
|
.git/
|
||||||
|
.gitignore
|
||||||
|
.bzr/
|
||||||
|
.bzrignore
|
||||||
|
.hg/
|
||||||
|
.hgignore
|
||||||
|
.svn/
|
||||||
|
# Common backup files
|
||||||
|
*.swp
|
||||||
|
*.bak
|
||||||
|
*.tmp
|
||||||
|
*~
|
||||||
|
# Various IDEs
|
||||||
|
.project
|
||||||
|
.idea/
|
||||||
|
*.tmproj
|
||||||
|
.vscode/
|
||||||
5
charts/v3.0.0/csi-driver-nfs/Chart.yaml
Executable file
5
charts/v3.0.0/csi-driver-nfs/Chart.yaml
Executable file
@ -0,0 +1,5 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
appVersion: latest
|
||||||
|
description: CSI NFS Driver for Kubernetes
|
||||||
|
name: csi-driver-nfs
|
||||||
|
version: v3.0.0
|
||||||
5
charts/v3.0.0/csi-driver-nfs/templates/NOTES.txt
Normal file
5
charts/v3.0.0/csi-driver-nfs/templates/NOTES.txt
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
The CSI NFS Driver is getting deployed to your cluster.
|
||||||
|
|
||||||
|
To check CSI NFS Driver pods status, please run:
|
||||||
|
|
||||||
|
kubectl --namespace={{ .Release.Namespace }} get pods --selector="release={{ .Release.Name }}" --watch
|
||||||
16
charts/v3.0.0/csi-driver-nfs/templates/_helpers.tpl
Normal file
16
charts/v3.0.0/csi-driver-nfs/templates/_helpers.tpl
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
|
||||||
|
{{/* Expand the name of the chart.*/}}
|
||||||
|
{{- define "nfs.name" -}}
|
||||||
|
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/* labels for helm resources */}}
|
||||||
|
{{- define "nfs.labels" -}}
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/instance: "{{ .Release.Name }}"
|
||||||
|
app.kubernetes.io/managed-by: "{{ .Release.Service }}"
|
||||||
|
app.kubernetes.io/name: "{{ template "nfs.name" . }}"
|
||||||
|
app.kubernetes.io/version: "{{ .Chart.AppVersion }}"
|
||||||
|
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
|
||||||
|
{{- end -}}
|
||||||
107
charts/v3.0.0/csi-driver-nfs/templates/csi-nfs-controller.yaml
Normal file
107
charts/v3.0.0/csi-driver-nfs/templates/csi-nfs-controller.yaml
Normal file
@ -0,0 +1,107 @@
|
|||||||
|
---
|
||||||
|
kind: Deployment
|
||||||
|
apiVersion: apps/v1
|
||||||
|
metadata:
|
||||||
|
name: {{ .Values.controller.name }}
|
||||||
|
namespace: {{ .Release.Namespace }}
|
||||||
|
{{ include "nfs.labels" . | indent 2 }}
|
||||||
|
spec:
|
||||||
|
replicas: {{ .Values.controller.replicas }}
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: {{ .Values.controller.name }}
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
{{ include "nfs.labels" . | indent 6 }}
|
||||||
|
app: {{ .Values.controller.name }}
|
||||||
|
spec:
|
||||||
|
{{- if .Values.imagePullSecrets }}
|
||||||
|
imagePullSecrets:
|
||||||
|
{{ toYaml .Values.imagePullSecrets | indent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
hostNetwork: true # controller also needs to mount nfs to create dir
|
||||||
|
dnsPolicy: ClusterFirstWithHostNet
|
||||||
|
serviceAccountName: {{ .Values.serviceAccount.controller }}
|
||||||
|
nodeSelector:
|
||||||
|
kubernetes.io/os: linux
|
||||||
|
{{- if .Values.controller.runOnMaster}}
|
||||||
|
kubernetes.io/role: master
|
||||||
|
{{- end}}
|
||||||
|
priorityClassName: system-cluster-critical
|
||||||
|
{{- with .Values.controller.tolerations }}
|
||||||
|
tolerations:
|
||||||
|
{{ toYaml . | indent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
containers:
|
||||||
|
- name: csi-provisioner
|
||||||
|
image: "{{ .Values.image.csiProvisioner.repository }}:{{ .Values.image.csiProvisioner.tag }}"
|
||||||
|
args:
|
||||||
|
- "-v=2"
|
||||||
|
- "--csi-address=$(ADDRESS)"
|
||||||
|
- "--leader-election"
|
||||||
|
env:
|
||||||
|
- name: ADDRESS
|
||||||
|
value: /csi/csi.sock
|
||||||
|
imagePullPolicy: {{ .Values.image.csiProvisioner.pullPolicy }}
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: /csi
|
||||||
|
name: socket-dir
|
||||||
|
resources: {{- toYaml .Values.controller.resources.csiProvisioner | nindent 12 }}
|
||||||
|
- name: liveness-probe
|
||||||
|
image: "{{ .Values.image.livenessProbe.repository }}:{{ .Values.image.livenessProbe.tag }}"
|
||||||
|
args:
|
||||||
|
- --csi-address=/csi/csi.sock
|
||||||
|
- --probe-timeout=3s
|
||||||
|
- --health-port={{ .Values.controller.livenessProbe.healthPort }}
|
||||||
|
- --v=2
|
||||||
|
imagePullPolicy: {{ .Values.image.livenessProbe.pullPolicy }}
|
||||||
|
volumeMounts:
|
||||||
|
- name: socket-dir
|
||||||
|
mountPath: /csi
|
||||||
|
resources: {{- toYaml .Values.controller.resources.livenessProbe | nindent 12 }}
|
||||||
|
- name: nfs
|
||||||
|
image: "{{ .Values.image.nfs.repository }}:{{ .Values.image.nfs.tag }}"
|
||||||
|
securityContext:
|
||||||
|
privileged: true
|
||||||
|
capabilities:
|
||||||
|
add: ["SYS_ADMIN"]
|
||||||
|
allowPrivilegeEscalation: true
|
||||||
|
imagePullPolicy: {{ .Values.image.nfs.pullPolicy }}
|
||||||
|
args:
|
||||||
|
- "--v={{ .Values.controller.logLevel }}"
|
||||||
|
- "--nodeid=$(NODE_ID)"
|
||||||
|
- "--endpoint=$(CSI_ENDPOINT)"
|
||||||
|
- "--drivername={{ .Values.driver.name }}"
|
||||||
|
env:
|
||||||
|
- name: NODE_ID
|
||||||
|
valueFrom:
|
||||||
|
fieldRef:
|
||||||
|
fieldPath: spec.nodeName
|
||||||
|
- name: CSI_ENDPOINT
|
||||||
|
value: unix:///csi/csi.sock
|
||||||
|
ports:
|
||||||
|
- containerPort: {{ .Values.controller.livenessProbe.healthPort }}
|
||||||
|
name: healthz
|
||||||
|
protocol: TCP
|
||||||
|
livenessProbe:
|
||||||
|
failureThreshold: 5
|
||||||
|
httpGet:
|
||||||
|
path: /healthz
|
||||||
|
port: healthz
|
||||||
|
initialDelaySeconds: 30
|
||||||
|
timeoutSeconds: 10
|
||||||
|
periodSeconds: 30
|
||||||
|
volumeMounts:
|
||||||
|
- name: pods-mount-dir
|
||||||
|
mountPath: /var/lib/kubelet/pods
|
||||||
|
mountPropagation: "Bidirectional"
|
||||||
|
- mountPath: /csi
|
||||||
|
name: socket-dir
|
||||||
|
resources: {{- toYaml .Values.controller.resources.nfs | nindent 12 }}
|
||||||
|
volumes:
|
||||||
|
- name: pods-mount-dir
|
||||||
|
hostPath:
|
||||||
|
path: /var/lib/kubelet/pods
|
||||||
|
type: Directory
|
||||||
|
- name: socket-dir
|
||||||
|
emptyDir: {}
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
apiVersion: storage.k8s.io/v1
|
||||||
|
kind: CSIDriver
|
||||||
|
metadata:
|
||||||
|
name: {{ .Values.driver.name }}
|
||||||
|
spec:
|
||||||
|
attachRequired: false
|
||||||
|
volumeLifecycleModes:
|
||||||
|
- Persistent
|
||||||
|
{{- if .Values.feature.enableFSGroupPolicy}}
|
||||||
|
fsGroupPolicy: File
|
||||||
|
{{- end}}
|
||||||
126
charts/v3.0.0/csi-driver-nfs/templates/csi-nfs-node.yaml
Normal file
126
charts/v3.0.0/csi-driver-nfs/templates/csi-nfs-node.yaml
Normal file
@ -0,0 +1,126 @@
|
|||||||
|
# This YAML file contains driver-registrar & csi driver nodeplugin API objects
|
||||||
|
# that are necessary to run CSI nodeplugin for nfs
|
||||||
|
kind: DaemonSet
|
||||||
|
apiVersion: apps/v1
|
||||||
|
metadata:
|
||||||
|
name: {{ .Values.node.name }}
|
||||||
|
namespace: {{ .Release.Namespace }}
|
||||||
|
{{ include "nfs.labels" . | indent 2 }}
|
||||||
|
spec:
|
||||||
|
updateStrategy:
|
||||||
|
rollingUpdate:
|
||||||
|
maxUnavailable: {{ .Values.node.maxUnavailable }}
|
||||||
|
type: RollingUpdate
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: {{ .Values.node.name }}
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
{{ include "nfs.labels" . | indent 6 }}
|
||||||
|
app: {{ .Values.node.name }}
|
||||||
|
spec:
|
||||||
|
{{- if .Values.imagePullSecrets }}
|
||||||
|
imagePullSecrets:
|
||||||
|
{{ toYaml .Values.imagePullSecrets | indent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
hostNetwork: true # original nfs connection would be broken without hostNetwork setting
|
||||||
|
dnsPolicy: ClusterFirstWithHostNet
|
||||||
|
nodeSelector:
|
||||||
|
kubernetes.io/os: linux
|
||||||
|
{{- with .Values.node.tolerations }}
|
||||||
|
tolerations:
|
||||||
|
{{ toYaml . | indent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
containers:
|
||||||
|
- name: liveness-probe
|
||||||
|
image: "{{ .Values.image.livenessProbe.repository }}:{{ .Values.image.livenessProbe.tag }}"
|
||||||
|
args:
|
||||||
|
- --csi-address=/csi/csi.sock
|
||||||
|
- --probe-timeout=3s
|
||||||
|
- --health-port={{ .Values.node.livenessProbe.healthPort }}
|
||||||
|
- --v=2
|
||||||
|
imagePullPolicy: {{ .Values.image.livenessProbe.pullPolicy }}
|
||||||
|
volumeMounts:
|
||||||
|
- name: socket-dir
|
||||||
|
mountPath: /csi
|
||||||
|
resources: {{- toYaml .Values.node.resources.livenessProbe | nindent 12 }}
|
||||||
|
- name: node-driver-registrar
|
||||||
|
image: "{{ .Values.image.nodeDriverRegistrar.repository }}:{{ .Values.image.nodeDriverRegistrar.tag }}"
|
||||||
|
livenessProbe:
|
||||||
|
exec:
|
||||||
|
command:
|
||||||
|
- /csi-node-driver-registrar
|
||||||
|
- --kubelet-registration-path=$(DRIVER_REG_SOCK_PATH)
|
||||||
|
- --mode=kubelet-registration-probe
|
||||||
|
initialDelaySeconds: 30
|
||||||
|
timeoutSeconds: 15
|
||||||
|
args:
|
||||||
|
- --v=2
|
||||||
|
- --csi-address=/csi/csi.sock
|
||||||
|
- --kubelet-registration-path=$(DRIVER_REG_SOCK_PATH)
|
||||||
|
env:
|
||||||
|
- name: DRIVER_REG_SOCK_PATH
|
||||||
|
value: /var/lib/kubelet/plugins/csi-nfsplugin/csi.sock
|
||||||
|
- name: KUBE_NODE_NAME
|
||||||
|
valueFrom:
|
||||||
|
fieldRef:
|
||||||
|
fieldPath: spec.nodeName
|
||||||
|
imagePullPolicy: {{ .Values.image.nodeDriverRegistrar.pullPolicy }}
|
||||||
|
volumeMounts:
|
||||||
|
- name: socket-dir
|
||||||
|
mountPath: /csi
|
||||||
|
- name: registration-dir
|
||||||
|
mountPath: /registration
|
||||||
|
resources: {{- toYaml .Values.node.resources.nodeDriverRegistrar | nindent 12 }}
|
||||||
|
- name: nfs
|
||||||
|
securityContext:
|
||||||
|
privileged: true
|
||||||
|
capabilities:
|
||||||
|
add: ["SYS_ADMIN"]
|
||||||
|
allowPrivilegeEscalation: true
|
||||||
|
image: "{{ .Values.image.nfs.repository }}:{{ .Values.image.nfs.tag }}"
|
||||||
|
args :
|
||||||
|
- "--v={{ .Values.node.logLevel }}"
|
||||||
|
- "--nodeid=$(NODE_ID)"
|
||||||
|
- "--endpoint=$(CSI_ENDPOINT)"
|
||||||
|
- "--drivername={{ .Values.driver.name }}"
|
||||||
|
env:
|
||||||
|
- name: NODE_ID
|
||||||
|
valueFrom:
|
||||||
|
fieldRef:
|
||||||
|
fieldPath: spec.nodeName
|
||||||
|
- name: CSI_ENDPOINT
|
||||||
|
value: unix:///csi/csi.sock
|
||||||
|
ports:
|
||||||
|
- containerPort: {{ .Values.node.livenessProbe.healthPort }}
|
||||||
|
name: healthz
|
||||||
|
protocol: TCP
|
||||||
|
livenessProbe:
|
||||||
|
failureThreshold: 5
|
||||||
|
httpGet:
|
||||||
|
path: /healthz
|
||||||
|
port: healthz
|
||||||
|
initialDelaySeconds: 30
|
||||||
|
timeoutSeconds: 10
|
||||||
|
periodSeconds: 30
|
||||||
|
imagePullPolicy: {{ .Values.image.nfs.pullPolicy }}
|
||||||
|
volumeMounts:
|
||||||
|
- name: socket-dir
|
||||||
|
mountPath: /csi
|
||||||
|
- name: pods-mount-dir
|
||||||
|
mountPath: /var/lib/kubelet/pods
|
||||||
|
mountPropagation: "Bidirectional"
|
||||||
|
resources: {{- toYaml .Values.node.resources.nfs | nindent 12 }}
|
||||||
|
volumes:
|
||||||
|
- name: socket-dir
|
||||||
|
hostPath:
|
||||||
|
path: /var/lib/kubelet/plugins/csi-nfsplugin
|
||||||
|
type: DirectoryOrCreate
|
||||||
|
- name: pods-mount-dir
|
||||||
|
hostPath:
|
||||||
|
path: /var/lib/kubelet/pods
|
||||||
|
type: Directory
|
||||||
|
- hostPath:
|
||||||
|
path: /var/lib/kubelet/plugins_registry
|
||||||
|
type: Directory
|
||||||
|
name: registration-dir
|
||||||
@ -0,0 +1,54 @@
|
|||||||
|
{{- if .Values.serviceAccount.create -}}
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ServiceAccount
|
||||||
|
metadata:
|
||||||
|
name: csi-{{ .Values.rbac.name }}-controller-sa
|
||||||
|
namespace: {{ .Release.Namespace }}
|
||||||
|
{{ include "nfs.labels" . | indent 2 }}
|
||||||
|
---
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- if .Values.rbac.create -}}
|
||||||
|
kind: ClusterRole
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
metadata:
|
||||||
|
name: {{ .Values.rbac.name }}-external-provisioner-role
|
||||||
|
{{ include "nfs.labels" . | indent 2 }}
|
||||||
|
rules:
|
||||||
|
- apiGroups: [""]
|
||||||
|
resources: ["persistentvolumes"]
|
||||||
|
verbs: ["get", "list", "watch", "create", "delete"]
|
||||||
|
- apiGroups: [""]
|
||||||
|
resources: ["persistentvolumeclaims"]
|
||||||
|
verbs: ["get", "list", "watch", "update"]
|
||||||
|
- apiGroups: ["storage.k8s.io"]
|
||||||
|
resources: ["storageclasses"]
|
||||||
|
verbs: ["get", "list", "watch"]
|
||||||
|
- apiGroups: [""]
|
||||||
|
resources: ["events"]
|
||||||
|
verbs: ["get", "list", "watch", "create", "update", "patch"]
|
||||||
|
- apiGroups: ["storage.k8s.io"]
|
||||||
|
resources: ["csinodes"]
|
||||||
|
verbs: ["get", "list", "watch"]
|
||||||
|
- apiGroups: [""]
|
||||||
|
resources: ["nodes"]
|
||||||
|
verbs: ["get", "list", "watch"]
|
||||||
|
- apiGroups: ["coordination.k8s.io"]
|
||||||
|
resources: ["leases"]
|
||||||
|
verbs: ["get", "list", "watch", "create", "update", "patch"]
|
||||||
|
---
|
||||||
|
kind: ClusterRoleBinding
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
metadata:
|
||||||
|
name: {{ .Values.rbac.name }}-csi-provisioner-binding
|
||||||
|
{{ include "nfs.labels" . | indent 2 }}
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: csi-{{ .Values.rbac.name }}-controller-sa
|
||||||
|
namespace: {{ .Release.Namespace }}
|
||||||
|
roleRef:
|
||||||
|
kind: ClusterRole
|
||||||
|
name: {{ .Values.rbac.name }}-external-provisioner-role
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
{{- end -}}
|
||||||
105
charts/v3.0.0/csi-driver-nfs/values.yaml
Executable file
105
charts/v3.0.0/csi-driver-nfs/values.yaml
Executable file
@ -0,0 +1,105 @@
|
|||||||
|
image:
|
||||||
|
nfs:
|
||||||
|
repository: mcr.microsoft.com/k8s/csi/nfs-csi
|
||||||
|
tag: v3.0.0
|
||||||
|
pullPolicy: IfNotPresent
|
||||||
|
csiProvisioner:
|
||||||
|
repository: k8s.gcr.io/sig-storage/csi-provisioner
|
||||||
|
tag: v2.2.2
|
||||||
|
pullPolicy: IfNotPresent
|
||||||
|
livenessProbe:
|
||||||
|
repository: k8s.gcr.io/sig-storage/livenessprobe
|
||||||
|
tag: v2.5.0
|
||||||
|
pullPolicy: IfNotPresent
|
||||||
|
nodeDriverRegistrar:
|
||||||
|
repository: k8s.gcr.io/sig-storage/csi-node-driver-registrar
|
||||||
|
tag: v2.4.0
|
||||||
|
pullPolicy: IfNotPresent
|
||||||
|
|
||||||
|
serviceAccount:
|
||||||
|
create: true # When true, service accounts will be created for you. Set to false if you want to use your own.
|
||||||
|
controller: csi-nfs-controller-sa # Name of Service Account to be created or used
|
||||||
|
|
||||||
|
rbac:
|
||||||
|
create: true
|
||||||
|
name: nfs
|
||||||
|
|
||||||
|
controller:
|
||||||
|
name: csi-nfs-controller
|
||||||
|
replicas: 2
|
||||||
|
runOnMaster: false
|
||||||
|
livenessProbe:
|
||||||
|
healthPort: 29652
|
||||||
|
logLevel: 5
|
||||||
|
tolerations:
|
||||||
|
- key: "node-role.kubernetes.io/master"
|
||||||
|
operator: "Exists"
|
||||||
|
effect: "NoSchedule"
|
||||||
|
- key: "node-role.kubernetes.io/controlplane"
|
||||||
|
operator: "Exists"
|
||||||
|
effect: "NoSchedule"
|
||||||
|
resources:
|
||||||
|
csiProvisioner:
|
||||||
|
limits:
|
||||||
|
cpu: 1
|
||||||
|
memory: 400Mi
|
||||||
|
requests:
|
||||||
|
cpu: 10m
|
||||||
|
memory: 20Mi
|
||||||
|
livenessProbe:
|
||||||
|
limits:
|
||||||
|
cpu: 1
|
||||||
|
memory: 100Mi
|
||||||
|
requests:
|
||||||
|
cpu: 10m
|
||||||
|
memory: 20Mi
|
||||||
|
nfs:
|
||||||
|
limits:
|
||||||
|
cpu: 1
|
||||||
|
memory: 200Mi
|
||||||
|
requests:
|
||||||
|
cpu: 10m
|
||||||
|
memory: 20Mi
|
||||||
|
|
||||||
|
node:
|
||||||
|
name: csi-nfs-node
|
||||||
|
maxUnavailable: 1
|
||||||
|
logLevel: 5
|
||||||
|
livenessProbe:
|
||||||
|
healthPort: 29653
|
||||||
|
tolerations:
|
||||||
|
- operator: "Exists"
|
||||||
|
resources:
|
||||||
|
livenessProbe:
|
||||||
|
limits:
|
||||||
|
cpu: 1
|
||||||
|
memory: 100Mi
|
||||||
|
requests:
|
||||||
|
cpu: 10m
|
||||||
|
memory: 20Mi
|
||||||
|
nodeDriverRegistrar:
|
||||||
|
limits:
|
||||||
|
cpu: 1
|
||||||
|
memory: 100Mi
|
||||||
|
requests:
|
||||||
|
cpu: 10m
|
||||||
|
memory: 20Mi
|
||||||
|
nfs:
|
||||||
|
limits:
|
||||||
|
cpu: 1
|
||||||
|
memory: 300Mi
|
||||||
|
requests:
|
||||||
|
cpu: 10m
|
||||||
|
memory: 20Mi
|
||||||
|
|
||||||
|
feature:
|
||||||
|
enableFSGroupPolicy: false
|
||||||
|
|
||||||
|
driver:
|
||||||
|
name: nfs.csi.k8s.io
|
||||||
|
|
||||||
|
## Reference to one or more secrets to be used when pulling images
|
||||||
|
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
|
||||||
|
##
|
||||||
|
imagePullSecrets: []
|
||||||
|
# - name: "image-pull-secret"
|
||||||
@ -65,7 +65,7 @@ spec:
|
|||||||
cpu: 10m
|
cpu: 10m
|
||||||
memory: 20Mi
|
memory: 20Mi
|
||||||
- name: nfs
|
- name: nfs
|
||||||
image: mcr.microsoft.com/k8s/csi/nfs-csi:latest
|
image: mcr.microsoft.com/k8s/csi/nfs-csi:v3.0.0
|
||||||
securityContext:
|
securityContext:
|
||||||
privileged: true
|
privileged: true
|
||||||
capabilities:
|
capabilities:
|
||||||
|
|||||||
@ -82,7 +82,7 @@ spec:
|
|||||||
capabilities:
|
capabilities:
|
||||||
add: ["SYS_ADMIN"]
|
add: ["SYS_ADMIN"]
|
||||||
allowPrivilegeEscalation: true
|
allowPrivilegeEscalation: true
|
||||||
image: mcr.microsoft.com/k8s/csi/nfs-csi:latest
|
image: mcr.microsoft.com/k8s/csi/nfs-csi:v3.0.0
|
||||||
args:
|
args:
|
||||||
- "-v=5"
|
- "-v=5"
|
||||||
- "--nodeid=$(NODE_ID)"
|
- "--nodeid=$(NODE_ID)"
|
||||||
|
|||||||
117
deploy/v3.0.0/csi-nfs-controller.yaml
Normal file
117
deploy/v3.0.0/csi-nfs-controller.yaml
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
---
|
||||||
|
kind: Deployment
|
||||||
|
apiVersion: apps/v1
|
||||||
|
metadata:
|
||||||
|
name: csi-nfs-controller
|
||||||
|
namespace: kube-system
|
||||||
|
spec:
|
||||||
|
replicas: 2
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: csi-nfs-controller
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: csi-nfs-controller
|
||||||
|
spec:
|
||||||
|
hostNetwork: true # controller also needs to mount nfs to create dir
|
||||||
|
dnsPolicy: ClusterFirstWithHostNet
|
||||||
|
serviceAccountName: csi-nfs-controller-sa
|
||||||
|
nodeSelector:
|
||||||
|
kubernetes.io/os: linux # add "kubernetes.io/role: master" to run controller on master node
|
||||||
|
priorityClassName: system-cluster-critical
|
||||||
|
tolerations:
|
||||||
|
- key: "node-role.kubernetes.io/master"
|
||||||
|
operator: "Exists"
|
||||||
|
effect: "NoSchedule"
|
||||||
|
- key: "node-role.kubernetes.io/controlplane"
|
||||||
|
operator: "Exists"
|
||||||
|
effect: "NoSchedule"
|
||||||
|
containers:
|
||||||
|
- name: csi-provisioner
|
||||||
|
image: k8s.gcr.io/sig-storage/csi-provisioner:v2.2.2
|
||||||
|
args:
|
||||||
|
- "-v=2"
|
||||||
|
- "--csi-address=$(ADDRESS)"
|
||||||
|
- "--leader-election"
|
||||||
|
env:
|
||||||
|
- name: ADDRESS
|
||||||
|
value: /csi/csi.sock
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: /csi
|
||||||
|
name: socket-dir
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 1
|
||||||
|
memory: 400Mi
|
||||||
|
requests:
|
||||||
|
cpu: 10m
|
||||||
|
memory: 20Mi
|
||||||
|
- name: liveness-probe
|
||||||
|
image: k8s.gcr.io/sig-storage/livenessprobe:v2.5.0
|
||||||
|
args:
|
||||||
|
- --csi-address=/csi/csi.sock
|
||||||
|
- --probe-timeout=3s
|
||||||
|
- --health-port=29652
|
||||||
|
- --v=2
|
||||||
|
volumeMounts:
|
||||||
|
- name: socket-dir
|
||||||
|
mountPath: /csi
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 1
|
||||||
|
memory: 100Mi
|
||||||
|
requests:
|
||||||
|
cpu: 10m
|
||||||
|
memory: 20Mi
|
||||||
|
- name: nfs
|
||||||
|
image: mcr.microsoft.com/k8s/csi/nfs-csi:v3.0.0
|
||||||
|
securityContext:
|
||||||
|
privileged: true
|
||||||
|
capabilities:
|
||||||
|
add: ["SYS_ADMIN"]
|
||||||
|
allowPrivilegeEscalation: true
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
args:
|
||||||
|
- "-v=5"
|
||||||
|
- "--nodeid=$(NODE_ID)"
|
||||||
|
- "--endpoint=$(CSI_ENDPOINT)"
|
||||||
|
env:
|
||||||
|
- name: NODE_ID
|
||||||
|
valueFrom:
|
||||||
|
fieldRef:
|
||||||
|
fieldPath: spec.nodeName
|
||||||
|
- name: CSI_ENDPOINT
|
||||||
|
value: unix:///csi/csi.sock
|
||||||
|
ports:
|
||||||
|
- containerPort: 29652
|
||||||
|
name: healthz
|
||||||
|
protocol: TCP
|
||||||
|
livenessProbe:
|
||||||
|
failureThreshold: 5
|
||||||
|
httpGet:
|
||||||
|
path: /healthz
|
||||||
|
port: healthz
|
||||||
|
initialDelaySeconds: 30
|
||||||
|
timeoutSeconds: 10
|
||||||
|
periodSeconds: 30
|
||||||
|
volumeMounts:
|
||||||
|
- name: pods-mount-dir
|
||||||
|
mountPath: /var/lib/kubelet/pods
|
||||||
|
mountPropagation: "Bidirectional"
|
||||||
|
- mountPath: /csi
|
||||||
|
name: socket-dir
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 1
|
||||||
|
memory: 200Mi
|
||||||
|
requests:
|
||||||
|
cpu: 10m
|
||||||
|
memory: 20Mi
|
||||||
|
volumes:
|
||||||
|
- name: pods-mount-dir
|
||||||
|
hostPath:
|
||||||
|
path: /var/lib/kubelet/pods
|
||||||
|
type: Directory
|
||||||
|
- name: socket-dir
|
||||||
|
emptyDir: {}
|
||||||
9
deploy/v3.0.0/csi-nfs-driverinfo.yaml
Normal file
9
deploy/v3.0.0/csi-nfs-driverinfo.yaml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
apiVersion: storage.k8s.io/v1
|
||||||
|
kind: CSIDriver
|
||||||
|
metadata:
|
||||||
|
name: nfs.csi.k8s.io
|
||||||
|
spec:
|
||||||
|
attachRequired: false
|
||||||
|
volumeLifecycleModes:
|
||||||
|
- Persistent
|
||||||
135
deploy/v3.0.0/csi-nfs-node.yaml
Normal file
135
deploy/v3.0.0/csi-nfs-node.yaml
Normal file
@ -0,0 +1,135 @@
|
|||||||
|
---
|
||||||
|
# This YAML file contains driver-registrar & csi driver nodeplugin API objects
|
||||||
|
# that are necessary to run CSI nodeplugin for nfs
|
||||||
|
kind: DaemonSet
|
||||||
|
apiVersion: apps/v1
|
||||||
|
metadata:
|
||||||
|
name: csi-nfs-node
|
||||||
|
namespace: kube-system
|
||||||
|
spec:
|
||||||
|
updateStrategy:
|
||||||
|
rollingUpdate:
|
||||||
|
maxUnavailable: 1
|
||||||
|
type: RollingUpdate
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: csi-nfs-node
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: csi-nfs-node
|
||||||
|
spec:
|
||||||
|
hostNetwork: true # original nfs connection would be broken without hostNetwork setting
|
||||||
|
dnsPolicy: ClusterFirstWithHostNet
|
||||||
|
nodeSelector:
|
||||||
|
kubernetes.io/os: linux
|
||||||
|
tolerations:
|
||||||
|
- operator: "Exists"
|
||||||
|
containers:
|
||||||
|
- name: liveness-probe
|
||||||
|
image: k8s.gcr.io/sig-storage/livenessprobe:v2.5.0
|
||||||
|
args:
|
||||||
|
- --csi-address=/csi/csi.sock
|
||||||
|
- --probe-timeout=3s
|
||||||
|
- --health-port=29653
|
||||||
|
- --v=2
|
||||||
|
volumeMounts:
|
||||||
|
- name: socket-dir
|
||||||
|
mountPath: /csi
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 1
|
||||||
|
memory: 100Mi
|
||||||
|
requests:
|
||||||
|
cpu: 10m
|
||||||
|
memory: 20Mi
|
||||||
|
- name: node-driver-registrar
|
||||||
|
image: k8s.gcr.io/sig-storage/csi-node-driver-registrar:v2.4.0
|
||||||
|
args:
|
||||||
|
- --v=2
|
||||||
|
- --csi-address=/csi/csi.sock
|
||||||
|
- --kubelet-registration-path=$(DRIVER_REG_SOCK_PATH)
|
||||||
|
livenessProbe:
|
||||||
|
exec:
|
||||||
|
command:
|
||||||
|
- /csi-node-driver-registrar
|
||||||
|
- --kubelet-registration-path=$(DRIVER_REG_SOCK_PATH)
|
||||||
|
- --mode=kubelet-registration-probe
|
||||||
|
initialDelaySeconds: 30
|
||||||
|
timeoutSeconds: 15
|
||||||
|
env:
|
||||||
|
- name: DRIVER_REG_SOCK_PATH
|
||||||
|
value: /var/lib/kubelet/plugins/csi-nfsplugin/csi.sock
|
||||||
|
- name: KUBE_NODE_NAME
|
||||||
|
valueFrom:
|
||||||
|
fieldRef:
|
||||||
|
fieldPath: spec.nodeName
|
||||||
|
volumeMounts:
|
||||||
|
- name: socket-dir
|
||||||
|
mountPath: /csi
|
||||||
|
- name: registration-dir
|
||||||
|
mountPath: /registration
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 1
|
||||||
|
memory: 100Mi
|
||||||
|
requests:
|
||||||
|
cpu: 10m
|
||||||
|
memory: 20Mi
|
||||||
|
- name: nfs
|
||||||
|
securityContext:
|
||||||
|
privileged: true
|
||||||
|
capabilities:
|
||||||
|
add: ["SYS_ADMIN"]
|
||||||
|
allowPrivilegeEscalation: true
|
||||||
|
image: mcr.microsoft.com/k8s/csi/nfs-csi:v3.0.0
|
||||||
|
args:
|
||||||
|
- "-v=5"
|
||||||
|
- "--nodeid=$(NODE_ID)"
|
||||||
|
- "--endpoint=$(CSI_ENDPOINT)"
|
||||||
|
env:
|
||||||
|
- name: NODE_ID
|
||||||
|
valueFrom:
|
||||||
|
fieldRef:
|
||||||
|
fieldPath: spec.nodeName
|
||||||
|
- name: CSI_ENDPOINT
|
||||||
|
value: unix:///csi/csi.sock
|
||||||
|
ports:
|
||||||
|
- containerPort: 29653
|
||||||
|
name: healthz
|
||||||
|
protocol: TCP
|
||||||
|
livenessProbe:
|
||||||
|
failureThreshold: 5
|
||||||
|
httpGet:
|
||||||
|
path: /healthz
|
||||||
|
port: healthz
|
||||||
|
initialDelaySeconds: 30
|
||||||
|
timeoutSeconds: 10
|
||||||
|
periodSeconds: 30
|
||||||
|
imagePullPolicy: "IfNotPresent"
|
||||||
|
volumeMounts:
|
||||||
|
- name: socket-dir
|
||||||
|
mountPath: /csi
|
||||||
|
- name: pods-mount-dir
|
||||||
|
mountPath: /var/lib/kubelet/pods
|
||||||
|
mountPropagation: "Bidirectional"
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 1
|
||||||
|
memory: 300Mi
|
||||||
|
requests:
|
||||||
|
cpu: 10m
|
||||||
|
memory: 20Mi
|
||||||
|
volumes:
|
||||||
|
- name: socket-dir
|
||||||
|
hostPath:
|
||||||
|
path: /var/lib/kubelet/plugins/csi-nfsplugin
|
||||||
|
type: DirectoryOrCreate
|
||||||
|
- name: pods-mount-dir
|
||||||
|
hostPath:
|
||||||
|
path: /var/lib/kubelet/pods
|
||||||
|
type: Directory
|
||||||
|
- hostPath:
|
||||||
|
path: /var/lib/kubelet/plugins_registry
|
||||||
|
type: Directory
|
||||||
|
name: registration-dir
|
||||||
49
deploy/v3.0.0/rbac-csi-nfs-controller.yaml
Normal file
49
deploy/v3.0.0/rbac-csi-nfs-controller.yaml
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ServiceAccount
|
||||||
|
metadata:
|
||||||
|
name: csi-nfs-controller-sa
|
||||||
|
namespace: kube-system
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
kind: ClusterRole
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
metadata:
|
||||||
|
name: nfs-external-provisioner-role
|
||||||
|
rules:
|
||||||
|
- apiGroups: [""]
|
||||||
|
resources: ["persistentvolumes"]
|
||||||
|
verbs: ["get", "list", "watch", "create", "delete"]
|
||||||
|
- apiGroups: [""]
|
||||||
|
resources: ["persistentvolumeclaims"]
|
||||||
|
verbs: ["get", "list", "watch", "update"]
|
||||||
|
- apiGroups: ["storage.k8s.io"]
|
||||||
|
resources: ["storageclasses"]
|
||||||
|
verbs: ["get", "list", "watch"]
|
||||||
|
- apiGroups: [""]
|
||||||
|
resources: ["events"]
|
||||||
|
verbs: ["get", "list", "watch", "create", "update", "patch"]
|
||||||
|
- apiGroups: ["storage.k8s.io"]
|
||||||
|
resources: ["csinodes"]
|
||||||
|
verbs: ["get", "list", "watch"]
|
||||||
|
- apiGroups: [""]
|
||||||
|
resources: ["nodes"]
|
||||||
|
verbs: ["get", "list", "watch"]
|
||||||
|
- apiGroups: ["coordination.k8s.io"]
|
||||||
|
resources: ["leases"]
|
||||||
|
verbs: ["get", "list", "watch", "create", "update", "patch"]
|
||||||
|
---
|
||||||
|
|
||||||
|
kind: ClusterRoleBinding
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
metadata:
|
||||||
|
name: nfs-csi-provisioner-binding
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: csi-nfs-controller-sa
|
||||||
|
namespace: kube-system
|
||||||
|
roleRef:
|
||||||
|
kind: ClusterRole
|
||||||
|
name: nfs-external-provisioner-role
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
37
docs/install-csi-driver-v3.0.0.md
Normal file
37
docs/install-csi-driver-v3.0.0.md
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
# Install NFS CSI driver v3.0.0 version on a kubernetes cluster
|
||||||
|
|
||||||
|
If you have already installed Helm, you can also use it to install NFS CSI driver. Please see [Installation with Helm](../charts/README.md).
|
||||||
|
|
||||||
|
## Install with kubectl
|
||||||
|
- remote install
|
||||||
|
```console
|
||||||
|
curl -skSL https://raw.githubusercontent.com/kubernetes-csi/csi-driver-nfs/v3.0.0/deploy/install-driver.sh | bash -s v3.0.0 --
|
||||||
|
```
|
||||||
|
|
||||||
|
- local install
|
||||||
|
```console
|
||||||
|
git clone https://github.com/kubernetes-csi/csi-driver-nfs.git
|
||||||
|
cd csi-driver-nfs
|
||||||
|
./deploy/install-driver.sh v3.0.0 local
|
||||||
|
```
|
||||||
|
|
||||||
|
- check pods status:
|
||||||
|
```console
|
||||||
|
kubectl -n kube-system get pod -o wide -l app=csi-nfs-controller
|
||||||
|
kubectl -n kube-system get pod -o wide -l app=csi-nfs-node
|
||||||
|
```
|
||||||
|
|
||||||
|
example output:
|
||||||
|
|
||||||
|
```console
|
||||||
|
NAME READY STATUS RESTARTS AGE IP NODE
|
||||||
|
csi-nfs-controller-56bfddd689-dh5tk 4/4 Running 0 35s 10.240.0.19 k8s-agentpool-22533604-0
|
||||||
|
csi-nfs-controller-56bfddd689-8pgr4 4/4 Running 0 35s 10.240.0.35 k8s-agentpool-22533604-1
|
||||||
|
csi-nfs-node-cvgbs 3/3 Running 0 35s 10.240.0.35 k8s-agentpool-22533604-1
|
||||||
|
csi-nfs-node-dr4s4 3/3 Running 0 35s 10.240.0.4 k8s-agentpool-22533604-0
|
||||||
|
```
|
||||||
|
|
||||||
|
- clean up NFS CSI driver
|
||||||
|
```console
|
||||||
|
curl -skSL https://raw.githubusercontent.com/kubernetes-csi/csi-driver-nfs/v3.0.0/deploy/uninstall-driver.sh | bash -s v3.0.0 --
|
||||||
|
```
|
||||||
4
docs/install-nfs-csi-driver.md
Normal file
4
docs/install-nfs-csi-driver.md
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
## Install NFS CSI driver on a Kubernetes cluster
|
||||||
|
|
||||||
|
- [install CSI driver master version](./install-csi-driver-master.md)
|
||||||
|
- [install CSI driver v3.0.0 version](./install-csi-driver-v3.0.0.md)
|
||||||
Loading…
x
Reference in New Issue
Block a user