mayadata-io / oep-e2e

Plan tests and run them for OpenEBS Enterprise Platform
Apache License 2.0
6 stars 10 forks source link

Test & Demo scripts to showcase running of CStorPoolAuto !!! #109

Open AmitKumarDas opened 4 years ago

AmitKumarDas commented 4 years ago

Setup To Run Demo of CStorPoolAuto on GKE

----------------------
Step 0/
----------------------
git clone https://github.com/kubernetes-sigs/gcp-compute-persistent-disk-csi-driver.git
cd gcp-compute-persistent-disk-csi-driver/

# 0.6 was the stable as on Dec 2019
git checkout release-0.6

cd gcp-compute-persistent-disk-csi-driver/deploy
------------------------
Step 1/
------------------------
# fyi... Use your **own** GKE setup !!!
project name - K8s-Demo
project id - strong-eon-153112

GCE_PD_SA_DIR="./my-secret" GCE_PD_SA_NAME="amitd-dao" PROJECT="strong-eon-153112" ./setup-project.sh

# a sample successful output
created key [xxxxxxxxxxxxxxxxxxxxa6adaserfdf34342dsdsff1] of type [json] as [./my-secret/cloud-sa.json] for [amitd-dao@strong-eon-153112.iam.gserviceaccount.com]
-------------------
Step 2/
-------------------
kubectl version
  deploy > kubectl version

Client Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.1", GitCommit:"b7394102d6ef778017f2ca4046abbaa23b88c290", GitTreeState:"clean", BuildDate:"2019-04-08T17:11:31Z", GoVersion:"go1.12.1", Compiler:"gc", Platform:"linux/amd64"}

Server Version: version.Info{Major:"1", Minor:"13+", GitVersion:"v1.13.11-gke.14", GitCommit:"56d89863d1033f9668ddd6e1c1aea81cd846ef88", GitTreeState:"clean", BuildDate:"2019-11-07T19:12:22Z", GoVersion:"go1.12.11b4", Compiler:"gc", Platform:"linux/amd64"}
kubectl get nodes
kubectl get pods --all-namespaces
kubectl get sts --all-namespaces
kubectl get deploy --all-namespaces
--------------------------
Step 3/
--------------------------
GCE_PD_SA_DIR="./my-secret" GCE_PD_DRIVER_VERSION="stable" ./kubernetes/deploy-driver.sh

# sample successful output
+ kubectl apply -v=2 -f /tmp/gcp-compute-persistent-disk-csi-driver-specs-generated.yaml
serviceaccount/csi-controller-sa created
serviceaccount/csi-node-sa created
clusterrole.rbac.authorization.k8s.io/driver-registrar-role created
clusterrole.rbac.authorization.k8s.io/external-attacher-role created
clusterrole.rbac.authorization.k8s.io/external-provisioner-role created
clusterrole.rbac.authorization.k8s.io/external-snapshotter-role created
clusterrolebinding.rbac.authorization.k8s.io/csi-controller-attacher-binding created
clusterrolebinding.rbac.authorization.k8s.io/csi-controller-provisioner-binding created
clusterrolebinding.rbac.authorization.k8s.io/csi-controller-snapshotter-binding created
clusterrolebinding.rbac.authorization.k8s.io/driver-registrar-binding created
daemonset.apps/csi-gce-pd-node created
statefulset.apps/csi-gce-pd-controller created
  deploy > echo $?
0
----------------
Step 4/
----------------
 deploy > kubectl get pods --all-namespaces
NAMESPACE     NAME                                                    READY   STATUS      RESTARTS   AGE
default       csi-gce-pd-controller-0                                 0/3     Pending     0          99s
default       csi-gce-pd-node-kp4gp                                   2/2     Running     0          101s
default       csi-gce-pd-node-wwllq                                   0/2     Pending     0          101s
default       csi-gce-pd-node-zf4mw                                   2/2     Running     0          101s

 deploy > kubectl get sts --all-namespaces
NAMESPACE   NAME                    READY   AGE
default     csi-gce-pd-controller   0/1     2m17s

 deploy > kubectl get daemonset --all-namespaces
NAMESPACE     NAME                       DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR                                  AGE
default       csi-gce-pd-node            3         3         2       3            2           <none>                                         2m48s
-------------
Step 5/
----------------
kubectl create secret generic cloud-sa --from-file=./my-secret/cloud-sa.json

  cstorpoolauto > kubectl get secret
NAME                            TYPE                                  DATA   AGE
cloud-sa                        Opaque                                1      49s
csi-controller-sa-token-5nw8r   kubernetes.io/service-account-token   3      2d6h
csi-node-sa-token-t9q7d         kubernetes.io/service-account-token   3      2d6h
default-token-mc44p             kubernetes.io/service-account-token   3      8d
-------------
Step 6/
----------------
git clone https://github.com/mayadata-io/cstorpoolauto.git

# move to below folder
  basic > cd cstorpoolauto/demo/basic

  basic > ll
total 16
drwxr-xr-x 2 amit amit 4096 Dec 15 12:07 ./
drwxr-xr-x 3 amit amit 4096 Dec 15 08:09 ../
-rw-r--r-- 1 amit amit  268 Dec 15 08:09 basic.yaml
-rw-r--r-- 1 amit amit 2233 Dec 15 12:07 test.sh

 chmod 755 test.sh 

  basic > ll
total 16
drwxr-xr-x 2 amit amit 4096 Dec 15 12:07 ./
drwxr-xr-x 3 amit amit 4096 Dec 15 08:09 ../
-rw-r--r-- 1 amit amit  268 Dec 15 08:09 basic.yaml
-rwxr-xr-x 1 amit amit 2233 Dec 15 12:07 test.sh*

./test.sh