Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
b173d49
doc: update mountOptions for DeleteVolume doc
andyzhangx Jan 4, 2022
49a763b
Merge pull request #264 from andyzhangx/mountoptions-doc
andyzhangx Jan 4, 2022
5423797
Update driver-parameters.md
andyzhangx Jan 4, 2022
405a69c
feat: add workingMountDir in chart config
andyzhangx Jan 3, 2022
5ae2584
Merge pull request #263 from andyzhangx/workingMountDir
andyzhangx Jan 5, 2022
e03c3b8
feat: change volume id format
andyzhangx Jan 5, 2022
f9faadf
Merge pull request #265 from andyzhangx/change-volumeid-format
andyzhangx Jan 6, 2022
6028557
feat: add inline volume support
andyzhangx Jan 6, 2022
9b3e1cd
fix: ValidateVolumeCapabilities
andyzhangx Jan 7, 2022
ae37851
Merge pull request #267 from andyzhangx/ValidateVolumeCapabilities-fix
andyzhangx Jan 8, 2022
e86dc68
feat: add mountOptions parameter for inline volume
andyzhangx Jan 11, 2022
fb28204
Merge pull request #266 from andyzhangx/inline-volume
andyzhangx Jan 13, 2022
9b0e228
Squashed 'release-tools/' changes from a6a1a797..31aa44d1
chrishenzie Jan 13, 2022
f125ccb
Merge commit '745b54f17fa36f12680ee35b79a5ad2a12b2b86a' into prow-upd…
chrishenzie Jan 13, 2022
d26df55
Merge pull request #268 from chrishenzie/prow-update-master
k8s-ci-robot Jan 14, 2022
79d4b0e
doc: cut v3.1.0 release
andyzhangx Jan 15, 2022
67aa364
doc: use latest version for master branch
andyzhangx Jan 15, 2022
1d6d82f
Merge pull request #269 from andyzhangx/cut-v3.1.0
andyzhangx Jan 16, 2022
b1b987e
chore: switch master branch to use v3.2.0
andyzhangx Jan 16, 2022
29f99a1
Merge pull request #270 from andyzhangx/switch-master-3.2.0
andyzhangx Jan 16, 2022
f0b51f9
feat: upgrade to csi-provisioner v3.1.0
andyzhangx Jan 21, 2022
76966d0
Merge pull request #271 from andyzhangx/upgrade-csi-provisioner-v3.1.0
andyzhangx Jan 25, 2022
0988133
update base image version of plugin binary to fix CVEs
humblec Jan 25, 2022
6c3baa7
Merge pull request #272 from humblec/cve
k8s-ci-robot Jan 25, 2022
deecdc2
cleanup: remove unnecessary CVE packages
andyzhangx Jan 25, 2022
f9e5ae6
Merge pull request #273 from andyzhangx/remove-unnecessary-cve-packages
andyzhangx Jan 26, 2022
a8d7899
doc: remove mount-options in example
andyzhangx Jan 26, 2022
56f1dfc
Merge pull request #276 from andyzhangx/remove-mount-options-in-example
andyzhangx Jan 27, 2022
695f8c8
chore: set replica of controller as 1 by default
andyzhangx Jan 27, 2022
e2bc26b
Merge pull request #281 from andyzhangx/replica-one
andyzhangx Jan 29, 2022
f7df83d
feat: add kubeletDir in chart config
neoaggelos Jan 28, 2022
7329d62
Merge pull request #279 from neoaggelos/feat/kubeletDir
k8s-ci-robot Jan 29, 2022
ca0fc86
Merge https://github.com/kubernetes-csi/csi-driver-nfs:master into ma…
Jan 31, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.16
go-version: ^1.17
id: go

- name: Check out code into the Go module directory
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/static.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ jobs:
- name: Run linter
uses: golangci/golangci-lint-action@v2
with:
version: v1.29
args: -E=gofmt,deadcode,unused,varcheck,ineffassign,golint,misspell --timeout=30m0s
version: v1.43
args: -E=gofmt,deadcode,unused,varcheck,ineffassign,revive,misspell,exportloopref,asciicheck,bodyclose,contextcheck --timeout=30m0s
verify-helm:
name: Verify Helm
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM k8s.gcr.io/build-image/debian-base:bullseye-v1.0.0
FROM k8s.gcr.io/build-image/debian-base:bullseye-v1.1.0

