diff options
author | Guo Ruijing <ruijing.guo@intel.com> | 2017-11-16 12:23:16 -0500 |
---|---|---|
committer | Guo Ruijing <ruijing.guo@intel.com> | 2017-11-20 18:43:47 -0500 |
commit | 57c01199d342c5051fef2bb94f463f21749089bb (patch) | |
tree | c2e6c28b3bd1fed53b92038bf1286e82f4661606 /src/vagrant/kubeadm_virtlet | |
parent | b2da960212571fc3e287eedcdc4c8c92fed9bf83 (diff) |
add examples for container4nfv
1. add example for kubeadm with weave
2. add example for kubeadm with multus
3. add example for kubeadm with ovsdpdk
4. add example for kubeadm with virtlet
Change-Id: I138e71e45f0aba8389dca0e1a826f4662572af29
Signed-off-by: Guo Ruijing <ruijing.guo@intel.com>
Diffstat (limited to 'src/vagrant/kubeadm_virtlet')
-rwxr-xr-x | src/vagrant/kubeadm_virtlet/deploy.sh | 2 | ||||
-rwxr-xr-x | src/vagrant/kubeadm_virtlet/examples/virtlet.sh | 20 | ||||
-rw-r--r-- | src/vagrant/kubeadm_virtlet/master_setup.sh | 2 |
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 |