Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…ster
  • Loading branch information
shiftstack-merge-bot committed May 13, 2024
2 parents 406cec7 + c8ad39f commit 1ab97b2
Show file tree
Hide file tree
Showing 267 changed files with 17,744 additions and 7,863 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/static.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
go-version: ^1.19
- uses: actions/checkout@master
- name: Run linter
uses: golangci/golangci-lint-action@v4
uses: golangci/golangci-lint-action@v6
with:
version: v1.54
args: -E=gofmt,unused,ineffassign,revive,misspell,exportloopref,asciicheck,bodyclose,contextcheck --timeout=30m0s
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/trivy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Install go
uses: actions/setup-go@v5
with:
go-version: ^1.19
go-version: 1.22.3

- name: Build an image from Dockerfile
run: |
Expand Down
1 change: 1 addition & 0 deletions .trivyignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CVE-2020-8559
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ This is a repository for [NFS](https://en.wikipedia.org/wiki/Network_File_System
|driver version | supported k8s version | status |
|----------------|-----------------------|--------|
|master branch | 1.21+ | GA |
|v4.7.0 | 1.21+ | GA |
|v4.6.0 | 1.21+ | GA |
|v4.5.0 | 1.21+ | GA |
|v4.4.0 | 1.21+ | GA |

### Install driver on a Kubernetes cluster
> [install NFS CSI driver on microk8s](https://microk8s.io/docs/how-to-nfs)
Expand Down
5 changes: 3 additions & 2 deletions charts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
### install a specific version
```console
helm repo add csi-driver-nfs https://raw.githubusercontent.com/kubernetes-csi/csi-driver-nfs/master/charts
helm install csi-driver-nfs csi-driver-nfs/csi-driver-nfs --namespace kube-system --version v4.6.0
helm install csi-driver-nfs csi-driver-nfs/csi-driver-nfs --namespace kube-system --version v4.7.0
```

### install driver with customized driver name, deployment name
Expand Down Expand Up @@ -69,6 +69,7 @@ The following table lists the configurable parameters of the latest NFS CSI Driv
| `controller.runOnControlPlane` | run controller on control plane node |`false` |
| `controller.dnsPolicy` | dnsPolicy of controller driver, available values: `Default`, `ClusterFirstWithHostNet`, `ClusterFirst` | `ClusterFirstWithHostNet` |
| `controller.defaultOnDeletePolicy` | default policy for deleting subdirectory when deleting a volume, available values: `delete`, `retain`, `archive` | `delete` |
| `controller.livenessProbe.healthPort ` | the health check port for liveness probe | `29652` |
| `controller.logLevel` | controller driver log level |`5` |
| `controller.workingMountDir` | working directory for provisioner to mount nfs shares temporarily | `/tmp` |
| `controller.affinity` | controller pod affinity | `{}` |
Expand Down Expand Up @@ -108,7 +109,7 @@ The following table lists the configurable parameters of the latest NFS CSI Driv
| `externalSnapshotter.resources.limits.memory` | snapshot-controller memory limits | 300Mi |
| `externalSnapshotter.resources.requests.cpu` | snapshot-controller cpu requests limits | 10m |
| `externalSnapshotter.resources.requests.memory` | snapshot-controller memory requests limits | 20Mi |

| `storageClass.create` | create storageclass| `false` | |

## troubleshooting
- Add `--wait -v=5 --debug` in `helm install` command to get detailed error
Expand Down
39 changes: 24 additions & 15 deletions charts/index.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,36 @@
apiVersion: v1
entries:
csi-driver-nfs:
- apiVersion: v1
appVersion: v4.7.0
created: "2024-05-04T07:52:10.41923332Z"
description: CSI NFS Driver for Kubernetes
digest: 9e87ca638633ab55d8f5a1a7a81d3888f712b02628a9817fcbb898750b94346a
name: csi-driver-nfs
urls:
- https://raw.githubusercontent.com/kubernetes-csi/csi-driver-nfs/master/charts/v4.7.0/csi-driver-nfs-v4.7.0.tgz
version: v4.7.0
- apiVersion: v1
appVersion: v4.6.0
created: "2024-01-16T12:59:23.637404723Z"
created: "2024-05-04T07:52:10.41839672Z"
description: CSI NFS Driver for Kubernetes
digest: 9d41237860a2f1f28f3723ac363abf83514e99e70d4cd23cee07023488f9b3e1
digest: fc252e16ce6c27a5090b73f4d4368674c768b48c289eea5904f5369082d8cab3
name: csi-driver-nfs
urls:
- https://raw.githubusercontent.com/kubernetes-csi/csi-driver-nfs/master/charts/v4.6.0/csi-driver-nfs-v4.6.0.tgz
version: v4.6.0
- apiVersion: v1
appVersion: v4.5.0
created: "2024-01-16T12:59:23.636199508Z"
created: "2024-05-04T07:52:10.416791983Z"
description: CSI NFS Driver for Kubernetes
digest: 662f6db409ac14747c72a9fb2955dedc9ade46497704cab3dd0c472f7d56d58f
digest: 26af231cea7696104e87749bd74664404e32885e7a5a9e6fa81c19c4ec0c31fc
name: csi-driver-nfs
urls:
- https://raw.githubusercontent.com/kubernetes-csi/csi-driver-nfs/master/charts/v4.5.0/csi-driver-nfs-v4.5.0.tgz
version: v4.5.0
- apiVersion: v1
appVersion: v4.4.0
created: "2024-01-16T12:59:23.62702442Z"
created: "2024-05-04T07:52:10.41597809Z"
description: CSI NFS Driver for Kubernetes
digest: 7fba8cbfc47036a0fddadad00ee291c625e359fe1483ef37b57fd09d157c80dd
name: csi-driver-nfs
Expand All @@ -30,7 +39,7 @@ entries:
version: v4.4.0
- apiVersion: v1
appVersion: v4.3.0
created: "2024-01-16T12:59:23.626309866Z"
created: "2024-05-04T07:52:10.415277659Z"
description: CSI NFS Driver for Kubernetes
digest: 1aef5dec52a6c433dbed2e361bed0ab1fdd6792f845eccb99b7dc7f193c2a71e
name: csi-driver-nfs
Expand All @@ -39,7 +48,7 @@ entries:
version: v4.3.0
- apiVersion: v1
appVersion: v4.2.0
created: "2024-01-16T12:59:23.625592285Z"
created: "2024-05-04T07:52:10.414529394Z"
description: CSI NFS Driver for Kubernetes
digest: e702f6c9be35f2649f5736ca5fcdc40ab1c6a235f41e7fb2472d208e8a5ebf47
name: csi-driver-nfs
Expand All @@ -48,7 +57,7 @@ entries:
version: v4.2.0
- apiVersion: v1
appVersion: v4.1.0
created: "2024-01-16T12:59:23.625156557Z"
created: "2024-05-04T07:52:10.414063522Z"
description: CSI NFS Driver for Kubernetes
digest: b2baa2f129976cf2981c8873290aac509aa3c5937ffc319fbf69fbe3271c23eb
name: csi-driver-nfs
Expand All @@ -57,7 +66,7 @@ entries:
version: v4.1.0
- apiVersion: v1
appVersion: v4.0.0
created: "2024-01-16T12:59:23.624692396Z"
created: "2024-05-04T07:52:10.413618736Z"
description: CSI NFS Driver for Kubernetes
digest: 3145fd12225a639908b14675c8ae1f272bc0e57ffa2895b6f17411486a24229d
name: csi-driver-nfs
Expand All @@ -66,7 +75,7 @@ entries:
version: v4.0.0
- apiVersion: v1
appVersion: v3.1.0
created: "2024-01-16T12:59:23.624230727Z"
created: "2024-05-04T07:52:10.413183476Z"
description: CSI NFS Driver for Kubernetes
digest: 7e51bb9188b013195cafc265102fa365de9ec5513780e1dfc5363289f811a4d9
name: csi-driver-nfs
Expand All @@ -75,7 +84,7 @@ entries:
version: v3.1.0
- apiVersion: v1
appVersion: v3.0.0
created: "2024-01-16T12:59:23.623759424Z"
created: "2024-05-04T07:52:10.412773905Z"
description: CSI NFS Driver for Kubernetes
digest: 44406231cd5cdada1c62a0541b93b4f5d5a70ccc8c50b33553a8692fe6cfae96
name: csi-driver-nfs
Expand All @@ -84,7 +93,7 @@ entries:
version: v3.0.0
- apiVersion: v1
appVersion: v2.0.0
created: "2024-01-16T12:59:23.623239703Z"
created: "2024-05-04T07:52:10.412366016Z"
description: CSI NFS Driver for Kubernetes
digest: 1a32c6fc016526fe19a0c9e0dfbe83d0ddde67ced533bb5f5d24d713f706c613
name: csi-driver-nfs
Expand All @@ -93,11 +102,11 @@ entries:
version: v2.0.0
- apiVersion: v1
appVersion: latest
created: "2024-01-16T12:59:23.622949601Z"
created: "2024-05-04T07:52:10.412128236Z"
description: CSI NFS Driver for Kubernetes
digest: d1f85d1ec63bfeeb709b01438febd529f7d2b66a54c7c8cee8464f49498a575b
digest: 70e0ebd32f024eed91438aecf7df61a994c4037851ba66483a9e2eab29c7168e
name: csi-driver-nfs
urls:
- https://raw.githubusercontent.com/kubernetes-csi/csi-driver-nfs/master/charts/latest/csi-driver-nfs-v0.0.0.tgz
version: v0.0.0
generated: "2024-01-16T12:59:23.621346658Z"
generated: "2024-05-04T07:52:10.411193534Z"
Binary file modified charts/latest/csi-driver-nfs-v0.0.0.tgz
Binary file not shown.
25 changes: 19 additions & 6 deletions charts/latest/csi-driver-nfs/templates/csi-nfs-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ spec:
{{- end }}
containers:
- name: csi-provisioner
{{- if hasPrefix "/" .Values.image.csiProvisioner.repository }}
image: "{{ .Values.image.baseRepo }}{{ .Values.image.csiProvisioner.repository }}:{{ .Values.image.csiProvisioner.tag }}"
{{- else }}
image: "{{ .Values.image.csiProvisioner.repository }}:{{ .Values.image.csiProvisioner.tag }}"
{{- end }}
args:
- "-v=2"
- "--csi-address=$(ADDRESS)"
Expand All @@ -68,7 +72,11 @@ spec:
securityContext:
readOnlyRootFilesystem: true
- name: csi-snapshotter
{{- if hasPrefix "/" .Values.image.csiSnapshotter.repository }}
image: "{{ .Values.image.baseRepo }}{{ .Values.image.csiSnapshotter.repository }}:{{ .Values.image.csiSnapshotter.tag }}"
{{- else }}
image: "{{ .Values.image.csiSnapshotter.repository }}:{{ .Values.image.csiSnapshotter.tag }}"
{{- end }}
args:
- "--v=2"
- "--csi-address=$(ADDRESS)"
Expand All @@ -84,11 +92,15 @@ spec:
- name: socket-dir
mountPath: /csi
- name: liveness-probe
{{- if hasPrefix "/" .Values.image.livenessProbe.repository }}
image: "{{ .Values.image.baseRepo }}{{ .Values.image.livenessProbe.repository }}:{{ .Values.image.livenessProbe.tag }}"
{{- else }}
image: "{{ .Values.image.livenessProbe.repository }}:{{ .Values.image.livenessProbe.tag }}"
{{- end }}
args:
- --csi-address=/csi/csi.sock
- --probe-timeout=3s
- --health-port={{ .Values.controller.livenessProbe.healthPort }}
- --http-endpoint=localhost:{{ .Values.controller.livenessProbe.healthPort }}
- --v=2
imagePullPolicy: {{ .Values.image.livenessProbe.pullPolicy }}
volumeMounts:
Expand All @@ -98,7 +110,11 @@ spec:
securityContext:
readOnlyRootFilesystem: true
- name: nfs
{{- if hasPrefix "/" .Values.image.nfs.repository }}
image: "{{ .Values.image.baseRepo }}{{ .Values.image.nfs.repository }}:{{ .Values.image.nfs.tag }}"
{{- else }}
image: "{{ .Values.image.nfs.repository }}:{{ .Values.image.nfs.tag }}"
{{- end }}
securityContext:
privileged: true
capabilities:
Expand All @@ -121,15 +137,12 @@ spec:
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:
host: localhost
path: /healthz
port: healthz
port: {{ .Values.controller.livenessProbe.healthPort }}
initialDelaySeconds: 30
timeoutSeconds: 10
periodSeconds: 30
Expand Down
21 changes: 15 additions & 6 deletions charts/latest/csi-driver-nfs/templates/csi-nfs-node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,15 @@ spec:
{{- end }}
containers:
- name: liveness-probe
{{- if hasPrefix "/" .Values.image.livenessProbe.repository }}
image: "{{ .Values.image.baseRepo }}{{ .Values.image.livenessProbe.repository }}:{{ .Values.image.livenessProbe.tag }}"
{{- else }}
image: "{{ .Values.image.livenessProbe.repository }}:{{ .Values.image.livenessProbe.tag }}"
{{- end }}
args:
- --csi-address=/csi/csi.sock
- --probe-timeout=3s
- --health-port={{ .Values.node.livenessProbe.healthPort }}
- --http-endpoint=localhost:{{ .Values.node.livenessProbe.healthPort }}
- --v=2
imagePullPolicy: {{ .Values.image.livenessProbe.pullPolicy }}
volumeMounts:
Expand All @@ -58,7 +62,11 @@ spec:
securityContext:
readOnlyRootFilesystem: true
- name: node-driver-registrar
{{- if hasPrefix "/" .Values.image.nodeDriverRegistrar.repository }}
image: "{{ .Values.image.baseRepo }}{{ .Values.image.nodeDriverRegistrar.repository }}:{{ .Values.image.nodeDriverRegistrar.tag }}"
{{- else }}
image: "{{ .Values.image.nodeDriverRegistrar.repository }}:{{ .Values.image.nodeDriverRegistrar.tag }}"
{{- end }}
livenessProbe:
exec:
command:
Expand Down Expand Up @@ -92,7 +100,11 @@ spec:
add: ["SYS_ADMIN"]
allowPrivilegeEscalation: true
readOnlyRootFilesystem: true
{{- if hasPrefix "/" .Values.image.nfs.repository }}
image: "{{ .Values.image.baseRepo }}{{ .Values.image.nfs.repository }}:{{ .Values.image.nfs.tag }}"
{{- else }}
image: "{{ .Values.image.nfs.repository }}:{{ .Values.image.nfs.tag }}"
{{- end }}
args :
- "--v={{ .Values.node.logLevel }}"
- "--nodeid=$(NODE_ID)"
Expand All @@ -106,15 +118,12 @@ spec:
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:
host: localhost
path: /healthz
port: healthz
port: {{ .Values.node.livenessProbe.healthPort }}
initialDelaySeconds: 30
timeoutSeconds: 10
periodSeconds: 30
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ spec:
{{- end }}
containers:
- name: {{ .Values.externalSnapshotter.name }}
{{- if hasPrefix "/" .Values.image.externalSnapshotter.repository }}
image: "{{ .Values.image.baseRepo }}{{ .Values.image.externalSnapshotter.repository }}:{{ .Values.image.externalSnapshotter.tag }}"
{{- else }}
image: {{ .Values.image.externalSnapshotter.repository }}:{{ .Values.image.externalSnapshotter.tag }}
{{- end }}
args:
- "--v=2"
- "--leader-election=true"
Expand Down
19 changes: 19 additions & 0 deletions charts/latest/csi-driver-nfs/templates/storageclass.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{{- if .Values.storageClass.create }}
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: {{ .Values.storageClass.name }}
{{ include "nfs.labels" . | indent 2 }}
provisioner: nfs.csi.k8s.io
{{- with .Values.storageClass.parameters }}
parameters:
{{ toYaml . | indent 2 }}
{{- end }}
reclaimPolicy: {{ .Values.storageClass.reclaimPolicy }}
volumeBindingMode: {{ .Values.storageClass.volumeBindingMode }}
{{- with .Values.storageClass.mountOptions }}
mountOptions:
{{ toYaml . | indent 2 }}
{{- end }}
{{- end }}
18 changes: 18 additions & 0 deletions charts/latest/csi-driver-nfs/values.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
customLabels: {}
image:
baseRepo: registry.k8s.io
nfs:
repository: gcr.io/k8s-staging-sig-storage/nfsplugin
tag: canary
Expand Down Expand Up @@ -149,3 +150,20 @@ externalSnapshotter:
##
imagePullSecrets: []
# - name: "image-pull-secret"

## StorageClass resource example:
storageClass:
create: false
# name: nfs-csi
# parameters:
# server: nfs-server.default.svc.cluster.local
# share: /
# subDir:
# mountPermissions: "0"
# csi.storage.k8s.io/provisioner-secret is only needed for providing mountOptions in DeleteVolume
# csi.storage.k8s.io/provisioner-secret-name: "mount-options"
# csi.storage.k8s.io/provisioner-secret-namespace: "default"
# reclaimPolicy: Delete
# volumeBindingMode: Immediate
# mountOptions:
# - nfsvers=4.1
Binary file modified charts/v4.6.0/csi-driver-nfs-v4.6.0.tgz
Binary file not shown.

0 comments on commit 1ab97b2

Please sign in to comment.