doc: update docs

This commit is contained in:
andyzhangx 2020-05-10 13:22:30 +00:00
parent 9a21b8bf54
commit d393b31137
8 changed files with 13 additions and 159 deletions

View File

@ -13,7 +13,6 @@ spec:
labels: labels:
app: csi-smb-node-win app: csi-smb-node-win
spec: spec:
serviceAccountName: csi-smb-node-sa
nodeSelector: nodeSelector:
kubernetes.io/os: windows kubernetes.io/os: windows
priorityClassName: system-node-critical priorityClassName: system-node-critical
@ -26,7 +25,7 @@ spec:
args: args:
- --csi-address=$(CSI_ENDPOINT) - --csi-address=$(CSI_ENDPOINT)
- --probe-timeout=3s - --probe-timeout=3s
- --health-port=29613 - --health-port=39613
- --v=5 - --v=5
env: env:
- name: CSI_ENDPOINT - name: CSI_ENDPOINT
@ -66,16 +65,16 @@ spec:
cpu: 10m cpu: 10m
memory: 20Mi memory: 20Mi
- name: smb - name: smb
image: mcr.microsoft.com/k8s/csi/smb-csi:latest image: andyzhangx/smb-csi:latest
args: args:
- --v=5 - --v=5
- --endpoint=$(CSI_ENDPOINT) - --endpoint=$(CSI_ENDPOINT)
- --nodeid=$(KUBE_NODE_NAME) - --nodeid=$(KUBE_NODE_NAME)
ports: ports:
- containerPort: 29613 - containerPort: 39613
name: healthz name: healthz
protocol: TCP protocol: TCP
- containerPort: 29615 - containerPort: 39615
name: metrics name: metrics
protocol: TCP protocol: TCP
livenessProbe: livenessProbe:
@ -87,8 +86,6 @@ spec:
timeoutSeconds: 10 timeoutSeconds: 10
periodSeconds: 30 periodSeconds: 30
env: env:
- name: AZURE_CREDENTIAL_FILE
value: "C:\\k\\azure.json"
- name: CSI_ENDPOINT - name: CSI_ENDPOINT
value: unix://C:\\csi\\csi.sock value: unix://C:\\csi\\csi.sock
- name: KUBE_NODE_NAME - name: KUBE_NODE_NAME
@ -103,8 +100,6 @@ spec:
mountPath: "C:\\var\\lib\\kubelet" mountPath: "C:\\var\\lib\\kubelet"
- name: plugin-dir - name: plugin-dir
mountPath: C:\csi mountPath: C:\csi
- name: azure-config
mountPath: C:\k
- name: csi-proxy-fs-pipe - name: csi-proxy-fs-pipe
mountPath: \\.\pipe\csi-proxy-filesystem-v1alpha1 mountPath: \\.\pipe\csi-proxy-filesystem-v1alpha1
- name: csi-proxy-smb-pipe - name: csi-proxy-smb-pipe
@ -137,7 +132,3 @@ spec:
hostPath: hostPath:
path: C:\var\lib\kubelet\plugins\smb.csi.k8s.io\ path: C:\var\lib\kubelet\plugins\smb.csi.k8s.io\
type: DirectoryOrCreate type: DirectoryOrCreate
- name: azure-config
hostPath:
path: C:\k
type: Directory

View File

