summaryrefslogtreecommitdiffstats
path: root/src/vagrant/kubeadm_basic
diff options
context:
space:
mode:
authorGuo Ruijing <ruijing.guo@intel.com>2017-11-16 12:23:16 -0500
committerGuo Ruijing <ruijing.guo@intel.com>2017-11-20 18:43:47 -0500
commit57c01199d342c5051fef2bb94f463f21749089bb (patch)
treec2e6c28b3bd1fed53b92038bf1286e82f4661606 /src/vagrant/kubeadm_basic
parentb2da960212571fc3e287eedcdc4c8c92fed9bf83 (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_basic')
-rwxr-xr-xsrc/vagrant/kubeadm_basic/deploy.sh1
-rwxr-xr-xsrc/vagrant/kubeadm_basic/examples/nginx-app.sh12
-rw-r--r--src/vagrant/kubeadm_basic/examples/nginx-app.yaml2
-rw-r--r--src/vagrant/kubeadm_basic/master_setup.sh2
4 files changed, 14 insertions, 3 deletions
diff --git a/src/vagrant/kubeadm_basic/deploy.sh b/src/vagrant/kubeadm_basic/deploy.sh
index f5b810e..4e12e91 100755
--- a/src/vagrant/kubeadm_basic/deploy.sh
+++ b/src/vagrant/kubeadm_basic/deploy.sh
@@ -5,4 +5,5 @@ DIR="$(dirname `readlink -f $0`)"
cd $DIR
vagrant up
+vagrant ssh master -c "/vagrant/examples/nginx-app.sh" || (vagrant destroy -f; exit 1)
vagrant destroy -f
diff --git a/src/vagrant/kubeadm_basic/examples/nginx-app.sh b/src/vagrant/kubeadm_basic/examples/nginx-app.sh
index bfd0613..07b9c22 100755
--- a/src/vagrant/kubeadm_basic/examples/nginx-app.sh
+++ b/src/vagrant/kubeadm_basic/examples/nginx-app.sh
@@ -5,6 +5,16 @@ kubectl get nodes
kubectl get services
kubectl get pods
kubectl get rc
-sleep 120
+
+r="0"
+while [ $r -ne "2" ]
+do
+ r=$(kubectl get pods | grep Running | wc -l)
+ sleep 20
+done
+
svcip=$(kubectl get services nginx -o json | grep clusterIP | cut -f4 -d'"')
wget http://$svcip
+kubectl delete rc --all
+kubectl delete services --all
+kubectl delete pod --all
diff --git a/src/vagrant/kubeadm_basic/examples/nginx-app.yaml b/src/vagrant/kubeadm_basic/examples/nginx-app.yaml
index f80881a..7bb5e9b 100644
--- a/src/vagrant/kubeadm_basic/examples/nginx-app.yaml
+++ b/src/vagrant/kubeadm_basic/examples/nginx-app.yaml
@@ -26,6 +26,6 @@ spec:
spec:
containers:
- name: nginx
- image: nginx
+ image: nginx:1.13.6
ports:
- containerPort: 80
diff --git a/src/vagrant/kubeadm_basic/master_setup.sh b/src/vagrant/kubeadm_basic/master_setup.sh
index 0e33177..1d204c2 100644
--- a/src/vagrant/kubeadm_basic/master_setup.sh
+++ b/src/vagrant/kubeadm_basic/master_setup.sh
@@ -2,7 +2,7 @@
set -ex
-sudo timeout 600 kubeadm init --apiserver-advertise-address=192.168.1.10 --service-cidr=192.168.1.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/16 --pod-network-cidr=10.32.0.0/12 --token 8c5adc.1cec8dbf339093f0
sudo cp /etc/kubernetes/admin.conf $HOME/
sudo chown $(id -u):$(id -g) $HOME/admin.conf
export KUBECONFIG=$HOME/admin.conf