From 61bae38c14f9869b0cb93147ab1ab857baedb32e Mon Sep 17 00:00:00 2001 From: "Eduardo' Vela\" Nava (sirdarckcat)" Date: Thu, 5 Jun 2025 15:19:04 +0200 Subject: [PATCH 1/2] nested virt --- dist/bin/kctf-cluster | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dist/bin/kctf-cluster b/dist/bin/kctf-cluster index f6510c3f..6ac45083 100755 --- a/dist/bin/kctf-cluster +++ b/dist/bin/kctf-cluster @@ -517,7 +517,7 @@ function kctf_cluster_start_gce { EXISTING_CLUSTER=$(gcloud container clusters list --filter "name=${CLUSTER_NAME}" --format 'get(name)') if [ -z "${EXISTING_CLUSTER}" ]; then CIDR="172.16.0.32/28" - gcloud container clusters create --release-channel=regular --enable-network-policy --enable-autoscaling --min-nodes ${MIN_NODES} --max-nodes ${MAX_NODES} --num-nodes ${NUM_NODES} --network ${NETWORK} --create-subnetwork name=kctf-subnet-${NETWORK} --no-enable-master-authorized-networks --enable-ip-alias --enable-private-nodes --master-ipv4-cidr ${CIDR} --enable-autorepair --preemptible --machine-type ${MACHINE_TYPE} --workload-pool=${PROJECT}.svc.id.goog ${CLUSTER_NAME} || return + gcloud container clusters create --release-channel=regular --enable-nested-virtualization --node-labels=nested-virtualization=enabled --enable-network-policy --enable-autoscaling --min-nodes ${MIN_NODES} --max-nodes ${MAX_NODES} --num-nodes ${NUM_NODES} --network ${NETWORK} --create-subnetwork name=kctf-subnet-${NETWORK} --no-enable-master-authorized-networks --enable-ip-alias --enable-private-nodes --master-ipv4-cidr ${CIDR} --enable-autorepair --preemptible --machine-type ${MACHINE_TYPE} --workload-pool=${PROJECT}.svc.id.goog ${CLUSTER_NAME} || return fi EXISTING_ROUTER=$(gcloud compute routers list --filter "name=kctf-${CLUSTER_NAME}-nat-router" --format 'get(name)') @@ -901,6 +901,8 @@ function kctf_cluster_resize { _kctf_log 'Creating the new node pool' gcloud container node-pools create "${NEW_POOL_NAME}" \ --cluster="${CLUSTER_NAME}" \ + --enable-nested-virtualization \ + --node-labels=nested-virtualization=enabled \ --machine-type="${MACHINE_TYPE}" \ ${SPOT:+--spot} \ --enable-autorepair \ From dabcc454ef3c7d7ad667be2b3d4b25d0e41f2dcf Mon Sep 17 00:00:00 2001 From: "Eduardo' Vela\" Nava (sirdarckcat)" Date: Thu, 5 Jun 2025 17:01:47 +0200 Subject: [PATCH 2/2] restrict to ubuntu --- dist/bin/kctf-cluster | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dist/bin/kctf-cluster b/dist/bin/kctf-cluster index 6ac45083..ec57e277 100755 --- a/dist/bin/kctf-cluster +++ b/dist/bin/kctf-cluster @@ -517,7 +517,7 @@ function kctf_cluster_start_gce { EXISTING_CLUSTER=$(gcloud container clusters list --filter "name=${CLUSTER_NAME}" --format 'get(name)') if [ -z "${EXISTING_CLUSTER}" ]; then CIDR="172.16.0.32/28" - gcloud container clusters create --release-channel=regular --enable-nested-virtualization --node-labels=nested-virtualization=enabled --enable-network-policy --enable-autoscaling --min-nodes ${MIN_NODES} --max-nodes ${MAX_NODES} --num-nodes ${NUM_NODES} --network ${NETWORK} --create-subnetwork name=kctf-subnet-${NETWORK} --no-enable-master-authorized-networks --enable-ip-alias --enable-private-nodes --master-ipv4-cidr ${CIDR} --enable-autorepair --preemptible --machine-type ${MACHINE_TYPE} --workload-pool=${PROJECT}.svc.id.goog ${CLUSTER_NAME} || return + gcloud container clusters create --release-channel=regular --image-type=UBUNTU_CONTAINERD --enable-nested-virtualization --node-labels=nested-virtualization=enabled --enable-network-policy --enable-autoscaling --min-nodes ${MIN_NODES} --max-nodes ${MAX_NODES} --num-nodes ${NUM_NODES} --network ${NETWORK} --create-subnetwork name=kctf-subnet-${NETWORK} --no-enable-master-authorized-networks --enable-ip-alias --enable-private-nodes --master-ipv4-cidr ${CIDR} --enable-autorepair --preemptible --machine-type ${MACHINE_TYPE} --workload-pool=${PROJECT}.svc.id.goog ${CLUSTER_NAME} || return fi EXISTING_ROUTER=$(gcloud compute routers list --filter "name=kctf-${CLUSTER_NAME}-nat-router" --format 'get(name)') @@ -901,6 +901,7 @@ function kctf_cluster_resize { _kctf_log 'Creating the new node pool' gcloud container node-pools create "${NEW_POOL_NAME}" \ --cluster="${CLUSTER_NAME}" \ + --image-type=UBUNTU_CONTAINERD \ --enable-nested-virtualization \ --node-labels=nested-virtualization=enabled \ --machine-type="${MACHINE_TYPE}" \