Skip to content

Commit

Permalink
sriov provider.sh, move kind config changes to kind/common.sh
Browse files Browse the repository at this point in the history
Make use of 'kind_up'

Signed-off-by: Or Mergi <[email protected]>

Conflicts:
	cluster-up/cluster/kind/common.sh
  • Loading branch information
ormergi committed Nov 17, 2020
1 parent 0416277 commit 8727fb4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
16 changes: 3 additions & 13 deletions cluster-up/cluster/kind-k8s-sriov-1.17.0/provider.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,8 @@ function up() {
docker run --rm --cap-add=SYS_RAWIO quay.io/phoracek/lspci@sha256:0f3cacf7098202ef284308c64e3fc0ba441871a846022bb87d65ff130c79adb1 sh -c "lspci | egrep -i 'network|ethernet'"

cp $KIND_MANIFESTS_DIR/kind.yaml ${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/kind.yaml
_fetch_kind
prepare_workers
# adding mounts to control plane, need them for sriov
cat >> ${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/kind.yaml << EOF
extraMounts:
- containerPath: /lib/modules
hostPath: /lib/modules
readOnly: true
- containerPath: /dev/vfio/
hostPath: /dev/vfio/
EOF

setup_kind

kind_up

${KUBEVIRTCI_PATH}/cluster/$KUBEVIRT_PROVIDER/config_sriov.sh
}
14 changes: 14 additions & 0 deletions cluster-up/cluster/kind/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,19 @@ function setup_kind() {
prepare_config
}

function _add_worker_extra_mounts() {
if [[ "$KUBEVIRT_PROVIDER" =~ sriov.* ]]; then
cat <<EOF >> ${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/kind.yaml
extraMounts:
- containerPath: /lib/modules
hostPath: /lib/modules
readOnly: true
- containerPath: /dev/vfio/
hostPath: /dev/vfio/
EOF
fi
}

function _add_worker_kubeadm_config_patch() {
cat << EOF >> ${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/kind.yaml
kubeadmConfigPatches:
Expand All @@ -213,6 +226,7 @@ function _add_workers() {
- role: worker
EOF
_add_worker_kubeadm_config_patch
_add_worker_extra_mounts
done
}

Expand Down

0 comments on commit 8727fb4

Please sign in to comment.