-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deploy Calico cni with k8s-1.17 (#256)
* Deploy Calico pod network plugin on k8s-1.17 Flannel has compatability issues with k8s-1.17 flannel-io/flannel#1245. deploy calico plugin instead also for better proformance. calico.yaml file is copied from Calico's documantation and no change should be done to it. Signed-off-by: Or Mergi <[email protected]> * CNI manifest file names and kubernetes versions map This map will corrolate between k8s version and the plugin we would like to deploy. Signed-off-by: Or Mergi <[email protected]> * Separate cni selection logic from provision scripts. cli.sh, create /tmp/scripts directory in the VM and copy cni-map.sh . cnis-map.sh map between k8s version and cni manifest file name to use. node01.sh provision.sh, use cnis-map.sh to resolve the right cni manifest to use. Signed-off-by: Or Mergi <[email protected]>
- Loading branch information
Showing
6 changed files
with
831 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
set -ex | ||
|
||
WITH_REGISTRY=false | ||
NODES=1 | ||
|
@@ -176,7 +176,6 @@ fi | |
DNSMASQ_CID=$(docker run -d ${PORTS} -e NUM_NODES=${NODES} --name ${PREFIX}dnsmasq --privileged ${BASE} /bin/bash -c /dnsmasq.sh) | ||
CONTAINERS=${DNSMASQ_CID} | ||
|
||
|
||
if [ "$COMMAND" == "provision" ] ; then | ||
VM_CID=$(docker run -d --privileged --net=container:${DNSMASQ_CID} --name ${PREFIX}node01 ${BASE} /bin/bash -c "/vm.sh ${MEMORY} ${CPU} ${QEMU_ARGS}") | ||
CONTAINERS="${CONTAINERS} ${VM_CID}" | ||
|
@@ -190,6 +189,8 @@ if [ "$COMMAND" == "provision" ] ; then | |
docker exec ${VM_CID} /bin/bash -c "scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i vagrant.key -P 22 /manifests/ceph/*.yaml [email protected]:/tmp/ceph" | ||
docker exec ${VM_CID} /bin/bash -c "ssh.sh mkdir -p /tmp/cna" | ||
docker exec ${VM_CID} /bin/bash -c "scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i vagrant.key -P 22 /manifests/cna/*.yaml [email protected]:/tmp/cna" | ||
docker exec ${VM_CID} /bin/bash -c "ssh.sh mkdir -p /tmp/scripts" | ||
docker exec ${VM_CID} /bin/bash -c "scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i vagrant.key -P 22 /scripts/cnis-map.sh [email protected]:/tmp/scripts/cnis-map.sh" | ||
docker exec ${VM_CID} /bin/bash -c "ssh.sh sudo version=${K8S_VERSION} /bin/bash -s ${CRIO} < /scripts/provision.sh" | ||
docker exec ${VM_CID} ssh.sh "sudo shutdown -h" | ||
docker exec ${VM_CID} /bin/bash -c "rm /usr/local/bin/ssh.sh" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
declare -A CNI_MANIFESTS | ||
CNI_MANIFESTS[1.17.0]="calico.yaml" | ||
CNI_MANIFESTS[1.16.2]="flannel-ge-16.yaml" | ||
CNI_MANIFESTS[1.15.1]="flannel-ge-16.yaml" | ||
CNI_MANIFESTS[1.14.6]="flannel-ge-16.yaml" | ||
CNI_MANIFESTS[1.13.3]="flannel-ge-12.yaml" | ||
CNI_MANIFESTS[1.12.0]="flannel-ge-12.yaml" | ||
CNI_MANIFESTS[1.11.0]="flannel.yaml" | ||
CNI_MANIFESTS[1.10.11]="flannel.yaml" | ||
export CNI_MANIFESTS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.