Skip to content

Commit ca05852

Browse files
Automate kube-proxy configuration and add ipconfigupdate for nodesubnet
Co-authored-by: santhoshmprabhu <6684582+santhoshmprabhu@users.noreply.github.com>
1 parent 5f31b62 commit ca05852

File tree

3 files changed

+21
-34
lines changed

3 files changed

+21
-34
lines changed

hack/aks/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,10 @@ nodesubnet-byocni-nokubeproxy-up: rg-up ipv4 overlay-net-up ## Brings up an Node
145145
$(LTS_ARGS) \
146146
--yes
147147
@$(MAKE) set-kubeconf
148+
@$(MAKE) nodesubnet-ipconfigupdate
149+
150+
nodesubnet-ipconfigupdate: ## Run ipconfigupdate for NodeSubnet clusters
151+
RESOURCE_GROUP=MC_$(GROUP)_$(CLUSTER)_$(REGION) go run test/integration/cilium-nodesubnet/ipconfigupdate.go
148152

149153
overlay-byocni-up: rg-up ipv4 overlay-net-up ## Brings up an Overlay BYO CNI cluster
150154
$(AZCLI) aks create -n $(CLUSTER) -g $(GROUP) -l $(REGION) \

hack/aks/README-byocni.md

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ All parameters have sensible defaults as specified below. Only the `--subscripti
6666
| `--kubernetes-version` | Kubernetes version for the cluster | `1.33` |
6767
| `--vm-size` | Azure VM size for cluster nodes | `Standard_B2s` |
6868
| `--networking-mode` | Networking mode (overlay, swift, nodesubnet, dualstack-overlay, vnetscale-swift) | `overlay` |
69-
| `--no-kube-proxy` | Create cluster without kube-proxy | `true` |
70-
| `--with-kube-proxy` | Create cluster with kube-proxy | Overrides --no-kube-proxy |
7169
| `--cni-plugin` | CNI plugin (cilium, azure-cni, none) | `cilium` |
7270
| `--cns-version` | CNS version to deploy | `v1.5.38` |
7371
| `--azure-ipam-version` | Azure IPAM version | `v0.3.0` |
@@ -80,17 +78,17 @@ All parameters have sensible defaults as specified below. Only the `--subscripti
8078

8179
## Networking Modes
8280

83-
- **overlay**: Standard overlay networking mode (supports kube-proxy and no-kube-proxy)
84-
- **swift**: SWIFT networking mode (supports kube-proxy and no-kube-proxy)
85-
- **nodesubnet**: NodeSubnet networking mode (only supports no-kube-proxy)
86-
- **dualstack-overlay**: Dualstack overlay networking mode (supports kube-proxy and no-kube-proxy)
87-
- **vnetscale-swift**: VNet Scale SWIFT networking mode (supports kube-proxy and no-kube-proxy)
81+
- **overlay**: Standard overlay networking mode
82+
- **swift**: SWIFT networking mode
83+
- **nodesubnet**: NodeSubnet networking mode
84+
- **dualstack-overlay**: Dualstack overlay networking mode
85+
- **vnetscale-swift**: VNet Scale SWIFT networking mode
8886

8987
## CNI Plugins
9088

91-
- **cilium**: Deploy Cilium CNI with configurable versions (default)
92-
- **azure-cni**: Deploy Azure CNI Manager
93-
- **none**: Deploy only cluster and CNS, no CNI plugin
89+
- **cilium**: Deploy Cilium CNI with configurable versions (default, automatically disables kube-proxy)
90+
- **azure-cni**: Deploy Azure CNI Manager (automatically enables kube-proxy)
91+
- **none**: Deploy only cluster and CNS, no CNI plugin (automatically disables kube-proxy)
9492

9593
## Supported Cilium Versions
9694

