Skip to content

Commit 5f31b62

Browse files
Add VM size parameter and clarify defaults in BYO CNI cluster script
Co-authored-by: tamilmani1989 <1103826+tamilmani1989@users.noreply.github.com>
1 parent cda52a1 commit 5f31b62

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

hack/aks/README-byocni.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ cd /path/to/azure-container-networking
3838
--cluster my-cluster \
3939
--subscription YOUR_SUBSCRIPTION_ID \
4040
--networking-mode swift \
41+
--vm-size Standard_D2s_v3 \
4142
--cni-plugin cilium \
4243
--cns-version v1.6.0 \
4344
--cilium-dir 1.16 \
@@ -54,13 +55,16 @@ cd /path/to/azure-container-networking
5455

5556
## Configuration Options
5657

58+
All parameters have sensible defaults as specified below. Only the `--subscription` parameter is required.
59+
5760
| Parameter | Description | Default |
5861
|-----------|-------------|---------|
5962
| `--cluster` | Name of the AKS cluster | `byocni-cluster` |
6063
| `--subscription` | Azure subscription ID | *Required* |
6164
| `--resource-group` | Resource group name | Same as cluster name |
6265
| `--azcli` | Azure CLI command | `az` |
6366
| `--kubernetes-version` | Kubernetes version for the cluster | `1.33` |
67+
| `--vm-size` | Azure VM size for cluster nodes | `Standard_B2s` |
6468
| `--networking-mode` | Networking mode (overlay, swift, nodesubnet, dualstack-overlay, vnetscale-swift) | `overlay` |
6569
| `--no-kube-proxy` | Create cluster without kube-proxy | `true` |
6670
| `--with-kube-proxy` | Create cluster with kube-proxy | Overrides --no-kube-proxy |

hack/aks/create-byocni-cluster.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ DEFAULT_IPV6_HP_BPF_VERSION=""
2222
DEFAULT_CNS_IMAGE_REPO="MCR"
2323
DEFAULT_AZCLI="az"
2424
DEFAULT_KUBERNETES_VERSION="1.33"
25+
DEFAULT_VM_SIZE="Standard_B2s"
2526

2627
# Script configuration
2728
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
@@ -43,6 +44,7 @@ OPTIONS:
4344
-g, --resource-group GROUP Resource group name (default: same as cluster name)
4445
-z, --azcli AZCLI_COMMAND Azure CLI command (default: ${DEFAULT_AZCLI})
4546
-k, --kubernetes-version VER Kubernetes version for the cluster (default: ${DEFAULT_KUBERNETES_VERSION})
47+
-v, --vm-size VM_SIZE Azure VM size for cluster nodes (default: ${DEFAULT_VM_SIZE})
4648
-n, --networking-mode MODE Networking mode: overlay, swift, nodesubnet, dualstack-overlay, vnetscale-swift (default: ${DEFAULT_NETWORKING_MODE})
4749
--no-kube-proxy Create cluster without kube-proxy (default: ${DEFAULT_NO_KUBE_PROXY})
4850
--with-kube-proxy Create cluster with kube-proxy (overrides --no-kube-proxy)
@@ -325,7 +327,7 @@ create_cluster() {
325327
fi
326328

327329
# Build make command with optional GROUP parameter
328-
local make_cmd="AZCLI=${AZCLI} CLUSTER=${CLUSTER_NAME} SUB=${SUBSCRIPTION} K8S_VER=${KUBERNETES_VERSION} LTS=${lts_setting}"
330+
local make_cmd="AZCLI=${AZCLI} CLUSTER=${CLUSTER_NAME} SUB=${SUBSCRIPTION} K8S_VER=${KUBERNETES_VERSION} VM_SIZE=${VM_SIZE} LTS=${lts_setting}"
329331
if [[ -n "${RESOURCE_GROUP}" ]]; then
330332
make_cmd="${make_cmd} GROUP=${RESOURCE_GROUP}"
331333
fi
@@ -503,6 +505,7 @@ IPV6_HP_BPF_VERSION="${DEFAULT_IPV6_HP_BPF_VERSION}"
503505
CNS_IMAGE_REPO="${DEFAULT_CNS_IMAGE_REPO}"
504506
AZCLI="${DEFAULT_AZCLI}"
505507
KUBERNETES_VERSION="${DEFAULT_KUBERNETES_VERSION}"
508+
VM_SIZE="${DEFAULT_VM_SIZE}"
506509
DRY_RUN="false"
507510

508511
while [[ $# -gt 0 ]]; do
@@ -527,6 +530,10 @@ while [[ $# -gt 0 ]]; do
527530
KUBERNETES_VERSION="$2"
528531
shift 2
529532
;;
533+
-v|--vm-size)
534+
VM_SIZE="$2"
535+
shift 2
536+
;;
530537
-n|--networking-mode)
531538
NETWORKING_MODE="$2"
532539
shift 2
@@ -603,6 +610,7 @@ main() {
603610
log " Resource Group: ${RESOURCE_GROUP:-${CLUSTER_NAME}}"
604611
log " Azure CLI: ${AZCLI}"
605612
log " Kubernetes Version: ${KUBERNETES_VERSION}"
613+
log " VM Size: ${VM_SIZE}"
606614
log " Networking Mode: ${NETWORKING_MODE}"
607615
log " No Kube-proxy: ${NO_KUBE_PROXY}"
608616
log " CNI Plugin: ${CNI_PLUGIN}"

0 commit comments

Comments
 (0)