Skip to content

Commit 5e5e43f

Browse files
Copilotvipul-21
andcommitted
Update BYO CNI script: K8s 1.33 default, Cilium 1.17 default, LTS logic, directory requirements
Co-authored-by: vipul-21 <[email protected]>
1 parent b333e25 commit 5e5e43f

File tree

2 files changed

+51
-19
lines changed

2 files changed

+51
-19
lines changed

hack/aks/README-byocni.md

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,20 @@ Before running the script, ensure you have:
2121
### Basic Usage
2222

2323
Create a cluster with default settings (overlay networking with Cilium):
24+
25+
**Note**: The script must be run from the root directory of the azure-container-networking repository.
26+
2427
```bash
25-
./create-byocni-cluster.sh --subscription YOUR_SUBSCRIPTION_ID
28+
cd /path/to/azure-container-networking
29+
./hack/aks/create-byocni-cluster.sh --subscription YOUR_SUBSCRIPTION_ID
2630
```
2731

2832
### Advanced Usage
2933

3034
Create a cluster with custom configuration:
3135
```bash
32-
./create-byocni-cluster.sh \
36+
cd /path/to/azure-container-networking
37+
./hack/aks/create-byocni-cluster.sh \
3338
--cluster my-cluster \
3439
--subscription YOUR_SUBSCRIPTION_ID \
3540
--networking-mode swift \
@@ -43,7 +48,8 @@ Create a cluster with custom configuration:
4348

4449
Preview the commands that would be executed without actually running them:
4550
```bash
46-
./create-byocni-cluster.sh --subscription YOUR_SUBSCRIPTION_ID --dry-run
51+
cd /path/to/azure-container-networking
52+
./hack/aks/create-byocni-cluster.sh --subscription YOUR_SUBSCRIPTION_ID --dry-run
4753
```
4854

4955
## Configuration Options
@@ -53,14 +59,14 @@ Preview the commands that would be executed without actually running them:
5359
| `--cluster` | Name of the AKS cluster | `byocni-cluster` |
5460
| `--subscription` | Azure subscription ID | *Required* |
5561
| `--azcli` | Azure CLI command | `az` |
56-
| `--kubernetes-version` | Kubernetes version for the cluster | `1.29` |
62+
| `--kubernetes-version` | Kubernetes version for the cluster | `1.33` |
5763
| `--networking-mode` | Networking mode (overlay, swift, nodesubnet, dualstack-overlay, vnetscale-swift) | `overlay` |
5864
| `--no-kube-proxy` | Create cluster without kube-proxy | `true` |
5965
| `--with-kube-proxy` | Create cluster with kube-proxy | Overrides --no-kube-proxy |
6066
| `--cni-plugin` | CNI plugin (cilium, azure-cni, none) | `cilium` |
6167
| `--cns-version` | CNS version to deploy | `v1.5.38` |
6268
| `--azure-ipam-version` | Azure IPAM version | `v0.3.0` |
63-
| `--cilium-dir` | Cilium version directory | `1.14` |
69+
| `--cilium-dir` | Cilium version directory | `1.17` |
6470
| `--cilium-registry` | Cilium image registry | `acnpublic.azurecr.io` |
6571
| `--cilium-version-tag` | Cilium version tag | Auto-detected |
6672
| `--ipv6-hp-bpf-version` | IPv6 HP BPF version | Auto-detected |
@@ -86,28 +92,31 @@ Preview the commands that would be executed without actually running them:
8692
The script supports the following Cilium versions based on available manifests (when using --cni-plugin cilium):
8793
- v1.12
8894
- v1.13
89-
- v1.14 (default)
95+
- v1.14
9096
- v1.16
91-
- v1.17
97+
- v1.17 (default)
9298

9399
## Examples
94100

95101
### Example 1: Basic cluster creation with Cilium (default)
96102
```bash
97-
./create-byocni-cluster.sh --subscription 9b8218f9-902a-4d20-a65c-e98acec5362f
103+
cd /path/to/azure-container-networking
104+
./hack/aks/create-byocni-cluster.sh --subscription 9b8218f9-902a-4d20-a65c-e98acec5362f
98105
```
99106

100107
### Example 2: Swift networking with Azure CNI Manager
101108
```bash
102-
./create-byocni-cluster.sh \
109+
cd /path/to/azure-container-networking
110+
./hack/aks/create-byocni-cluster.sh \
103111
--subscription 9b8218f9-902a-4d20-a65c-e98acec5362f \
104112
--networking-mode swift \
105113
--cni-plugin azure-cni
106114
```
107115

108116
### Example 3: Custom cluster with specific CNS version and Cilium
109117
```bash
110-
./create-byocni-cluster.sh \
118+
cd /path/to/azure-container-networking
119+
./hack/aks/create-byocni-cluster.sh \
111120
--cluster production-cluster \
112121
--subscription 9b8218f9-902a-4d20-a65c-e98acec5362f \
113122
--networking-mode overlay \
@@ -119,15 +128,17 @@ The script supports the following Cilium versions based on available manifests (
119128

120129
### Example 4: Cluster with kube-proxy enabled
121130
```bash
122-
./create-byocni-cluster.sh \
131+
cd /path/to/azure-container-networking
132+
./hack/aks/create-byocni-cluster.sh \
123133
--subscription 9b8218f9-902a-4d20-a65c-e98acec5362f \
124134
--networking-mode overlay \
125135
--with-kube-proxy
126136
```
127137

128138
### Example 5: Dualstack cluster with Cilium
129139
```bash
130-
./create-byocni-cluster.sh \
140+
cd /path/to/azure-container-networking
141+
./hack/aks/create-byocni-cluster.sh \
131142
--subscription 9b8218f9-902a-4d20-a65c-e98acec5362f \
132143
--networking-mode dualstack-overlay \
133144
--cilium-dir 1.17 \
@@ -136,7 +147,8 @@ The script supports the following Cilium versions based on available manifests (
136147

137148
### Example 6: Cluster with specific Kubernetes version
138149
```bash
139-
./create-byocni-cluster.sh \
150+
cd /path/to/azure-container-networking
151+
./hack/aks/create-byocni-cluster.sh \
140152
--subscription 9b8218f9-902a-4d20-a65c-e98acec5362f \
141153
--kubernetes-version 1.30 \
142154
--networking-mode overlay \
@@ -145,14 +157,16 @@ The script supports the following Cilium versions based on available manifests (
145157

146158
### Example 7: Only cluster and CNS, no CNI plugin
147159
```bash
148-
./create-byocni-cluster.sh \
160+
cd /path/to/azure-container-networking
161+
./hack/aks/create-byocni-cluster.sh \
149162
--subscription 9b8218f9-902a-4d20-a65c-e98acec5362f \
150163
--cni-plugin none
151164
```
152165

153166
### Example 8: Using different image registry
154167
```bash
155-
./create-byocni-cluster.sh \
168+
cd /path/to/azure-container-networking
169+
./hack/aks/create-byocni-cluster.sh \
156170
--subscription 9b8218f9-902a-4d20-a65c-e98acec5362f \
157171
--cilium-registry mcr.microsoft.com/containernetworking \
158172
--cilium-version-tag v1.14.8
@@ -191,7 +205,8 @@ After successful cluster creation, you can:
191205

192206
Use the `--dry-run` flag to see exactly what commands would be executed:
193207
```bash
194-
./create-byocni-cluster.sh --subscription YOUR_SUBSCRIPTION_ID --dry-run
208+
cd /path/to/azure-container-networking
209+
./hack/aks/create-byocni-cluster.sh --subscription YOUR_SUBSCRIPTION_ID --dry-run
195210
```
196211

197212
Check the logs for detailed information about each step of the process.

hack/aks/create-byocni-cluster.sh

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ DEFAULT_NO_KUBE_PROXY="true"
1414
DEFAULT_CNI_PLUGIN="cilium"
1515
DEFAULT_CNS_VERSION="v1.5.38"
1616
DEFAULT_AZURE_IPAM_VERSION="v0.3.0"
17-
DEFAULT_CILIUM_DIR="1.14"
17+
DEFAULT_CILIUM_DIR="1.17"
1818
DEFAULT_CILIUM_IMAGE_REGISTRY="acnpublic.azurecr.io"
1919
DEFAULT_CILIUM_VERSION_TAG=""
2020
DEFAULT_IPV6_HP_BPF_VERSION=""
2121
DEFAULT_CNS_IMAGE_REPO="MCR"
2222
DEFAULT_AZCLI="az"
23-
DEFAULT_KUBERNETES_VERSION="1.29"
23+
DEFAULT_KUBERNETES_VERSION="1.33"
2424

2525
# Script configuration
2626
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
@@ -302,7 +302,24 @@ create_cluster() {
302302
;;
303303
esac
304304

305-
local make_cmd="AZCLI=${AZCLI} CLUSTER=${CLUSTER_NAME} SUB=${SUBSCRIPTION} K8S_VER=${KUBERNETES_VERSION} make ${make_target}"
305+
# Determine LTS setting based on Kubernetes version
306+
local lts_setting="false"
307+
local k8s_major_minor
308+
k8s_major_minor=$(echo "${KUBERNETES_VERSION}" | cut -d'.' -f1-2)
309+
310+
# Convert version to comparable number (e.g., "1.30" -> 130)
311+
local version_number
312+
version_number=$(echo "${k8s_major_minor}" | sed 's/\.//g')
313+
314+
# Set LTS=true for versions less than 1.31 (i.e., 131)
315+
if [[ "${version_number}" -lt 131 ]]; then
316+
lts_setting="true"
317+
log "Kubernetes version ${KUBERNETES_VERSION} is < 1.31, setting LTS=true"
318+
else
319+
log "Kubernetes version ${KUBERNETES_VERSION} is >= 1.31, setting LTS=false"
320+
fi
321+
322+
local make_cmd="AZCLI=${AZCLI} CLUSTER=${CLUSTER_NAME} SUB=${SUBSCRIPTION} K8S_VER=${KUBERNETES_VERSION} LTS=${lts_setting} make ${make_target}"
306323

307324
log "Using make target: ${make_target}"
308325
execute "cd '${SCRIPT_DIR}' && ${make_cmd}"

0 commit comments

Comments
 (0)