Skip to content

Commit

Permalink
WIP flannel
Browse files Browse the repository at this point in the history
Signed-off-by: Or Shoval <[email protected]>
  • Loading branch information
oshoval committed Mar 6, 2023
1 parent 241347a commit 5ab5de3
Show file tree
Hide file tree
Showing 4 changed files with 219 additions and 3,765 deletions.
13 changes: 5 additions & 8 deletions cluster-up/cluster/k3d-1.25-sriov/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,8 @@ replace this file `cluster-up/cluster/$KUBEVIRT_PROVIDER/sriov-components/manife
and update the kustomization file `cluster-up/cluster/$KUBEVIRT_PROVIDER/sriov-components/manifests/multus/kustomization.yaml`
according needs.

### Bumping calico
1. Fetch new calico yaml (https://docs.tigera.io/calico/3.25/getting-started/kubernetes/k3s/quickstart)
Enable `allow_ip_forwarding` (See https://k3d.io/v5.4.7/usage/advanced/calico)
Or use the one that is suggested here https://k3d.io/v5.4.7/usage/advanced/calico whenever it is updated.
2. Prefix the images in the yaml with `quay.io/` unless they have it already.
3. Update `cluster-up/cluster/k3d/manifests/calico.yaml` (see `CALICO` at `cluster-up/cluster/k3d/common.sh` for more info)

Note: Make sure to follow the latest verions on the links above.
### Bumping flannel
1. Fetch a newer yaml (https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml)
2. Update `"Network"` to `"10.42.0.0/16"` (contains the PodCIDR `10.42.0.0/24`)
2. TODO - mirror images to quay
3. Replace the manifest at `cluster-up/cluster/k3d/manifests`
7 changes: 5 additions & 2 deletions cluster-up/cluster/k3d/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ function _label_agents() {
done
}

function _deploy_cni() {
_kubectl apply -f cluster-up/cluster/k3d/manifests/kube-flannel.yml
}

function _create_cluser() {
echo "STEP: Create cluster"

Expand All @@ -131,7 +135,6 @@ function _create_cluser() {
k3d registry create --default-network $NETWORK $REGISTRY_NAME --port $REGISTRY_HOST:$HOST_PORT
${CRI_BIN} rename k3d-$REGISTRY_NAME $REGISTRY_NAME

CALICO=$(pwd)/cluster-up/cluster/k3d/manifests/calico.yaml
k3d cluster create $CLUSTER_NAME --registry-use $REGISTRY_NAME \
--api-port $KUBERNETES_SERVICE_HOST:$KUBERNETES_SERVICE_PORT \
--servers=$KUBEVIRT_NUM_SERVERS \
Expand All @@ -142,7 +145,6 @@ function _create_cluser() {
--k3s-arg "--kubelet-arg=cpu-manager-policy=static@agent:*" \
--k3s-arg "--kubelet-arg=kube-reserved=cpu=500m@agent:*" \
--k3s-arg "--kubelet-arg=system-reserved=cpu=500m@agent:*" \
-v "$CALICO:/var/lib/rancher/k3s/server/manifests/calico.yaml@server:0" \
-v /dev/vfio:/dev/vfio@agent:* \
-v /lib/modules:/lib/modules@agent:* \
-v ${id1}:/etc/machine-id@server:0 \
Expand All @@ -155,6 +157,7 @@ function k3d_up() {
_create_cluser
_extract_kubeconfig
_download_kubectl
_deploy_cni
_prepare_nodes
_install_cni_plugins
_prepare_provider_config
Expand Down
Loading

0 comments on commit 5ab5de3

Please sign in to comment.