Skip to content

Commit c925023

Browse files
Copilotcamrynl
andcommitted
Make BYO CNI script universal to support multiple scenarios
Co-authored-by: camrynl <[email protected]>
1 parent 0c31164 commit c925023

File tree

2 files changed

+310
-51
lines changed

2 files changed

+310
-51
lines changed

hack/aks/README-byocilium.md renamed to hack/aks/README-byocni.md

Lines changed: 69 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# BYO Cilium Cluster Setup Script
1+
# BYO CNI Cluster Setup Script
22

3-
The `create-byocilium-cluster.sh` script automates the creation of a BYO (Bring Your Own) Cilium cluster on Azure Kubernetes Service (AKS). It orchestrates the following steps:
3+
The `create-byocni-cluster.sh` script automates the creation of a BYO (Bring Your Own) CNI cluster on Azure Kubernetes Service (AKS). It orchestrates the following steps:
44

5-
1. **Cluster Creation**: Creates an AKS cluster with overlay networking and no kube-proxy using the `overlay-byocni-nokubeproxy-up` make target
6-
2. **CNS Deployment**: Deploys Azure Container Networking Service (CNS) to the cluster using the `test-load` make command
7-
3. **Cilium Installation**: Installs Cilium networking components using manifests from the `test/integration/manifests/cilium/` directory
5+
1. **Cluster Creation**: Creates an AKS cluster with configurable networking modes (overlay, swift, nodesubnet, dualstack-overlay, vnetscale-swift)
6+
2. **CNS Deployment**: Deploys Azure Container Networking Service (CNS) to the cluster using the `test-load` make command
7+
3. **CNI Installation**: Installs the specified CNI networking components (Cilium by default, Azure CNI Manager, or none)
88

99
## Prerequisites
1010

@@ -20,18 +20,20 @@ Before running the script, ensure you have:
2020

2121
### Basic Usage
2222

23-
Create a cluster with default settings:
23+
Create a cluster with default settings (overlay networking with Cilium):
2424
```bash
25-
./create-byocilium-cluster.sh --subscription YOUR_SUBSCRIPTION_ID
25+
./create-byocni-cluster.sh --subscription YOUR_SUBSCRIPTION_ID
2626
```
2727

2828
### Advanced Usage
2929

