@@ -20,6 +20,7 @@ DEFAULT_CILIUM_VERSION_TAG=""
2020DEFAULT_IPV6_HP_BPF_VERSION=" "
2121DEFAULT_CNS_IMAGE_REPO=" MCR"
2222DEFAULT_AZCLI=" az"
23+ DEFAULT_KUBERNETES_VERSION=" 1.29"
2324
2425# Script configuration
2526SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) "
@@ -39,6 +40,7 @@ OPTIONS:
3940 -c, --cluster CLUSTER_NAME Name of the AKS cluster (default: ${DEFAULT_CLUSTER_NAME} )
4041 -s, --subscription SUB_ID Azure subscription ID (required)
4142 -z, --azcli AZCLI_COMMAND Azure CLI command (default: ${DEFAULT_AZCLI} )
43+ -k, --kubernetes-version VER Kubernetes version for the cluster (default: ${DEFAULT_KUBERNETES_VERSION} )
4244 -n, --networking-mode MODE Networking mode: overlay, swift, nodesubnet, dualstack-overlay, vnetscale-swift (default: ${DEFAULT_NETWORKING_MODE} )
4345 --no-kube-proxy Create cluster without kube-proxy (default: ${DEFAULT_NO_KUBE_PROXY} )
4446 --with-kube-proxy Create cluster with kube-proxy (overrides --no-kube-proxy)
@@ -300,7 +302,7 @@ create_cluster() {
300302 ;;
301303 esac
302304
303- local make_cmd=" AZCLI=${AZCLI} CLUSTER=${CLUSTER_NAME} SUB=${SUBSCRIPTION} make ${make_target} "
305+ local make_cmd=" AZCLI=${AZCLI} CLUSTER=${CLUSTER_NAME} SUB=${SUBSCRIPTION} K8S_VER= ${KUBERNETES_VERSION} make ${make_target} "
304306
305307 log " Using make target: ${make_target} "
306308 execute " cd '${SCRIPT_DIR} ' && ${make_cmd} "
@@ -472,6 +474,7 @@ CILIUM_VERSION_TAG="${DEFAULT_CILIUM_VERSION_TAG}"
472474IPV6_HP_BPF_VERSION=" ${DEFAULT_IPV6_HP_BPF_VERSION} "
473475CNS_IMAGE_REPO=" ${DEFAULT_CNS_IMAGE_REPO} "
474476AZCLI=" ${DEFAULT_AZCLI} "
477+ KUBERNETES_VERSION=" ${DEFAULT_KUBERNETES_VERSION} "
475478DRY_RUN=" false"
476479
477480while [[ $# -gt 0 ]]; do
@@ -488,6 +491,10 @@ while [[ $# -gt 0 ]]; do
488491 AZCLI=" $2 "
489492 shift 2
490493 ;;
494+ -k|--kubernetes-version)
495+ KUBERNETES_VERSION=" $2 "
496+ shift 2
497+ ;;
491498 -n|--networking-mode)
492499 NETWORKING_MODE=" $2 "
493500 shift 2
@@ -562,6 +569,7 @@ main() {
562569 log " Cluster Name: ${CLUSTER_NAME} "
563570 log " Subscription: ${SUBSCRIPTION} "
564571 log " Azure CLI: ${AZCLI} "
572+ log " Kubernetes Version: ${KUBERNETES_VERSION} "
565573 log " Networking Mode: ${NETWORKING_MODE} "
566574 log " No Kube-proxy: ${NO_KUBE_PROXY} "
567575 log " CNI Plugin: ${CNI_PLUGIN} "
0 commit comments