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 2, 2024
2 parents 406cec7 + c3ef62f commit 389e1aa
Show file tree
Hide file tree
Showing 176 changed files with 5,170 additions and 3,316 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@v5
with:
version: v1.54
args: -E=gofmt,unused,ineffassign,revive,misspell,exportloopref,asciicheck,bodyclose,contextcheck --timeout=30m0s
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
3 changes: 2 additions & 1 deletion charts/README.md
Original file line number Diff line number Diff line change
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
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 . }}
{{- 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.
25 changes: 19 additions & 6 deletions charts/v4.6.0/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/v4.6.0/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
1 change: 1 addition & 0 deletions charts/v4.6.0/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: registry.k8s.io/sig-storage/nfsplugin
tag: v4.6.0
Expand Down
9 changes: 3 additions & 6 deletions deploy/csi-nfs-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ spec:
args:
- --csi-address=/csi/csi.sock
- --probe-timeout=3s
- --health-port=29652
- --http-endpoint=localhost:29652
- --v=2
volumeMounts:
- name: socket-dir
Expand Down Expand Up @@ -111,15 +111,12 @@ spec:
fieldPath: spec.nodeName
- name: CSI_ENDPOINT
value: unix:///csi/csi.sock
ports:
- containerPort: 29652
name: healthz
protocol: TCP
livenessProbe:
failureThreshold: 5
httpGet:
host: localhost
path: /healthz
port: healthz
port: 29652
initialDelaySeconds: 30
timeoutSeconds: 10
periodSeconds: 30
Expand Down

0 comments on commit 389e1aa

Please sign in to comment.