Skip to content

Commit

Permalink
Deploy Calico pod network plugin on k8s-1.17
Browse files Browse the repository at this point in the history
Flannel has compatability issues with k8s-1.17 flannel-io/flannel#1245.
deploy calico plugin instead also for better proformance.

Signed-off-by: Or Mergi <[email protected]>
  • Loading branch information
Or Mergi committed Jan 29, 2020
1 parent 1c08a5c commit d5dd17a
Show file tree
Hide file tree
Showing 3 changed files with 804 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cluster-provision/k8s/provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ cd $DIR

source ../images.sh

../cli/cli provision --prefix k8s-${version}-provision --scripts ./scripts --k8s-version ${version} --base kubevirtci/${IMAGES[centos7]} --tag kubevirtci/k8s-${version}
../cli/cli provision --prefix k8s-${version}-provision --scripts ./scripts --k8s-version ${version} --base kubevirtci/${IMAGES[centos7]} --tag dockerneties/k8s-${version}
15 changes: 10 additions & 5 deletions cluster-provision/k8s/scripts/node01.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,21 @@ do
sleep 2
done

pod_cird="10.244.0.0/16"
kubeadm init --config /etc/kubernetes/kubeadm.conf

version=`kubectl version --short --client | cut -d":" -f2 |sed 's/ //g' | cut -c2- | cut -d"." -f2`
flannel_manifest="/tmp/flannel.yaml"
if [[ $version -ge "16" ]]; then
flannel_manifest="/tmp/flannel-ge-16.yaml"
network_plugin_manifest="/tmp/flannel.yaml"
if [[ $version -ge "17" ]]; then
network_plugin_manifest="/tmp/calico.yaml"
sed -i -e "s?192.168.0.0/16?$pod_cird?g" $network_plugin_manifest
elif [[ $version -ge "16" ]]; then
network_plugin_manifest="/tmp/flannel-ge-16.yaml"
elif [[ $version -ge "12" ]]; then
flannel_manifest="/tmp/flannel-ge-12.yaml"
network_plugin_manifest="/tmp/flannel-ge-12.yaml"
fi
kubectl --kubeconfig=/etc/kubernetes/admin.conf create -f "$flannel_manifest"

kubectl --kubeconfig=/etc/kubernetes/admin.conf create -f "$network_plugin_manifest"

kubectl --kubeconfig=/etc/kubernetes/admin.conf taint nodes node01 node-role.kubernetes.io/master:NoSchedule-

Expand Down
Loading

0 comments on commit d5dd17a

Please sign in to comment.