move k8s command from jumphost to kubernetes-master 07/35607/1
authorGuo Ruijing <ruijing.guo@intel.com>
Wed, 31 May 2017 17:33:17 +0000 (10:33 -0700)
committerGuo Ruijing <ruijing.guo@intel.com>
Wed, 31 May 2017 17:37:19 +0000 (10:37 -0700)
Change-Id: I5e1a83cebf6f90beebc34798c8b2c9a96cce4afb
Signed-off-by: Guo Ruijing <ruijing.guo@intel.com>
ci/k8.sh

index 5e0f4a4..551c4a2 100755 (executable)
--- a/ci/k8.sh
+++ b/ci/k8.sh
@@ -2,24 +2,10 @@
 set -ex
 juju run-action kubernetes-worker/0 microbot replicas=3
 sleep 30
-mkdir -p ~/.kube || true
-juju scp kubernetes-master/0:config ~/.kube/config || true
-
-if [ ! -f /snap/kubectl/current/kubectl ]; then
-  sudo apt-get install snapd -y
-  sudo snap install kubectl --classic
-fi
-
-if [ ! -f ./kubectl ]; then
-  ln -s /snap/kubectl/current/kubectl ./kubectl
-fi
-
-./kubectl cluster-info || true
 juju config kubernetes-master enable-dashboard-addons=true || true
-#./kubectl proxy
-#http://localhost:8001/ui
-./kubectl get nodes || true
-#./kubectl create -f example.yaml || true
-./kubectl get pods --all-namespaces || true
-./kubectl get services,endpoints,ingress --all-namespaces || true
 juju expose kubernetes-worker || true
+
+juju ssh kubernetes-master/0 "/snap/bin/kubectl cluster-info"
+juju ssh kubernetes-master/0 "/snap/bin/kubectl get nodes"
+juju ssh kubernetes-master/0 "/snap/bin/kubectl get pods --all-namespaces"
+juju ssh kubernetes-master/0 "/snap/bin/kubectl get services,endpoints,ingress --all-namespaces"