Skip to content

Commit

Permalink
Merge pull request #1 from kubernetes-csi/master
Browse files Browse the repository at this point in the history
Syncing from original
  • Loading branch information
lizhuqi authored Feb 5, 2021
2 parents 2723461 + f95da24 commit e1c1cbe
Show file tree
Hide file tree
Showing 47 changed files with 994 additions and 290 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,3 @@ cscope.*

/bazel-*
*.pyc

# helm packaged chart
/charts/*/*.tgz
7 changes: 0 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,3 @@ endif
.PHONY: create-metrics-svc
create-metrics-svc:
kubectl create -f deploy/example/metrics/csi-smb-controller-svc.yaml

.PHONY: create-example-deployment
create-example-deployment:
kubectl apply -f deploy/example/storageclass-smb.yaml
kubectl apply -f deploy/example/pvc-smb.yaml
kubectl apply -f deploy/example/deployment.yaml
kubectl apply -f deploy/example/statefulset.yaml
31 changes: 13 additions & 18 deletions charts/README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,33 @@
# Installation with Helm 3

Quick start instructions for the setup and configuration of SMB CSI driver using Helm.
# Install CSI driver with Helm 3

## Prerequisites

- [install Helm](https://helm.sh/docs/intro/quickstart/#install-helm)

## Install latest CSI Driver via `helm install`

## install latest version
```console
$ cd $GOPATH/src/github.com/kubernetes-csi/csi-driver-smb/charts/latest
$ helm package csi-driver-smb
$ helm install csi-driver-smb csi-driver-smb-latest.tgz --namespace kube-system
helm repo add csi-driver-smb https://raw.githubusercontent.com/kubernetes-csi/csi-driver-smb/master/charts
helm install csi-driver-smb csi-driver-smb/csi-driver-smb --namespace kube-system
```

### Install a specific version of Helm chart
Specify the version of the chart to be installed using the `--version` parameter.
### install a specific version
```console
helm repo add csi-driver-smb https://raw.githubusercontent.com/kubernetes-csi/csi-driver-smb/master/charts
helm install csi-driver-smb csi-driver-smb/csi-driver-smb --namespace kube-system --version v0.6.0
```

### Search for different versions of charts available
### search for all available chart versions
```console
$ helm search repo -l csi-driver-smb/
helm search repo -l csi-driver-smb
```

## Uninstall
## uninstall CSI driver
```console
$ helm uninstall csi-driver-smb -n kube-system
helm uninstall csi-driver-smb -n kube-system
```

## Latest Helm Chart Configuration
## latest chart configuration

The following table lists the configurable parameters of the latest SMB CSI Driver chart and their default values.
The following table lists the configurable parameters of the latest SMB CSI Driver chart and default values.

| Parameter | Description | Default |
|---------------------------------------------------|------------------------------------------------------------|-------------------------------------------------------------------|
Expand Down Expand Up @@ -65,6 +60,6 @@ The following table lists the configurable parameters of the latest SMB CSI Driv
| `kubelet.linuxPath` | configure the kubelet path for Linux node | `/var/lib/kubelet` |
| `kubelet.windowsPath` | configure the kubelet path for Windows node | `'C:\var\lib\kubelet'` |

## Troubleshooting
## troubleshooting
- Add `--wait -v=5 --debug` in `helm install` command to get detailed error
- Use `kubectl describe` to acquire more info
13 changes: 2 additions & 11 deletions charts/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,6 @@ entries:
digest: 37e0c76fc46f83c066abc7a97992fe2141efde01219aec4c6e16c4dfecb6557e
name: csi-driver-smb
urls:
- https://raw.githubusercontent.com/kubernetes-csi/csi-driver-smb/master/charts/latest/csi-driver-smb-latest.tgz
version: latest
- apiVersion: v1
appVersion: latest
created: "2020-12-29T03:21:48.067879158Z"
description: SMB CSI Driver for Kubernetes
digest: 37e0c76fc46f83c066abc7a97992fe2141efde01219aec4c6e16c4dfecb6557e
name: csi-driver-smb
urls:
- https://raw.githubusercontent.com/kubernetes-csi/csi-driver-smb/master/charts/v0.6.0/csi-driver-smb-latest.tgz
version: latest
- https://raw.githubusercontent.com/kubernetes-csi/csi-driver-smb/master/charts/latest/csi-driver-smb-v0.7.0.tgz
version: v0.7.0
generated: "2020-12-29T03:21:48.064727433Z"
Binary file added charts/latest/csi-driver-smb-v0.7.0.tgz
Binary file not shown.
2 changes: 1 addition & 1 deletion charts/latest/csi-driver-smb/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ apiVersion: v1
appVersion: latest
description: SMB CSI Driver for Kubernetes
name: csi-driver-smb
version: latest
version: v0.7.0
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ spec:
- name: csi-provisioner
image: "{{ .Values.image.csiProvisioner.repository }}:{{ .Values.image.csiProvisioner.tag }}"
args:
- "-v=5"
- "-v=2"
- "--csi-address=$(ADDRESS)"
- "--leader-election"
env:
Expand All @@ -52,7 +52,7 @@ spec:
- --csi-address=/csi/csi.sock
- --probe-timeout=3s
- --health-port=29642
- --v=5
- --v=2
imagePullPolicy: {{ .Values.image.livenessProbe.pullPolicy }}
volumeMounts:
- name: socket-dir
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
- --csi-address=$(CSI_ENDPOINT)
- --probe-timeout=3s
- --health-port=29643
- --v=5
- --v=2
env:
- name: CSI_ENDPOINT
value: unix://C:\\csi\\csi.sock
Expand All @@ -43,7 +43,7 @@ spec:
- name: node-driver-registrar
image: "{{ .Values.windows.image.nodeDriverRegistrar.repository }}:{{ .Values.windows.image.nodeDriverRegistrar.tag }}"
args:
- --v=5
- --v=2
- --csi-address=$(CSI_ENDPOINT)
- --kubelet-registration-path={{ .Values.kubelet.windowsPath }}\\plugins\\smb.csi.k8s.io\\csi.sock
env:
Expand Down Expand Up @@ -97,8 +97,6 @@ spec:
fieldRef:
apiVersion: v1
fieldPath: spec.nodeName
securityContext:
privileged: true
volumeMounts:
- name: kubelet-dir
mountPath: {{ .Values.kubelet.windowsPath }}\
Expand Down
4 changes: 2 additions & 2 deletions charts/latest/csi-driver-smb/templates/csi-smb-node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ spec:
- --csi-address=/csi/csi.sock
- --probe-timeout=3s
- --health-port=29643
- --v=5
- --v=2
imagePullPolicy: {{ .Values.image.livenessProbe.pullPolicy }}
resources:
limits:
Expand All @@ -46,7 +46,7 @@ spec:
args:
- --csi-address=$(ADDRESS)
- --kubelet-registration-path=$(DRIVER_REG_SOCK_PATH)
- --v=5
- --v=2
lifecycle:
preStop:
exec:
Expand Down
4 changes: 2 additions & 2 deletions charts/latest/csi-driver-smb/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ image:
pullPolicy: IfNotPresent
livenessProbe:
repository: k8s.gcr.io/sig-storage/livenessprobe
tag: v2.1.0
tag: v2.2.0
pullPolicy: IfNotPresent
nodeDriverRegistrar:
repository: k8s.gcr.io/sig-storage/csi-node-driver-registrar
Expand Down Expand Up @@ -37,7 +37,7 @@ windows:
image:
livenessProbe:
repository: mcr.microsoft.com/oss/kubernetes-csi/livenessprobe
tag: v2.0.1-alpha.1-windows-1809-amd64
tag: v2.2.0
pullPolicy: IfNotPresent
nodeDriverRegistrar:
repository: mcr.microsoft.com/oss/kubernetes-csi/csi-node-driver-registrar
Expand Down
Binary file modified charts/v0.2.0/csi-driver-smb-v0.2.0.tgz
Binary file not shown.
Binary file modified charts/v0.6.0/csi-driver-smb-v0.6.0.tgz
Binary file not shown.
6 changes: 3 additions & 3 deletions deploy/csi-smb-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ spec:
- name: csi-provisioner
image: k8s.gcr.io/sig-storage/csi-provisioner:v2.0.4
args:
- "-v=5"
- "-v=2"
- "--csi-address=$(ADDRESS)"
- "--leader-election"
env:
Expand All @@ -44,12 +44,12 @@ spec:
cpu: 10m
memory: 20Mi
- name: liveness-probe
image: k8s.gcr.io/sig-storage/livenessprobe:v2.1.0
image: k8s.gcr.io/sig-storage/livenessprobe:v2.2.0
args:
- --csi-address=/csi/csi.sock
- --probe-timeout=3s
- --health-port=29642
- --v=5
- --v=2
volumeMounts:
- name: socket-dir
mountPath: /csi
Expand Down
6 changes: 3 additions & 3 deletions deploy/csi-smb-node-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ spec:
volumeMounts:
- mountPath: C:\csi
name: plugin-dir
image: mcr.microsoft.com/oss/kubernetes-csi/livenessprobe:v2.0.1-alpha.1-windows-1809-amd64
image: mcr.microsoft.com/oss/kubernetes-csi/livenessprobe:v2.2.0
args:
- --csi-address=$(CSI_ENDPOINT)
- --probe-timeout=3s
- --health-port=29643
- --v=5
- --v=2
env:
- name: CSI_ENDPOINT
value: unix://C:\\csi\\csi.sock
Expand All @@ -40,7 +40,7 @@ spec:
- name: node-driver-registrar
image: mcr.microsoft.com/oss/kubernetes-csi/csi-node-driver-registrar:v2.0.1
args:
- --v=5
- --v=2
- --csi-address=$(CSI_ENDPOINT)
- --kubelet-registration-path=C:\\var\\lib\\kubelet\\plugins\\smb.csi.k8s.io\\csi.sock
env:
Expand Down
6 changes: 3 additions & 3 deletions deploy/csi-smb-node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ spec:
volumeMounts:
- mountPath: /csi
name: socket-dir
image: k8s.gcr.io/sig-storage/livenessprobe:v2.1.0
image: k8s.gcr.io/sig-storage/livenessprobe:v2.2.0
args:
- --csi-address=/csi/csi.sock
- --probe-timeout=3s
- --health-port=29643
- --v=5
- --v=2
resources:
limits:
cpu: 100m
Expand All @@ -43,7 +43,7 @@ spec:
args:
- --csi-address=$(ADDRESS)
- --kubelet-registration-path=$(DRIVER_REG_SOCK_PATH)
- --v=5
- --v=2
lifecycle:
preStop:
exec:
Expand Down
6 changes: 3 additions & 3 deletions deploy/example/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ spec:
"kubernetes.io/os": linux
containers:
- name: deployment-smb
image: mcr.microsoft.com/oss/nginx/nginx:1.17.3-alpine
image: mcr.microsoft.com/oss/nginx/nginx:1.19.5
command:
- "/bin/sh"
- "/bin/bash"
- "-c"
- while true; do echo $(date) >> /mnt/smb/outfile; sleep 1; done
- set -euo pipefail; while true; do echo $(date) >> /mnt/smb/outfile; sleep 1; done
volumeMounts:
- name: smb
mountPath: "/mnt/smb"
Expand Down
46 changes: 46 additions & 0 deletions deploy/example/statefulset-nonroot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: statefulset-smb-nonroot
labels:
app: nginx
spec:
serviceName: statefulset-smb-nonroot
replicas: 1
template:
metadata:
labels:
app: nginx
spec:
securityContext: # optional just to make sure user is non-root
runAsUser: 10001
runAsGroup: 10001
fsGroup: 10001
nodeSelector:
"kubernetes.io/os": linux
containers:
- name: statefulset-smb
image: mcr.microsoft.com/oss/nginx/nginx:1.19.5
command:
- "/bin/bash"
- "-c"
- set -euo pipefail; while true; do echo $(date) >> /mnt/smb/outfile; sleep 1; done
volumeMounts:
- name: persistent-storage
mountPath: /mnt/smb
updateStrategy:
type: RollingUpdate
selector:
matchLabels:
app: nginx
volumeClaimTemplates:
- metadata:
name: persistent-storage
annotations:
volume.beta.kubernetes.io/storage-class: smb
spec:
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 10Gi
10 changes: 4 additions & 6 deletions deploy/example/windows/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# CSI on Windows example
# CSI Driver on Windows

## Feature Status: Alpha
CSI on Windows support is an alpha feature since Kubernetes v1.18, refer to [Windows-CSI-Support](https://github.com/kubernetes/enhancements/blob/master/keps/sig-windows/20190714-windows-csi-support.md) for more details.
## Feature Status: Beta
Refer to [Windows-CSI-Support](https://github.com/kubernetes/enhancements/tree/master/keps/sig-windows/1122-windows-csi-support) for more details.

## Prerequisite
- Install CSI-Proxy on Windows Node

[csi-proxy installation](https://github.com/Azure/aks-engine/blob/master/docs/topics/csi-proxy-windows.md) is supported with [aks-engine v0.48.0](https://github.com/Azure/aks-engine/releases/tag/v0.48.0).
- [Install CSI-Proxy on Windows Node](https://github.com/Azure/aks-engine/blob/master/docs/topics/csi-proxy-windows.md)

## Deploy a Windows pod with PVC mount
### Create a Windows deployment
Expand Down
6 changes: 0 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,6 @@ replace (
github.com/go-critic/go-critic => github.com/go-critic/go-critic v0.3.5-0.20190526074819-1df300866540
github.com/go-kit/kit => github.com/go-kit/kit v0.8.0
github.com/go-lintpack/lintpack => github.com/go-lintpack/lintpack v0.5.2
github.com/go-logfmt/logfmt => github.com/go-logfmt/logfmt v0.3.0
github.com/go-logr/logr => github.com/go-logr/logr v0.1.0
github.com/go-ole/go-ole => github.com/go-ole/go-ole v1.2.1
github.com/go-openapi/analysis => github.com/go-openapi/analysis v0.19.5
github.com/go-openapi/errors => github.com/go-openapi/errors v0.19.2
Expand Down Expand Up @@ -163,7 +161,6 @@ replace (
github.com/godbus/dbus/v5 => github.com/godbus/dbus/v5 v5.0.3
github.com/gogo/protobuf => github.com/gogo/protobuf v1.3.1
github.com/golang/freetype => github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0
github.com/golang/glog => github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
github.com/golang/groupcache => github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903
github.com/golang/mock => github.com/golang/mock v1.3.1
github.com/golang/protobuf => github.com/golang/protobuf v1.3.5
Expand Down Expand Up @@ -231,7 +228,6 @@ replace (
github.com/klauspost/compress => github.com/klauspost/compress v1.4.1
github.com/klauspost/cpuid => github.com/klauspost/cpuid v1.2.0
github.com/konsorten/go-windows-terminal-sequences => github.com/konsorten/go-windows-terminal-sequences v1.0.1
github.com/kr/logfmt => github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515
github.com/kr/pretty => github.com/kr/pretty v0.1.0
github.com/kr/pty => github.com/kr/pty v1.1.5
github.com/kr/text => github.com/kr/text v0.1.0
Expand Down Expand Up @@ -412,8 +408,6 @@ replace (
k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.20.0
k8s.io/gengo => k8s.io/gengo v0.0.0-20200114144118-36b2048a9120
k8s.io/heapster => k8s.io/heapster v1.2.0-beta.1
k8s.io/klog => k8s.io/klog v1.0.0
k8s.io/klog/v2 => k8s.io/klog/v2 v2.0.0
k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.20.0
k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.20.0
k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd
Expand Down
5 changes: 5 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,11 @@ github.com/go-critic/go-critic v0.3.5-0.20190526074819-1df300866540/go.mod h1:+s
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-lintpack/lintpack v0.5.2/go.mod h1:NwZuYi2nUHho8XEIZ6SIxihrnPoqBTDqfpXvXAN0sXM=
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
github.com/go-logr/logr v0.1.0 h1:M1Tv3VzNlEHg6uyACnRdtrploV2P7wZqH8BoQMtz0cg=
github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas=
github.com/go-logr/logr v0.2.0 h1:QvGt2nLcHH0WK9orKa+ppBPAxREcH364nPUedEpK0TY=
github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU=
github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8=
github.com/go-openapi/analysis v0.19.5/go.mod h1:hkEAkxagaIvIP7VTn8ygJNkd4kAYON2rCu0v0ObL0AU=
github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94=
Expand Down Expand Up @@ -547,6 +550,8 @@ k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8=
k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I=
k8s.io/klog/v2 v2.0.0 h1:Foj74zO6RbjjP4hBEKjnYtjjAhGg4jNynUdYF6fJrok=
k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE=
k8s.io/klog/v2 v2.4.0 h1:7+X0fUguPyrKEC4WjH8iGDg3laWgMo5tMnRTIGTTxGQ=
k8s.io/klog/v2 v2.4.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y=
k8s.io/kube-aggregator v0.20.0/go.mod h1:3Is/gzzWmhhG/rA3CpA1+eVye87lreBQDFGcAGT7gzo=
k8s.io/kube-controller-manager v0.20.0/go.mod h1:Pmli7dnwIVpwKJVeab97yBt35QEFdw65oqT5ti0ikUs=
k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd h1:sOHNzJIkytDF6qadMNKhhDRpc6ODik8lVC6nOur7B2c=
Expand Down
Loading

0 comments on commit e1c1cbe

Please sign in to comment.