3030
Create a cluster with custom configuration:
3131
```bash
32-
./create-byocilium-cluster.sh \
33-
--cluster my-cilium-cluster \
32+
./create-byocni-cluster.sh \
33+
--cluster my-cluster \
3434
--subscription YOUR_SUBSCRIPTION_ID \
35+
--networking-mode swift \
36+
--cni-plugin cilium \
3537
--cns-version v1.6.0 \
3638
--cilium-dir 1.16 \
3739
--cilium-version-tag v1.16.5
@@ -41,7 +43,7 @@ Create a cluster with custom configuration:
4143

4244
Preview the commands that would be executed without actually running them:
4345
```bash
44-
./create-byocilium-cluster.sh --subscription YOUR_SUBSCRIPTION_ID --dry-run
46+
./create-byocni-cluster.sh --subscription YOUR_SUBSCRIPTION_ID --dry-run
4547
```
4648

4749
## Configuration Options
@@ -51,6 +53,10 @@ Preview the commands that would be executed without actually running them:
5153
| `--cluster` | Name of the AKS cluster | `byocni-cluster` |
5254
| `--subscription` | Azure subscription ID | *Required* |
5355
| `--azcli` | Azure CLI command | `az` |
56+
| `--networking-mode` | Networking mode (overlay, swift, nodesubnet, dualstack-overlay, vnetscale-swift) | `overlay` |
57+
| `--no-kube-proxy` | Create cluster without kube-proxy | `true` |
58+
| `--with-kube-proxy` | Create cluster with kube-proxy | Overrides --no-kube-proxy |
59+
| `--cni-plugin` | CNI plugin (cilium, azure-cni, none) | `cilium` |
5460
| `--cns-version` | CNS version to deploy | `v1.5.38` |
5561
| `--azure-ipam-version` | Azure IPAM version | `v0.3.0` |
5662
| `--cilium-dir` | Cilium version directory | `1.14` |
@@ -60,9 +66,23 @@ Preview the commands that would be executed without actually running them:
6066
| `--cns-image-repo` | CNS image repository | `MCR` |
6167
| `--dry-run` | Show commands without executing | `false` |
6268

69+
## Networking Modes
70+
71+
- **overlay**: Standard overlay networking mode (supports kube-proxy and no-kube-proxy)
72+
- **swift**: SWIFT networking mode (supports kube-proxy and no-kube-proxy)
73+
- **nodesubnet**: NodeSubnet networking mode (only supports no-kube-proxy)
74+
- **dualstack-overlay**: Dualstack overlay networking mode (supports kube-proxy and no-kube-proxy)
75+
- **vnetscale-swift**: VNet Scale SWIFT networking mode (supports kube-proxy and no-kube-proxy)
76+
77+
## CNI Plugins
78+
79+
- **cilium**: Deploy Cilium CNI with configurable versions (default)
80+
- **azure-cni**: Deploy Azure CNI Manager
81+
- **none**: Deploy only cluster and CNS, no CNI plugin
82+
6383
## Supported Cilium Versions
6484

65-
The script supports the following Cilium versions based on available manifests:
85+
The script supports the following Cilium versions based on available manifests (when using --cni-plugin cilium):
6686
- v1.12
6787
- v1.13
6888
- v1.14 (default)
@@ -71,31 +91,58 @@ The script supports the following Cilium versions based on available manifests:
7191

7292
## Examples
7393

74-
### Example 1: Basic cluster creation
94+
### Example 1: Basic cluster creation with Cilium (default)
7595
```bash
76-
./create-byocilium-cluster.sh --subscription 9b8218f9-902a-4d20-a65c-e98acec5362f
96+
./create-byocni-cluster.sh --subscription 9b8218f9-902a-4d20-a65c-e98acec5362f
97+
```
98+
99+
### Example 2: Swift networking with Azure CNI Manager
100+
```bash
101+
./create-byocni-cluster.sh \
102+
--subscription 9b8218f9-902a-4d20-a65c-e98acec5362f \
103+
--networking-mode swift \
104+
--cni-plugin azure-cni
77105
```
78106

79-
### Example 2: Custom cluster with specific CNS version
107+
### Example 3: Custom cluster with specific CNS version and Cilium
80108
```bash
81-
./create-byocilium-cluster.sh \
82-
--cluster production-cilium \
109+
./create-byocni-cluster.sh \
110+
--cluster production-cluster \
83111
--subscription 9b8218f9-902a-4d20-a65c-e98acec5362f \
112+
--networking-mode overlay \
84113
--cns-version v1.6.0 \
85-
--azure-ipam-version v0.4.0
114+
--azure-ipam-version v0.4.0 \
115+
--cni-plugin cilium \
116+
--cilium-dir 1.16
86117
```
87118

88-
### Example 3: Latest Cilium version
119+
### Example 4: Cluster with kube-proxy enabled
89120
```bash
90-
./create-byocilium-cluster.sh \
121+
./create-byocni-cluster.sh \
91122
--subscription 9b8218f9-902a-4d20-a65c-e98acec5362f \
123+
--networking-mode overlay \
124+
--with-kube-proxy
125+
```
126+
127+
### Example 5: Dualstack cluster with Cilium
128+
```bash
129+
./create-byocni-cluster.sh \
130+
--subscription 9b8218f9-902a-4d20-a65c-e98acec5362f \
131+
--networking-mode dualstack-overlay \
92132
--cilium-dir 1.17 \
93133
--cilium-version-tag v1.17.0
94134
```
95135

96-
### Example 4: Using different image registry
136+
### Example 6: Only cluster and CNS, no CNI plugin
137+
```bash
138+
./create-byocni-cluster.sh \
139+
--subscription 9b8218f9-902a-4d20-a65c-e98acec5362f \
140+
--cni-plugin none
141+
```
142+
143+
### Example 7: Using different image registry
97144
```bash
98-
./create-byocilium-cluster.sh \
145+
./create-byocni-cluster.sh \
99146
--subscription 9b8218f9-902a-4d20-a65c-e98acec5362f \
100147
--cilium-registry mcr.microsoft.com/containernetworking \
101148
--cilium-version-tag v1.14.8
@@ -134,7 +181,7 @@ After successful cluster creation, you can:
134181

135182
Use the `--dry-run` flag to see exactly what commands would be executed:
136183
```bash
137-
./create-byocilium-cluster.sh --subscription YOUR_SUBSCRIPTION_ID --dry-run
184+
./create-byocni-cluster.sh --subscription YOUR_SUBSCRIPTION_ID --dry-run
138185
```
139186

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

0 commit comments

Comments
 (0)