Skip to content

Commit

Permalink
libvirt/kcli_cluster.sh: add support to CRI-O
Browse files Browse the repository at this point in the history
By exporting the CONTAINER_RUNTIME=crio variable, kcli will create
a k8s cluster configured CRI-O:

$ export CONTAINER_RUNTIME=crio
$ ./src/cloud-api-adaptor/libvirt/kcli_cluster.sh create

Fixes confidential-containers#1981
Signed-off-by: Wainer dos Santos Moschetta <[email protected]>
  • Loading branch information
wainersm committed Nov 27, 2024
1 parent ec5051d commit a9f7e19
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/cloud-api-adaptor/libvirt/kcli_cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ CLUSTER_NAME="${CLUSTER_NAME:-peer-pods}"
CLUSTER_IMAGE="${CLUSTER_IMAGE:-ubuntu2204}"
CLUSTER_VERSION="${CLUSTER_VERSION:-1.30.0}"
CLUSTER_WORKERS="${CLUSTER_WORKERS:-1}"
CONTAINER_RUNTIME="${CONTAINER_RUNTIME:-containerd}" # Either "containerd" or "crio"
LIBVIRT_NETWORK="${LIBVIRT_NETWORK:-default}"
LIBVIRT_POOL="${LIBVIRT_POOL:-default}"

Expand Down Expand Up @@ -44,16 +45,22 @@ wait_for_process() {
# Create the cluster.
#
create () {
local sdn="flannel"
# Networking services don't work fine with the flannel and crio combination
# See https://github.com/karmab/kcli/issues/744
[ "$CONTAINER_RUNTIME" = "crio" ] && sdn="cilium"

parameters="-P domain=kata.com \
-P pool=$LIBVIRT_POOL \
-P ctlplanes=$CLUSTER_CONTROL_NODES \
-P workers=$CLUSTER_WORKERS \
-P network=$LIBVIRT_NETWORK \
-P image=$CLUSTER_IMAGE \
-P sdn=flannel \
-P sdn=$sdn \
-P nfs=false \
-P disk_size=$CLUSTER_DISK_SIZE \
-P version=$CLUSTER_VERSION"
-P version=$CLUSTER_VERSION \
-P engine=$CONTAINER_RUNTIME"
# The autolabeller and multus images do not support s390x arch yet
# disable them for s390x cluster
if [[ ${TARGET_ARCH} == "s390x" ]]; then
Expand Down Expand Up @@ -120,7 +127,8 @@ usage () {
CLUSTER_VERSION (default "${CLUSTER_VERSION}")
LIBVIRT_NETWORK (default "${LIBVIRT_NETWORK}")
LIBVIRT_POOL (default "${LIBVIRT_POOL}")
CLUSTER_WORKERS (default "${CLUSTER_WORKERS}").
CLUSTER_WORKERS (default "${CLUSTER_WORKERS}")
CONTAINER_RUNTIME (default "${CONTAINER_RUNTIME}")
delete Delete the cluster. Specify the cluster name with
CLUSTER_NAME (default "${CLUSTER_NAME}").
EOF
Expand Down

0 comments on commit a9f7e19

Please sign in to comment.