Skip to content

Commit

Permalink
fix: deployment script/doc issues
Browse files Browse the repository at this point in the history
fix test error
  • Loading branch information
andyzhangx committed Sep 13, 2020
1 parent 9bb484c commit 0a3e5b2
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 53 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ and working NFS server (e.g. https://github.com/rootfs/nfs-ganesha-docker)
#### Deploy

Deploy the NFS plugin along with the `CSIDriver` info.
```
kubectl -f deploy/kubernetes create
```console
kubectl create -f deploy/kubernetes
```

#### Example Nginx application
Expand All @@ -53,22 +53,22 @@ NFS server public end point and configuration. You can also provide additional
`mountOptions`, such as protocol version, in the `PersistentVolume` `spec`
relevant for your NFS Server.

```
kubectl -f examples/kubernetes/nginx.yaml create
```console
kubectl create -f examples/kubernetes/nginx.yaml
```

## Running Kubernetes End To End tests on an NFS Driver

First, stand up a local cluster `ALLOW_PRIVILEGED=1 hack/local-up-cluster.sh` (from your Kubernetes repo)
For Fedora/RHEL clusters, the following might be required:
```
```console
sudo chown -R $USER:$USER /var/run/kubernetes/
sudo chown -R $USER:$USER /var/lib/kubelet
sudo chcon -R -t svirt_sandbox_file_t /var/lib/kubelet
```
If you are plannig to test using your own private image, you could either install your nfs driver using your own set of YAML files, or edit the existing YAML files to use that private image.

When using the [existing set of YAML files](https://github.com/kubernetes-csi/csi-driver-nfs/tree/master/deploy/kubernetes), you would edit the [csi-attacher-nfsplugin.yaml](https://github.com/kubernetes-csi/csi-driver-nfs/blob/master/deploy/kubernetes/csi-attacher-nfsplugin.yaml#L46) and [csi-nodeplugin-nfsplugin.yaml](https://github.com/kubernetes-csi/csi-driver-nfs/blob/master/deploy/kubernetes/csi-nodeplugin-nfsplugin.yaml#L45) files to include your private image instead of the default one. After editing these files, skip to step 3 of the following steps.
When using the [existing set of YAML files](https://github.com/kubernetes-csi/csi-driver-nfs/tree/master/deploy/kubernetes), you would edit [csi-nfs-node.yaml](https://github.com/kubernetes-csi/csi-driver-nfs/blob/master/deploy/kubernetes/csi-nfs-node.yaml#L45) files to include your private image instead of the default one. After editing these files, skip to step 3 of the following steps.

If you already have a driver installed, skip to step 4 of the following steps.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@
kind: DaemonSet
apiVersion: apps/v1
metadata:
name: csi-nodeplugin-nfsplugin
name: csi-nfs-node
spec:
selector:
matchLabels:
app: csi-nodeplugin-nfsplugin
app: csi-nfs-node
template:
metadata:
labels:
app: csi-nodeplugin-nfsplugin
app: csi-nfs-node
spec:
serviceAccount: csi-nodeplugin
containers:
- name: node-driver-registrar
image: quay.io/k8scsi/csi-node-driver-registrar:v1.0.2
Expand Down
34 changes: 0 additions & 34 deletions deploy/kubernetes/csi-nodeplugin-rbac.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion examples/kubernetes/nginx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ metadata:
name: nginx
spec:
containers:
- image: maersk/nginx
- image: nginx
name: nginx
ports:
- containerPort: 80
Expand Down
11 changes: 3 additions & 8 deletions test/nfs-testdriver.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ limitations under the License.
package test

import (
"k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/kubernetes/test/e2e/framework"
"k8s.io/kubernetes/test/e2e/storage/testpatterns"
Expand Down Expand Up @@ -52,14 +52,9 @@ func initNFSDriver(name string, manifests ...string) testsuites.TestDriver {
}
}

// InitNFSDriver initialize NFS driver for test
func InitNFSDriver() testsuites.TestDriver {

return initNFSDriver("nfs.csi.k8s.io",
"csi-attacher-nfsplugin.yaml",
"csi-attacher-rbac.yaml",
"csi-nodeplugin-nfsplugin.yaml",
"csi-nodeplugin-rbac.yaml")

return initNFSDriver("nfs.csi.k8s.io", "csi-nfs-node.yaml")
}

var _ testsuites.TestDriver = &nfsDriver{}
Expand Down

0 comments on commit 0a3e5b2

Please sign in to comment.