From 84cdf54079f3913b1a9af21c4e1cf75c252b04db Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Fri, 31 Mar 2017 17:25:11 +0000 Subject: [PATCH 1/3] Build VMs with Kubernetes 1.6.1 and CNI 0.5.1 --- DEPENDENCIES | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPENDENCIES b/DEPENDENCIES index c7fa49ee..c93ed026 100644 --- a/DEPENDENCIES +++ b/DEPENDENCIES @@ -1,3 +1,3 @@ DOCKER_VERSION=1.11.2 -KUBERNETES_VERSION=1.5.2 -KUBERNETES_CNI_VERSION=0.3.0.1 \ No newline at end of file +KUBERNETES_VERSION=1.6.1 +KUBERNETES_CNI_VERSION=0.5.1 \ No newline at end of file From fc78bf4d11e587ecccc7f0cb2c2b0be62a35d149 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Wed, 15 Mar 2017 11:22:57 +0000 Subject: [PATCH 2/3] Update test script to work with kubeadm 1.6 --- test/840_weave_kube_3_test.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/test/840_weave_kube_3_test.sh b/test/840_weave_kube_3_test.sh index 179fe570..49922556 100755 --- a/test/840_weave_kube_3_test.sh +++ b/test/840_weave_kube_3_test.sh @@ -16,10 +16,12 @@ howmany() { echo $#; } start_suite "Test weave-kube image with Kubernetes" -TOKEN=112233.445566778899000 +TOKEN=112233.4455667788990000 HOST1IP=$($SSH $HOST1 "getent hosts $HOST1 | cut -f 1 -d ' '") NUM_HOSTS=$(howmany $HOSTS) SUCCESS="$(( $NUM_HOSTS * ($NUM_HOSTS-1) )) established" +KUBECTL="sudo kubectl --kubeconfig /etc/kubernetes/admin.conf" +KUBE_PORT=6443 tear_down_kubeadm @@ -35,13 +37,14 @@ for host in $HOSTS; do if [ $host = $HOST1 ] ; then run_on $host "sudo systemctl start kubelet && sudo kubeadm init --$k8s_version_option=$k8s_version --token=$TOKEN" else - run_on $host "sudo systemctl start kubelet && sudo kubeadm join --token=$TOKEN $HOST1IP" + run_on $host "sudo systemctl start kubelet && sudo kubeadm join --token=$TOKEN $HOST1IP:$KUBE_PORT" fi done [ -n "$COVERAGE" ] && COVERAGE_ARGS="\\n env:\\n - name: EXTRA_ARGS\\n value: \"-test.coverprofile=/home/weave/cover.prof --\"" -sed -e "s%imagePullPolicy: Always%imagePullPolicy: Never$COVERAGE_ARGS%" "$(dirname "$0")/../prog/weave-kube/weave-daemonset.yaml" | run_on $HOST1 "kubectl apply -f -" +sed -e "s%imagePullPolicy: Always%imagePullPolicy: Never$COVERAGE_ARGS%" "$(dirname "$0")/../prog/weave-kube/weave-daemonset-k8s-1.6.yaml" \ + | run_on $HOST1 "$KUBECTL apply -f -" sleep 5 @@ -73,11 +76,11 @@ assert "run_on $HOST2 ps aux | grep -c '[d]efunct'" "0" assert "run_on $HOST3 ps aux | grep -c '[d]efunct'" "0" # See if we can get some pods running that connect to the network -run_on $HOST1 "kubectl run hello --image=weaveworks/hello-world --replicas=3" +run_on $HOST1 "$KUBECTL run hello --image=weaveworks/hello-world --replicas=3" wait_for_pods() { for i in $(seq 1 45); do - if run_on $HOST1 "kubectl get pods | grep 'hello.*Running'" ; then + if run_on $HOST1 "$KUBECTL get pods | grep 'hello.*Running'" ; then return fi echo "Waiting for pods" From 74a7bef4721fbe2eacfe3b1153dc558e8fffe76a Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Tue, 4 Apr 2017 13:29:14 +0000 Subject: [PATCH 3/3] Use 'kubeadm reset' instead of replicating it --- test/840_weave_kube_3_test.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/test/840_weave_kube_3_test.sh b/test/840_weave_kube_3_test.sh index 49922556..29c3815b 100755 --- a/test/840_weave_kube_3_test.sh +++ b/test/840_weave_kube_3_test.sh @@ -4,11 +4,7 @@ tear_down_kubeadm() { for host in $HOSTS; do - # If we don't stop kubelet, it will restart all the containers we're trying to kill - run_on $host "sudo systemctl stop kubelet" - rm_containers $host $(docker_on $host ps -aq) - run_on $host "test ! -d /var/lib/kubelet || sudo find /var/lib/kubelet -execdir findmnt -n -t tmpfs -o TARGET -T {} \; | uniq | xargs -r sudo umount" - run_on $host "sudo rm -r -f /etc/kubernetes /var/lib/kubelet /var/lib/etcd /etc/cni /opt/cni/bin/*weave*" + run_on $host "sudo kubeadm reset && sudo rm -r -f /opt/cni/bin/*weave*" done }