# Architecture for bin folder
ARG ARCH
Expand All @@ -23,6 +23,6 @@ COPY bin/${ARCH}/nfsplugin /nfsplugin
RUN apt update && apt-mark unhold libcap2
RUN clean-install ca-certificates mount nfs-common netbase
# install updated packages to fix CVE issues
RUN clean-install libssl1.1 libgssapi-krb5-2 libk5crypto3 libkrb5-3 libkrb5support0 libgmp10
RUN clean-install libgmp10 bsdutils

ENTRYPOINT ["/nfsplugin"]
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ include release-tools/build.make

GIT_COMMIT = $(shell git rev-parse HEAD)
BUILD_DATE = $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
IMAGE_VERSION ?= v3.1.0
IMAGE_VERSION ?= v3.2.0
LDFLAGS = -X ${PKG}/pkg/nfs.driverVersion=${IMAGE_VERSION} -X ${PKG}/pkg/nfs.gitCommit=${GIT_COMMIT} -X ${PKG}/pkg/nfs.buildDate=${BUILD_DATE}
EXT_LDFLAGS = -s -w -extldflags "-static"
# Use a custom version for E2E tests if we are testing in CI
Expand All @@ -42,7 +42,7 @@ REGISTRY_NAME ?= $(shell echo $(REGISTRY) | sed "s/.azurecr.io//g")
IMAGE_TAG = $(REGISTRY)/$(IMAGENAME):$(IMAGE_VERSION)
IMAGE_TAG_LATEST = $(REGISTRY)/$(IMAGENAME):latest

E2E_HELM_OPTIONS ?= --set image.nfs.repository=$(REGISTRY)/$(IMAGENAME) --set image.nfs.tag=$(IMAGE_VERSION) --set image.nfs.pullPolicy=Always
E2E_HELM_OPTIONS ?= --set image.nfs.repository=$(REGISTRY)/$(IMAGENAME) --set image.nfs.tag=$(IMAGE_VERSION) --set image.nfs.pullPolicy=Always --set feature.enableInlineVolume=true
E2E_HELM_OPTIONS += ${EXTRA_HELM_OPTIONS}