@ -82,8 +82,6 @@ spec:
timeoutSeconds: 10 timeoutSeconds: 10
periodSeconds: 30 periodSeconds: 30
env: env:
- name: AZURE_CREDENTIAL_FILE
value: "/etc/kubernetes/azure.json"
- name: CSI_ENDPOINT - name: CSI_ENDPOINT
value: unix:///csi/csi.sock value: unix:///csi/csi.sock
- name: KUBE_NODE_NAME - name: KUBE_NODE_NAME
@ -99,13 +97,6 @@ spec:
- mountPath: /var/lib/kubelet/ - mountPath: /var/lib/kubelet/
mountPropagation: Bidirectional mountPropagation: Bidirectional
name: mountpoint-dir name: mountpoint-dir
- mountPath: /etc/kubernetes/
name: azure-cred
- mountPath: /var/lib/waagent/ManagedIdentity-Settings
readOnly: true
name: msi
- mountPath: /dev
name: device-dir
resources: resources:
limits: limits:
cpu: 1 cpu: 1
@ -126,15 +117,4 @@ spec:
path: /var/lib/kubelet/plugins_registry/ path: /var/lib/kubelet/plugins_registry/
type: DirectoryOrCreate type: DirectoryOrCreate
name: registration-dir name: registration-dir
- hostPath:
path: /etc/kubernetes/
type: Directory
name: azure-cred
- hostPath:
path: /var/lib/waagent/ManagedIdentity-Settings
name: msi
- hostPath:
path: /dev
type: Directory
name: device-dir
--- ---

View File

