Merge pull request #82 from jiaxunsongucb/add_install_instructions
doc: add install instructions
This commit is contained in:
commit
934c450968
@ -21,6 +21,9 @@ preexisting NFS server, whether it is deployed on cluster or provisioned
|
||||
independently. The plugin itself provides only a communication layer between
|
||||
resources in the cluser and the NFS server.
|
||||
|
||||
## Install NFS CSI driver on a kubernetes cluster
|
||||
Please refer to [install NFS CSI driver](https://github.com/kubernetes-csi/csi-driver-nfs/blob/master/docs/install-csi-driver.md).
|
||||
|
||||
## Example
|
||||
|
||||
There are multiple ways to create a kubernetes cluster, the NFS CSI plugin
|
||||
|
||||
41
deploy/kubernetes/install-driver.sh
Executable file
41
deploy/kubernetes/install-driver.sh
Executable file
@ -0,0 +1,41 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright 2020 The Kubernetes Authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
ver="master"
|
||||
if [[ "$#" -gt 0 ]]; then
|
||||
ver="$1"
|
||||
fi
|
||||
|
||||
repo="https://raw.githubusercontent.com/kubernetes-csi/csi-driver-nfs/$ver/deploy/kubernetes"
|
||||
if [[ "$#" -gt 1 ]]; then
|
||||
if [[ "$2" == *"local"* ]]; then
|
||||
echo "use local deploy"
|
||||
repo="./deploy/kubernetes"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $ver != "master" ]; then
|
||||
repo="$repo/$ver"
|
||||
fi
|
||||
|
||||
echo "Installing NFS CSI driver, version: $ver ..."
|
||||
kubectl apply -f $repo/rbac-csi-nfs-controller.yaml
|
||||
kubectl apply -f $repo/csi-nfs-driverinfo.yaml
|
||||
kubectl apply -f $repo/csi-nfs-controller.yaml
|
||||
kubectl apply -f $repo/csi-nfs-node.yaml
|
||||
echo 'NFS CSI driver installed successfully.'
|
||||
41
deploy/kubernetes/uninstall-driver.sh
Executable file
41
deploy/kubernetes/uninstall-driver.sh
Executable file
@ -0,0 +1,41 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright 2020 The Kubernetes Authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
ver="master"
|
||||
if [[ "$#" -gt 0 ]]; then
|
||||
ver="$1"
|
||||
fi
|
||||
|
||||
repo="https://raw.githubusercontent.com/kubernetes-csi/csi-driver-nfs/$ver/deploy/kubernetes"
|
||||
if [[ "$#" -gt 1 ]]; then
|
||||
if [[ "$2" == *"local"* ]]; then
|
||||
echo "use local deploy"
|
||||
repo="./deploy/kubernetes"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $ver != "master" ]; then
|
||||
repo="$repo/$ver"
|
||||
fi
|
||||
|
||||
echo "Uninstalling NFS driver, version: $ver ..."
|
||||
kubectl delete -f $repo/csi-nfs-controller.yaml --ignore-not-found
|
||||
kubectl delete -f $repo/csi-nfs-node.yaml --ignore-not-found
|
||||
kubectl delete -f $repo/csi-nfs-driverinfo.yaml --ignore-not-found
|
||||
kubectl delete -f $repo/rbac-csi-nfs-controller.yaml --ignore-not-found
|
||||
echo 'Uninstalled NFS driver successfully.'
|
||||
37
docs/install-csi-driver.md
Normal file
37
docs/install-csi-driver.md
Normal file
@ -0,0 +1,37 @@
|
||||
# Install NFS CSI driver master version on a kubernetes cluster
|
||||
|
||||
If you have already installed Helm, you can also use it to install NFS CSI driver. Please see [Installation with Helm](../charts/README.md).
|
||||
|
||||
## Install with kubectl
|
||||
- remote install
|
||||
```console
|
||||
curl -skSL https://raw.githubusercontent.com/kubernetes-csi/csi-driver-nfs/master/deploy/kubernetes/install-driver.sh | bash -s master --
|
||||
```
|
||||
|
||||
- local install
|
||||
```console
|
||||
git clone https://github.com/kubernetes-csi/csi-driver-nfs.git
|
||||
cd csi-driver-nfs
|
||||
./deploy/kubernetes/install-driver.sh master local
|
||||
```
|
||||
|
||||
- check pods status:
|
||||
```console
|
||||
kubectl -n kube-system get pod -o wide -l app=csi-nfs-controller
|
||||
kubectl -n kube-system get pod -o wide -l app=csi-nfs-node
|
||||
```
|
||||
|
||||
example output:
|
||||
|
||||
```console
|
||||
NAME READY STATUS RESTARTS AGE IP NODE
|
||||
csi-nfs-controller-56bfddd689-dh5tk 4/4 Running 0 35s 10.240.0.19 k8s-agentpool-22533604-0
|
||||
csi-nfs-controller-56bfddd689-8pgr4 4/4 Running 0 35s 10.240.0.35 k8s-agentpool-22533604-1
|
||||
csi-nfs-node-cvgbs 3/3 Running 0 35s 10.240.0.35 k8s-agentpool-22533604-1
|
||||
csi-nfs-node-dr4s4 3/3 Running 0 35s 10.240.0.4 k8s-agentpool-22533604-0
|
||||
```
|
||||
|
||||
- clean up NFS CSI driver
|
||||
```console
|
||||
curl -skSL https://raw.githubusercontent.com/kubernetes-csi/csi-driver-nfs/master/deploy/kubernetes/uninstall-driver.sh | bash -s master --
|
||||
```
|
||||
Loading…
x
Reference in New Issue
Block a user