summaryrefslogtreecommitdiffstats
path: root/src/vagrant/kubeadm_basic
diff options
context:
space:
mode:
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