@@ -140,16 +138,7 @@ cd /path/to/azure-container-networking
140138
--subscription 9b8218f9-902a-4d20-a65c-e98acec5362f
141139
```
142140

143-
### Example 5: Cluster with kube-proxy enabled
144-
```bash
145-
cd /path/to/azure-container-networking
146-
./hack/aks/create-byocni-cluster.sh \
147-
--subscription 9b8218f9-902a-4d20-a65c-e98acec5362f \
148-
--networking-mode overlay \
149-
--with-kube-proxy
150-
```
151-
152-
### Example 6: Dualstack cluster with Cilium
141+
### Example 5: Dualstack cluster with Cilium
153142
```bash
154143
cd /path/to/azure-container-networking
155144
./hack/aks/create-byocni-cluster.sh \
@@ -159,7 +148,7 @@ cd /path/to/azure-container-networking
159148
--cilium-version-tag v1.17.0
160149
```
161150

162-
### Example 7: Cluster with specific Kubernetes version
151+
### Example 6: Cluster with specific Kubernetes version
163152
```bash
164153
cd /path/to/azure-container-networking
165154
./hack/aks/create-byocni-cluster.sh \

hack/aks/create-byocni-cluster.sh

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ OPTIONS:
4646
-k, --kubernetes-version VER Kubernetes version for the cluster (default: ${DEFAULT_KUBERNETES_VERSION})
4747
-v, --vm-size VM_SIZE Azure VM size for cluster nodes (default: ${DEFAULT_VM_SIZE})
4848
-n, --networking-mode MODE Networking mode: overlay, swift, nodesubnet, dualstack-overlay, vnetscale-swift (default: ${DEFAULT_NETWORKING_MODE})
49-
--no-kube-proxy Create cluster without kube-proxy (default: ${DEFAULT_NO_KUBE_PROXY})
50-
--with-kube-proxy Create cluster with kube-proxy (overrides --no-kube-proxy)
5149
--cni-plugin PLUGIN CNI plugin to deploy: cilium, azure-cni, none (default: ${DEFAULT_CNI_PLUGIN})
5250
--cns-version VERSION CNS version to deploy (default: ${DEFAULT_CNS_VERSION})
5351
--azure-ipam-version VERSION Azure IPAM version (default: ${DEFAULT_AZURE_IPAM_VERSION})
@@ -87,9 +85,6 @@ EXAMPLES:
8785
# Custom cluster name and resource group
8886
$0 --cluster my-cluster --resource-group my-rg --subscription 9b8218f9-902a-4d20-a65c-e98acec5362f
8987
90-
# Cluster with kube-proxy enabled
91-
$0 --subscription 9b8218f9-902a-4d20-a65c-e98acec5362f --with-kube-proxy
92-
9388
# Using different Cilium version
9489
$0 --subscription 9b8218f9-902a-4d20-a65c-e98acec5362f --cilium-dir 1.16 --cilium-version-tag v1.16.0
9590
@@ -538,14 +533,6 @@ while [[ $# -gt 0 ]]; do
538533
NETWORKING_MODE="$2"
539534
shift 2
540535
;;
541-
--no-kube-proxy)
542-
NO_KUBE_PROXY="true"
543-
shift
544-
;;
545-
--with-kube-proxy)
546-
NO_KUBE_PROXY="false"
547-
shift
548-
;;
549536
--cni-plugin)
550537
CNI_PLUGIN="$2"
551538
shift 2
@@ -601,6 +588,13 @@ if [[ -z "${SUBSCRIPTION}" ]]; then
601588
exit 1
602589
fi
603590

591+
# Set kube-proxy configuration based on CNI plugin
592+
if [[ "${CNI_PLUGIN}" == "cilium" || "${CNI_PLUGIN}" == "none" ]]; then
593+
NO_KUBE_PROXY="true"
594+
else
595+
NO_KUBE_PROXY="false"
596+
fi
597+
604598
# Main execution
605599
main() {
606600
log "Starting BYO CNI cluster creation..."

0 commit comments

Comments
 (0)