set -ex
-./setup_vagrant.sh
./cleanup.sh
-../src/vagrant/kubeadm_ovsdpdk/deploy.sh
+../src/vagrant/kubeadm_basic/deploy.sh
../src/vagrant/kubeadm_multus/deploy.sh
../src/vagrant/kubeadm_virtlet/deploy.sh
+../src/vagrant/kubeadm_ovsdpdk/deploy.sh
"bridge": "br-dpdk",
"ipam": {
"type": "host-local",
- "subnet": "10.244.0.0/16",
+ "subnet": "10.244.0.0/24",
"rangeStart": "10.244.0.100",
"gateway": "10.244.0.1",
"dataDir": "/vagrant/container-ipam-state"
cd $DIR
vagrant up
+vagrant ssh master -c "/vagrant/examples/nginx-app.sh" || (vagrant destroy -f; exit 1)
vagrant destroy -f
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
spec:
containers:
- name: nginx
- image: nginx
+ image: nginx:1.13.6
ports:
- containerPort: 80
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
DIR="$(dirname `readlink -f $0`)"
cd $DIR
+vagrant destroy -f
vagrant up
+vagrant ssh master -c "/vagrant/examples/multus.sh" || (vagrant destroy -f; exit 1)
vagrant destroy -f
--- /dev/null
+apiVersion: v1
+kind: ReplicationController
+metadata:
+ name: busybox
+spec:
+ replicas: 2
+ template:
+ metadata:
+ labels:
+ app: busybox
+ spec:
+ containers:
+ - name: busybox
+ image: busybox:1.27.2
+ command:
+ - sleep
+ - "36000"
--- /dev/null
+#!/bin/bash
+#
+# Copyright (c) 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+set -ex
+
+#workaroud to fix dns pod issue
+times=0
+
+while [ $times -lt "3" ]
+do
+ kubectl get pods -n kube-system | grep kube-dns | grep -v Run | sed "s/ .*//" | \
+ xargs -I {} kubectl delete pod -n kube-system {}
+ sleep 20
+ times+=1
+done
+
+kubectl apply -f /vagrant/examples/busybox.yaml
+r="0"
+while [ $r -ne "2" ]
+do
+ r=$(kubectl get pods | grep Running | wc -l)
+ sleep 20
+done
+kubectl get pods --all-namespaces
+kubectl get pods | grep Run | sed "s/ .*//" | xargs -I {} kubectl exec -i {} ip a
+++ /dev/null
-apiVersion: v1
-kind: Service
-metadata:
- name: ubuntu
- labels:
- app: ubuntu
-spec:
- type: NodePort
- ports:
- - port: 80
- protocol: TCP
- name: http
- selector:
- app: ubuntu
----
-apiVersion: v1
-kind: ReplicationController
-metadata:
- name: ubuntu
-spec:
- replicas: 2
- template:
- metadata:
- labels:
- app: ubuntu
- spec:
- containers:
- - name: ubuntu
- image: openretriever/ubuntu1604-ping
- command: [ "/bin/bash", "-c", "sleep 30000" ]
- ports:
- - containerPort: 80
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/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
echo "export KUBECONFIG=$HOME/admin.conf" >> $HOME/.bash_profile
kubectl apply -f http://git.io/weave-kube-1.6
-kubectl apply -f http://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
kubectl apply -f /vagrant/multus/kube_cni_multus.yml
config.vm.hostname = "master"
config.vm.provision "shell", path: "master_setup.sh", privileged: false
config.vm.network :private_network, ip: "192.168.1.10"
+ config.vm.network :private_network, ip: "10.244.0.10"
end
(1 .. $num_workers).each do |i|
config.vm.hostname = vm_name
config.vm.provision "shell", path: "worker_setup.sh", privileged: false
config.vm.network :private_network, ip: "192.168.1.#{i+20}"
+ config.vm.network :private_network, ip: "10.244.0.#{i+20}"
end
end
DIR="$(dirname `readlink -f $0`)"
cd $DIR
+vagrant destroy -f
+rm -rf container-ipam-state
vagrant up
+vagrant ssh master -c "/vagrant/examples/virtio-user.sh" || (vagrant destroy -f; exit 1)
vagrant destroy -f
--- /dev/null
+#!/bin/bash
+#
+# Copyright (c) 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+set -ex
+
+kubectl delete rc --all
+kubectl apply -f /vagrant/examples/virtio-user.yaml
+r="0"
+while [ $r -ne "4" ]
+do
+ r=$(kubectl get pods --all-namespaces | grep ovsdpdk | grep Run | wc -l)
+ sleep 20
+done
+
+kubectl delete rc --all
+kubectl apply -f /vagrant/examples/virtio-user.yaml
+r="0"
+while [ $r -ne "2" ]
+do
+ r=$(kubectl get pods | grep Running | wc -l)
+ sleep 20
+done
+kubectl get pods --all-namespaces
+sleep 20
+ping -c4 10.244.0.103 || ping -c4 10.244.0.104
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=192.168.1.0/24 --pod-network-cidr=10.244.0.0/24 --token 8c5adc.1cec8dbf339093f0
sudo cp /etc/kubernetes/admin.conf $HOME/
sudo chown $(id -u):$(id -g) $HOME/admin.conf
export KUBECONFIG=$HOME/admin.conf
sudo sysctl -w vm.nr_hugepages=2048; sleep 1
done
sudo modprobe uio_pci_generic
-ip=$(ip a s enp0s9 | grep inet | grep -v inet6 | sed "s/.*inet//" | cut -f2 -d' ')
-sudo ip address flush enp0s9
-sudo /usr/share/dpdk/tools/dpdk_nic_bind.py --bind=uio_pci_generic enp0s9
+ip=$(ip a s eth2 | grep inet | grep -v inet6 | sed "s/.*inet//" | cut -f2 -d' ')
+sudo ip address flush eth2
+sudo /usr/share/dpdk/tools/dpdk_nic_bind.py --bind=uio_pci_generic eth2
sudo sysctl -w vm.nr_hugepages=1024
sudo mount -t hugetlbfs -o pagesize=2M none /dev/hugepages
sudo cp /usr/bin/ovs-vsctl /usr/local/bin
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
#!/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'
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