summaryrefslogtreecommitdiffstats
path: root/src/vagrant/kubeadm_virtlet
diff options
context:
space:
mode:
Diffstat (limited to 'src/vagrant/kubeadm_virtlet')
-rwxr-xr-xsrc/vagrant/kubeadm_virtlet/deploy.sh2
-rwxr-xr-xsrc/vagrant/kubeadm_virtlet/examples/virtlet.sh20
-rw-r--r--src/vagrant/kubeadm_virtlet/master_setup.sh2
3 files changed, 19 insertions, 5 deletions
diff --git a/src/vagrant/kubeadm_virtlet/deploy.sh b/src/vagrant/kubeadm_virtlet/deploy.sh
index f5b810e..758abb5 100755
--- a/src/vagrant/kubeadm_virtlet/deploy.sh
+++ b/src/vagrant/kubeadm_virtlet/deploy.sh
@@ -4,5 +4,7 @@ set -ex
DIR="$(dirname `readlink -f $0`)"
cd $DIR
+vagrant destroy -f
vagrant up
+vagrant ssh master -c "/vagrant/examples/virtlet.sh" || (vagrant destroy -f; exit 1)
vagrant destroy -f
diff --git a/src/vagrant/kubeadm_virtlet/examples/virtlet.sh b/src/vagrant/kubeadm_virtlet/examples/virtlet.sh
index 68d738d..70bb606 100755
--- a/src/vagrant/kubeadm_virtlet/examples/virtlet.sh
+++ b/src/vagrant/kubeadm_virtlet/examples/virtlet.sh
@@ -1,9 +1,21 @@
#!/bin/bash
+set -ex
+
kubectl label node worker1 extraRuntime=virtlet
kubectl label node worker2 extraRuntime=virtlet
-kubectl label node worker3 extraRuntime=virtlet
kubectl create configmap -n kube-system virtlet-config --from-literal=download_protocol=http --from-literal=image_regexp_translation=1 --from-literal=disable_kvm=y
-kubectl create configmap -n kube-system virtlet-image-translations --from-file images.yaml
-kubectl create -f virtlet-ds.yaml
-kubectl create -f cirros-vm.yaml
+kubectl create configmap -n kube-system virtlet-image-translations --from-file /vagrant/examples/images.yaml
+kubectl create -f /vagrant/examples/virtlet-ds.yaml
+
+kubectl delete pod --all
+kubectl create -f /vagrant/examples/cirros-vm.yaml
+r="0"
+while [ $r -ne "1" ]
+do
+ r=$(kubectl get pods | grep Running | wc -l)
+ sleep 20
+done
+sleep 60
+kubectl get pods -o json | grep podIP | cut -f4 -d'"' | xargs ping -c 4
+echo 'login by user:cirros & password:gocubsgo'
diff --git a/src/vagrant/kubeadm_virtlet/master_setup.sh b/src/vagrant/kubeadm_virtlet/master_setup.sh
index ba650ff..84185e0 100644
--- a/src/vagrant/kubeadm_virtlet/master_setup.sh
+++ b/src/vagrant/kubeadm_virtlet/master_setup.sh
@@ -2,7 +2,7 @@
set -ex
-sudo timeout 600 kubeadm init --apiserver-advertise-address=192.168.1.10 --service-cidr=10.96.0.0/24 --pod-network-cidr=10.244.0.0/16 --token 8c5adc.1cec8dbf339093f0
+sudo timeout 600 kubeadm init --apiserver-advertise-address=192.168.1.10 --service-cidr=10.96.0.0/24 --pod-network-cidr=10.32.0.0/16 --token 8c5adc.1cec8dbf339093f0
sudo cp /etc/kubernetes/admin.conf $HOME/
sudo chown $(id -u):$(id -g) $HOME/admin.conf
export KUBECONFIG=$HOME/admin.conf