# Output type of docker buildx build
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ This is a repository for [NFS](https://en.wikipedia.org/wiki/Network_File_System
### Container Images & Kubernetes Compatibility:
|driver version | supported k8s version | status |
|----------------|-----------------------|--------|
|master branch | 1.19+ | beta |
|master branch | 1.20+ | beta |
|v3.1.0 | 1.19+ | beta |
|v3.0.0 | 1.19+ | beta |
|v2.0.0 | 1.14+ | alpha |

Expand Down
16 changes: 9 additions & 7 deletions charts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,16 @@

### Tips
- make controller only run on master node: `--set controller.runOnMaster=true`
- set replica of controller as `1`: `--set controller.replicas=1`
- enable `fsGroupPolicy` on a k8s 1.20+ cluster (this feature is in beta, check details [here](../deploy/example/fsgroup)): `--set feature.enableFSGroupPolicy=true`
- set replica of controller as `2`: `--set controller.replicas=2`

### 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 v3.0.0
helm install csi-driver-nfs csi-driver-nfs/csi-driver-nfs --namespace kube-system --version v3.1.0
```

### install driver with customized driver name, deployment name
> only supported from `v3.0.0`+
> only supported from `v3.1.0`+
- following example would install a driver with name `nfs2`
```console
helm install csi-driver-nfs2 csi-driver-nfs/csi-driver-nfs --namespace kube-system --set driver.name="nfs2.csi.k8s.io" --set controller.name="csi-nfs2-controller" --set rbac.name=nfs2 --set serviceAccount.controller=csi-nfs2-controller-sa --set serviceAccount.node=csi-nfs2-node-sa --set node.name=csi-nfs2-node --set node.livenessProbe.healthPort=39653
Expand All @@ -39,12 +38,14 @@ The following table lists the configurable parameters of the latest NFS CSI Driv
|---------------------------------------------------|------------------------------------------------------------|-------------------------------------------------------------------|
| `driver.name` | alternative driver name | `nfs.csi.k8s.io` |
| `driver.mountPermissions` | mounted folder permissions name | `0777`
| `feature.enableFSGroupPolicy` | enable `fsGroupPolicy` on a k8s 1.20+ cluster | `false` |
| `feature.enableFSGroupPolicy` | enable `fsGroupPolicy` on a k8s 1.20+ cluster | `true` |
| `feature.enableInlineVolume` | enable inline volume | `false` |
| `kubeletDir` | alternative kubelet directory | `/var/lib/kubelet` |
| `image.nfs.repository` | csi-driver-nfs image | `mcr.microsoft.com/k8s/csi/nfs-csi` |
| `image.nfs.tag` | csi-driver-nfs image tag | `latest` |
| `image.nfs.pullPolicy` | csi-driver-nfs image pull policy | `IfNotPresent` |
| `image.csiProvisioner.repository` | csi-provisioner docker image | `k8s.gcr.io/sig-storage/csi-provisioner` |
| `image.csiProvisioner.tag` | csi-provisioner docker image tag | `v2.0.4` |
| `image.csiProvisioner.tag` | csi-provisioner docker image tag | `v3.1.0` |
| `image.csiProvisioner.pullPolicy` | csi-provisioner image pull policy | `IfNotPresent` |
| `image.livenessProbe.repository` | liveness-probe docker image | `k8s.gcr.io/sig-storage/livenessprobe` |
| `image.livenessProbe.tag` | liveness-probe docker image tag | `v2.5.0` |
Expand All @@ -55,9 +56,10 @@ The following table lists the configurable parameters of the latest NFS CSI Driv
| `imagePullSecrets` | Specify docker-registry secret names as an array | [] (does not add image pull secrets to deployed pods) |
| `serviceAccount.create` | whether create service account of csi-nfs-controller | `true` |
| `rbac.create` | whether create rbac of csi-nfs-controller | `true` |
| `controller.replicas` | the replicas of csi-nfs-controller | `2` |
| `controller.replicas` | replica number of csi-nfs-controller | `1` |
| `controller.runOnMaster` | run controller on master node | `false` |
| `controller.logLevel` | controller driver log level |`5` |
| `controller.workingMountDir` | working directory for provisioner to mount nfs shares temporarily | `/tmp` |
| `controller.tolerations` | controller pod tolerations | |
| `controller.resources.csiProvisioner.limits.memory` | csi-provisioner memory limits | 100Mi |
| `controller.resources.csiProvisioner.requests.cpu` | csi-provisioner cpu requests limits | 10m |
Expand Down
21 changes: 15 additions & 6 deletions charts/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,25 @@ entries:
csi-driver-nfs:
- apiVersion: v1
appVersion: latest
created: "2021-12-03T09:32:27.922454757Z"
created: "2022-01-16T02:03:42.985827759Z"
description: CSI NFS Driver for Kubernetes
digest: 12bfa47c9b4d8d70374af58c3ffcb17f063587ec374422290ddbaeba8be1e2d7
digest: 327a5a82966527f18eebfd36b66b45c467eda0046cc0ac87271123cc9b788fd1
name: csi-driver-nfs
urls:
- https://raw.githubusercontent.com/kubernetes-csi/csi-driver-nfs/master/charts/latest/csi-driver-nfs-v3.1.0.tgz
- https://raw.githubusercontent.com/kubernetes-csi/csi-driver-nfs/master/charts/latest/csi-driver-nfs-v3.2.0.tgz
version: v3.2.0
- apiVersion: v1
appVersion: v3.1.0
created: "2022-01-16T02:03:42.988838576Z"
description: CSI NFS Driver for Kubernetes
digest: be2757357ed0a4c5c689b1c06de8eaa75da43430f08f04c8fb42fd17fffb0959
name: csi-driver-nfs
urls:
- https://raw.githubusercontent.com/kubernetes-csi/csi-driver-nfs/master/charts/v3.1.0/csi-driver-nfs-v3.1.0.tgz
version: v3.1.0
- apiVersion: v1
appVersion: v3.0.0
created: "2021-12-03T09:32:27.923670465Z"
created: "2022-01-16T02:03:42.987551869Z"
description: CSI NFS Driver for Kubernetes
digest: c19a1780bbdf240ff4628666a5cf70fea9d44fc20966b63796550e83a45ef50a
name: csi-driver-nfs
Expand All @@ -21,11 +30,11 @@ entries:
version: v3.0.0
- apiVersion: v1
appVersion: v2.0.0
created: "2021-12-03T09:32:27.92288436Z"
created: "2022-01-16T02:03:42.986145361Z"
description: CSI NFS Driver for Kubernetes
digest: f537a133eaa965f1c053ffac130f82c9b2b624e1f8bd42937c9c48818464eaac
name: csi-driver-nfs
urls:
- 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
generated: "2021-12-03T09:32:27.921439951Z"
generated: "2022-01-16T02:03:42.985065955Z"
Binary file removed charts/latest/csi-driver-nfs-v3.1.0.tgz
Binary file not shown.
Binary file added charts/latest/csi-driver-nfs-v3.2.0.tgz
Binary file not shown.
2 changes: 1 addition & 1 deletion charts/latest/csi-driver-nfs/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ apiVersion: v1
appVersion: latest
description: CSI NFS Driver for Kubernetes
name: csi-driver-nfs
version: v3.1.0
version: v3.2.0
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ spec:
- "--endpoint=$(CSI_ENDPOINT)"
- "--drivername={{ .Values.driver.name }}"
- "--mount-permissions={{ .Values.driver.mountPermissions }}"
- "--working-mount-dir={{ .Values.controller.workingMountDir }}"
env:
- name: NODE_ID
valueFrom:
Expand All @@ -94,15 +95,15 @@ spec:
periodSeconds: 30
volumeMounts:
- name: pods-mount-dir
mountPath: /var/lib/kubelet/pods
mountPath: {{ .Values.kubeletDir }}/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
path: {{ .Values.kubeletDir }}/pods
type: Directory
- name: socket-dir
emptyDir: {}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ spec:
attachRequired: false
volumeLifecycleModes:
- Persistent
{{- if .Values.feature.enableInlineVolume}}
- Ephemeral
{{- end}}
{{- if .Values.feature.enableFSGroupPolicy}}
fsGroupPolicy: File
{{- end}}
10 changes: 5 additions & 5 deletions charts/latest/csi-driver-nfs/templates/csi-nfs-node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ spec:
- --kubelet-registration-path=$(DRIVER_REG_SOCK_PATH)
env:
- name: DRIVER_REG_SOCK_PATH
value: /var/lib/kubelet/plugins/csi-nfsplugin/csi.sock
value: {{ .Values.kubeletDir }}/plugins/csi-nfsplugin/csi.sock
- name: KUBE_NODE_NAME
valueFrom:
fieldRef:
Expand Down Expand Up @@ -109,19 +109,19 @@ spec:
- name: socket-dir
mountPath: /csi
- name: pods-mount-dir
mountPath: /var/lib/kubelet/pods
mountPath: {{ .Values.kubeletDir }}/pods
mountPropagation: "Bidirectional"
resources: {{- toYaml .Values.node.resources.nfs | nindent 12 }}
volumes:
- name: socket-dir
hostPath:
path: /var/lib/kubelet/plugins/csi-nfsplugin
path: {{ .Values.kubeletDir }}/plugins/csi-nfsplugin
type: DirectoryOrCreate
- name: pods-mount-dir
hostPath:
path: /var/lib/kubelet/pods
path: {{ .Values.kubeletDir }}/pods
type: Directory
- hostPath:
path: /var/lib/kubelet/plugins_registry
path: {{ .Values.kubeletDir }}/plugins_registry
type: Directory
name: registration-dir
12 changes: 8 additions & 4 deletions charts/latest/csi-driver-nfs/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ image:
pullPolicy: IfNotPresent
csiProvisioner:
repository: k8s.gcr.io/sig-storage/csi-provisioner
tag: v2.2.2
tag: v3.1.0
pullPolicy: IfNotPresent
livenessProbe:
repository: k8s.gcr.io/sig-storage/livenessprobe
Expand All @@ -26,18 +26,22 @@ rbac:

driver:
name: nfs.csi.k8s.io
mountPermissions: "0777"
mountPermissions: 0777

feature:
enableFSGroupPolicy: false
enableFSGroupPolicy: true
enableInlineVolume: false

kubeletDir: /var/lib/kubelet

controller:
name: csi-nfs-controller
replicas: 2
replicas: 1
runOnMaster: false
livenessProbe:
healthPort: 29652
logLevel: 5
workingMountDir: "/tmp"
tolerations:
- key: "node-role.kubernetes.io/master"
operator: "Exists"
Expand Down
Binary file added charts/v3.1.0/csi-driver-nfs-v3.1.0.tgz
Binary file not shown.
22 changes: 22 additions & 0 deletions charts/v3.1.0/csi-driver-nfs/.helmignore
Original file line number Diff line number Diff line change
@@ -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 changes: 5 additions & 0 deletions charts/v3.1.0/csi-driver-nfs/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v1
appVersion: v3.1.0
description: CSI NFS Driver for Kubernetes
name: csi-driver-nfs
version: v3.1.0
5 changes: 5 additions & 0 deletions charts/v3.1.0/csi-driver-nfs/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -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 changes: 16 additions & 0 deletions charts/v3.1.0/csi-driver-nfs/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -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 -}}
Loading