@ -10,7 +10,7 @@ $ git clone https://github.com/csi-driver/csi-driver-smb $GOPATH/src/github.com/
- Build CSI driver - Build CSI driver
``` ```
$ cd $GOPATH/src/github.com/csi-driver/csi-driver-smb $ cd $GOPATH/src/github.com/csi-driver/csi-driver-smb
$ make smb $ make
``` ```
- Run verification test before submitting code - Run verification test before submitting code
@ -34,65 +34,38 @@ $ make build
$ cd $GOPATH/src/github.com/csi-driver/csi-driver-smb $ cd $GOPATH/src/github.com/csi-driver/csi-driver-smb
$ ./_output/smbplugin --endpoint tcp://127.0.0.1:10000 --nodeid CSINode -v=5 & $ ./_output/smbplugin --endpoint tcp://127.0.0.1:10000 --nodeid CSINode -v=5 &
``` ```
> Before running CSI driver, create "/etc/kubernetes/azure.json" file under testing server(it's better copy `azure.json` file from a k8s cluster with service principle configured correctly) and set `AZURE_CREDENTIAL_FILE` as following:
```
export set AZURE_CREDENTIAL_FILE=/etc/kubernetes/azure.json
```
#### 1. Get plugin info #### 1. Get plugin info
``` ```
$ csc identity plugin-info --endpoint tcp://127.0.0.1:10000 $ csc identity plugin-info --endpoint tcp://127.0.0.1:10000
"smb.csi.k8s.io" "v0.4.0" "smb.csi.k8s.io" "v0.1.0"
``` ```
#### 2. Create an smb volume #### 2. Mount an smb volume to a user specified directory
```
$ csc controller new --endpoint tcp://127.0.0.1:10000 --cap 1,block CSIVolumeName --req-bytes 2147483648 --params skuname=Standard_LRS
CSIVolumeID 2147483648 "accountname"="f5713de20cde511e8ba4900" "skuname"="Standard_LRS"
```
#### 3. Mount an smb volume to a user specified directory
``` ```
$ mkdir ~/testmount $ mkdir ~/testmount
$ csc node publish --endpoint tcp://127.0.0.1:10000 --cap 1,block --target-path ~/testmount CSIVolumeID $ csc node publish --endpoint tcp://127.0.0.1:10000 --cap 1,block --target-path ~/testmount CSIVolumeID
#f5713de20cde511e8ba4900#pvc-file-dynamic-8ff5d05a-f47c-11e8-9c3a-000d3a00df41 #f5713de20cde511e8ba4900#pvc-file-dynamic-8ff5d05a-f47c-11e8-9c3a-000d3a00df41
``` ```
#### 4. Unmount smb volume #### 3. Unmount smb volume
``` ```
$ csc node unpublish --endpoint tcp://127.0.0.1:10000 --target-path ~/testmount CSIVolumeID $ csc node unpublish --endpoint tcp://127.0.0.1:10000 --target-path ~/testmount CSIVolumeID
CSIVolumeID CSIVolumeID
``` ```
#### 5. Delete smb volume #### 4. Validate volume capabilities
```
$ csc controller del --endpoint tcp://127.0.0.1:10000 CSIVolumeID
CSIVolumeID
```
#### 6. Validate volume capabilities
``` ```
$ csc controller validate-volume-capabilities --endpoint tcp://127.0.0.1:10000 --cap 1,block CSIVolumeID $ csc controller validate-volume-capabilities --endpoint tcp://127.0.0.1:10000 --cap 1,block CSIVolumeID
CSIVolumeID true CSIVolumeID true
``` ```
#### 7. Get NodeID #### 5. Get NodeID
``` ```
$ csc node get-info --endpoint tcp://127.0.0.1:10000 $ csc node get-info --endpoint tcp://127.0.0.1:10000
CSINode CSINode
``` ```
#### 8. Create snapshot
```
$ csc controller create-snapshot
```
#### 9. Delete snapshot
```
$ csc controller delete-snapshot
```
## How to test CSI driver in a Kubernetes cluster ## How to test CSI driver in a Kubernetes cluster
- Build continer image and push image to dockerhub - Build continer image and push image to dockerhub
@ -103,7 +76,7 @@ make container
make push-latest make push-latest
``` ```
- Replace `mcr.microsoft.com/k8s/csi/smb-csi:latest` in [`csi-smb-controller.yaml`](https://github.com/csi-driver/csi-driver-smb/blob/master/deploy/csi-smb-controller.yaml) and [`csi-smb-node.yaml`](https://github.com/csi-driver/csi-driver-smb/blob/master/deploy/csi-smb-node.yaml) with above dockerhub image urls and then follow [install CSI driver master version](https://github.com/csi-driver/csi-driver-smb/blob/master/docs/install-csi-driver-master.md) - Replace `andyzhangx/smb-csi:latest` in [`csi-smb-controller.yaml`](https://github.com/csi-driver/csi-driver-smb/blob/master/deploy/csi-smb-controller.yaml) and [`csi-smb-node.yaml`](https://github.com/csi-driver/csi-driver-smb/blob/master/deploy/csi-smb-node.yaml) with above dockerhub image urls and then follow [install CSI driver master version](https://github.com/csi-driver/csi-driver-smb/blob/master/docs/install-csi-driver-master.md)
``` ```
wget -O csi-smb-controller.yaml https://raw.githubusercontent.com/csi-driver/csi-driver-smb/master/deploy/csi-smb-controller.yaml wget -O csi-smb-controller.yaml https://raw.githubusercontent.com/csi-driver/csi-driver-smb/master/deploy/csi-smb-controller.yaml
# edit csi-smb-controller.yaml # edit csi-smb-controller.yaml

View File

@ -1,32 +0,0 @@
# Dependency management
cloud-provider-azure uses [go modules] for Go dependency management.
## Usage
Run [`hack/update-dependencies.sh`] whenever vendored dependencies change.
This takes a minute to complete.
### Updating dependencies
New dependencies causes golang to recompute the minor version used for each major version of each dependency. And
golang automatically removes dependencies that nothing imports any more.
To upgrade to the latest version for all direct and indirect dependencies of the current module:
* run `go get -u <package>` to use the latest minor or patch releases
* run `go get -u=patch <package>` to use the latest patch releases
* run `go get <package>@VERSION` to use the specified version
You can also manually editing `go.mod`.
Always run `hack/update-dependencies.sh` after changing `go.mod` by any of these methods (or adding new imports).
See golang's [go.mod], [Using Go Modules] and [Kubernetes Go modules] docs for more details.
[go.mod]: https://github.com/golang/go/wiki/Modules#gomod
[go modules]: https://github.com/golang/go/wiki/Modules
[`hack/update-dependencies.sh`]: hack/update-dependencies.sh
[Using Go Modules]: https://blog.golang.org/using-go-modules
[[Kubernetes Go modules]: https://github.com/kubernetes/enhancements/blob/master/keps/sig-architecture/2019-03-19-go-modules.md

View File

@ -1,24 +0,0 @@
# smb CSI driver design goals
> smb CSI driver is implemented as compatitable as possible with built-in [smb](https://kubernetes.io/docs/concepts/storage/volumes/#smb) plugin, it has following goals:
Goal | Status | Notes
--- | --- | --- |
Support Kubernetes release 1.12 or later | Completed| release prior to 1.12 won't be supported |
Support service principal and msi authentication | Completed | |
Support both Linux & Windows | In Progress | Windows related work is in progress: [Enable CSI hostpath example on windows](https://github.com/kubernetes-csi/drivers/issues/79) |
Compatible with original storage class parameters and usage| Completed | there is a little difference in static provision, see [example](../deploy/example/pv-smb-csi.yaml) |
Support sovereign cloud| done | verification pass on Azure China |
### Work items
Item | Status | Notes
--- | --- | --- |
Support volume size grow | to-do | |
Support snapshot | to-do | |
Enable CI on Windows | done | |
Complete all unit tests | Completed | |
Set up E2E test | to-do | |
Implement NodeStage/NodeUnstage functions | to-do | two pods on same node could share same mount |
Implement smb csi driver on Windows | to-do | |
### Implementation details
To prevent possible regression issues, smb CSI driver use [azure cloud provider](https://github.com/kubernetes/kubernetes/tree/v1.13.0/pkg/cloudprovider/providers/azure) library. Thus, all bug fixes in the built-in smb plugin would be incorporated into this driver.

View File

@ -15,7 +15,6 @@ example output:
``` ```
NAME READY STATUS RESTARTS AGE IP NODE NAME READY STATUS RESTARTS AGE IP NODE
csi-smb-controller-56bfddd689-dh5tk 6/6 Running 0 35s 10.240.0.19 k8s-agentpool-22533604-0
csi-smb-node-cvgbs 3/3 Running 0 7m4s 10.240.0.35 k8s-agentpool-22533604-1 csi-smb-node-cvgbs 3/3 Running 0 7m4s 10.240.0.35 k8s-agentpool-22533604-1
csi-smb-node-dr4s4 3/3 Running 0 7m4s 10.240.0.4 k8s-agentpool-22533604-0 csi-smb-node-dr4s4 3/3 Running 0 7m4s 10.240.0.4 k8s-agentpool-22533604-0
``` ```

View File

@ -1,6 +1,3 @@
## Install smb CSI driver on a Kubernetes cluster ## Install smb CSI driver on a Kubernetes cluster
- [install CSI driver master version](./install-csi-driver-master.md) - [install CSI driver master version](./install-csi-driver-master.md)
- [install v0.6.0 CSI driver](./install-csi-driver-v0.6.0.md)
- [install v0.5.0 CSI driver](./install-csi-driver-v0.5.0.md)
- [install v0.4.0 CSI driver](./install-csi-driver-v0.4.0.md)

View File

@ -1,30 +0,0 @@
# Read cloud config from Kubernetes secrets
- Available driver version: `v0.7.0` or above
This driver also supports [reading the cloud config from Kubernetes secrets](https://github.com/kubernetes-sigs/cloud-provider-azure/blob/master/docs/cloud-provider-config.md#setting-azure-cloud-provider-from-kubernetes-secrets). The secret is a serialized version of `azure.json` file with key cloud-config. The secret should be put in `kube-system` namespace and its name should be `azure-cloud-provider`.
### How to convert cloud config to a Kubernetes secret
1. create `azure.json` file and fill in all necessary fields, refer to [Cloud provider config](https://github.com/kubernetes-sigs/cloud-provider-azure/blob/master/docs/cloud-provider-config.md), and here is an [example](https://github.com/andyzhangx/demo/blob/master/aks-engine/deployment/etc/kubernetes/azure.json)
2. serialize `azure.json` by following command:
```console
cat azure.json | base64 | awk '{printf $0}'; echo
```
3. create a secret file(`azure-cloud-provider.yaml`) with following values and fill in `cloud-config` value produced in step#2
```yaml
apiVersion: v1
data:
cloud-config: [fill-in-here]
kind: Secret
metadata:
name: azure-cloud-provider
namespace: kube-system
type: Opaque
```
4. Create a `azure-cloud-provider` secret in k8s cluster
```console
kubectl create -f azure-cloud-provider.yaml
```