Skip to content

Commit a41fea5

Browse files
authored
add cilium cluster to hackfile (#1664)
Signed-off-by: Evan Baker <[email protected]> Signed-off-by: Evan Baker <[email protected]>
1 parent 80162b0 commit a41fea5

File tree

2 files changed

+44
-18
lines changed

2 files changed

+44
-18
lines changed

hack/swift/Makefile

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ KUBECFG = $(HOME)/.kube
55
SSH = $(HOME)/.ssh
66
AZCFG = $(HOME)/.azure
77
AZIMG = mcr.microsoft.com/azure-cli
8-
AZCLI ?= docker run -v $(AZCFG):/root/.azure -v $(KUBECFG):/root/.kube -v $(SSH):/root/.ssh $(AZIMG) az
8+
AZCLI ?= docker run --rm -v $(AZCFG):/root/.azure -v $(KUBECFG):/root/.kube -v $(SSH):/root/.ssh $(AZIMG) az
99

1010
# overrideable variables
1111
USER ?= $(whoami)
@@ -21,6 +21,7 @@ VNET ?= $(CLUSTER)
2121
help: ## Display this help
2222
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
2323

24+
2425
##@ Utilities
2526

2627
azlogin:
@@ -29,6 +30,7 @@ azlogin:
2930

3031
azcfg:
3132
@$(AZCLI) extension add --name aks-preview --yes
33+
@$(AZCLI) extension update --name aks-preview
3234

3335
set-kubeconf: ## Adds the kubeconf for $CLUSTER
3436
$(AZCLI) aks get-credentials -n $(CLUSTER) -g $(GROUP)
@@ -44,6 +46,7 @@ shell: ## print $AZCLI so it can be used outside of make
4446

4547

4648
##@ SWIFT Infra
49+
4750
vars: ## Show the env vars configured for the swift command
4851
@echo SUB=$(SUB)
4952
@echo GROUP=$(GROUP)
@@ -66,43 +69,57 @@ overlay-net-up:
6669
$(AZCLI) network vnet create -g $(GROUP) -l $(REGION) --name $(VNET) --address-prefixes 10.0.0.0/8 -o none
6770
$(AZCLI) network vnet subnet create -g $(GROUP) --vnet-name $(VNET) --name nodenet --address-prefix 10.10.0.0/16 -o none
6871

72+
6973
##@ AKS Clusters
7074

71-
swift-up: rg-up net-up ## Brings up a swift cluster $name in $SUB/$REGION
75+
byocni-up: swift-byocni-up ## Alias to swift-byocni-up
76+
cilium-up: swift-cilium-up ## Alias to swift-cilium-up
77+
up: swift-up ## Alias to swift-up
78+
79+
overlay-up: rg-up overlay-net-up ## Brings up an Overlay AzCNI cluster
7280
$(AZCLI) aks create -n $(CLUSTER) -g $(GROUP) -l $(REGION) \
73-
--max-pods 250 \
7481
--node-count 3 \
7582
--network-plugin azure \
83+
--network-plugin-mode overlay \
84+
--pod-cidr 192.168.0.0/16 \
85+
--vnet-subnet-id /subscriptions/$(SUB)/resourceGroups/$(GROUP)/providers/Microsoft.Network/virtualNetworks/$(VNET)/subnets/nodenet \
86+
--generate-ssh-keys \
87+
--yes
88+
@$(MAKE) set-kubeconf
89+
90+
swift-byocni-up: rg-up net-up ## Bring up a SWIFT BYO CNI cluster
91+
$(AZCLI) aks create -n $(CLUSTER) -g $(GROUP) -l $(REGION) \
92+
--node-count 3 \
93+
--network-plugin none \
7694
--vnet-subnet-id /subscriptions/$(SUB)/resourceGroups/$(GROUP)/providers/Microsoft.Network/virtualNetworks/$(VNET)/subnets/nodenet \
7795
--pod-subnet-id /subscriptions/$(SUB)/resourceGroups/$(GROUP)/providers/Microsoft.Network/virtualNetworks/$(VNET)/subnets/podnet \
7896
--generate-ssh-keys \
7997
--yes
8098
@$(MAKE) set-kubeconf
8199

82-
overlay-up: rg-up overlay-net-up ## Brings up an overlay cluster $name in $SUB/$REGION
100+
swift-cilium-up: rg-up net-up ## Bring up a SWIFT Cilium cluster
83101
$(AZCLI) aks create -n $(CLUSTER) -g $(GROUP) -l $(REGION) \
84-
--max-pods 250 \
85102
--node-count 3 \
86103
--network-plugin azure \
87-
--network-plugin-mode overlay \
88-
--pod-cidr 192.168.0.0/16 \
104+
--enable-cilium-dataplane \
105+
--aks-custom-headers AKSHTTPCustomFeatures=Microsoft.ContainerService/CiliumDataplanePreview \
89106
--vnet-subnet-id /subscriptions/$(SUB)/resourceGroups/$(GROUP)/providers/Microsoft.Network/virtualNetworks/$(VNET)/subnets/nodenet \
107+
--pod-subnet-id /subscriptions/$(SUB)/resourceGroups/$(GROUP)/providers/Microsoft.Network/virtualNetworks/$(VNET)/subnets/podnet \
90108
--generate-ssh-keys \
91109
--yes
92110
@$(MAKE) set-kubeconf
93111

94-
byocni-up: rg-up net-up ## Brings up a swift cluster $name in $SUB/$REGION
112+
swift-up: rg-up net-up ## Bring up a SWIFT AzCNI cluster
95113
$(AZCLI) aks create -n $(CLUSTER) -g $(GROUP) -l $(REGION) \
96-
--max-pods 250 \
97114
--node-count 3 \
98-
--network-plugin none \
115+
--network-plugin azure \
99116
--vnet-subnet-id /subscriptions/$(SUB)/resourceGroups/$(GROUP)/providers/Microsoft.Network/virtualNetworks/$(VNET)/subnets/nodenet \
100117
--pod-subnet-id /subscriptions/$(SUB)/resourceGroups/$(GROUP)/providers/Microsoft.Network/virtualNetworks/$(VNET)/subnets/podnet \
101118
--generate-ssh-keys \
102119
--yes
103120
@$(MAKE) set-kubeconf
104121

105-
down: ## Deletes the swift resources $SUB/$REGION
122+
down: ## Delete the cluster
106123
$(AZCLI) aks delete -g $(GROUP) -n $(CLUSTER) --yes
107124
@$(MAKE) unset-kubeconf
108125
@$(MAKE) rg-down

hack/swift/README.md

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Use this Makefile to swiftly provision/deprovision [enhanced pod subnet (aka swift)](https://docs.microsoft.com/en-us/azure/aks/configure-azure-cni#dynamic-allocation-of-ips-and-enhanced-subnet-support-preview) clusters in Azure.
1+
Use this Makefile to swiftly provision/deprovision AKS clusters of different Networking flavors in Azure.
22

33
---
44
```bash
@@ -14,10 +14,19 @@ Utilities
1414
unset-kubeconf Deletes the kubeconf for $CLUSTER
1515
shell print $AZCLI so it can be used outside of make
1616

17-
SWIFT
18-
swift-vars Show the env vars configured for the swift command
19-
swift-net-up Create required swift vnet/subnets
20-
swift-rg-down Delete the $GROUP in $SUB/$REGION
21-
swift-up Brings up a swift cluster $name in $SUB/$REGION
22-
swift-down Deletes the swift resources $SUB/$REGION
17+
SWIFT Infra
18+
vars Show the env vars configured for the swift command
19+
rg-up Create resource group $GROUP in $SUB/$REGION
20+
rg-down Delete the $GROUP in $SUB/$REGION
21+
net-up Create required swift vnet/subnets
22+
23+
AKS Clusters
24+
byocni-up Alias to swift-byocni-up
25+
cilium-up Alias to swift-cilium-up
26+
up Alias to swift-up
27+
overlay-up Brings up an Overlay AzCNI cluster
28+
swift-byocni-up Bring up a SWIFT BYO CNI cluster
29+
swift-cilium-up Bring up a SWIFT Cilium cluster
30+
swift-up Bring up a SWIFT AzCNI cluster
31+
down Delete the cluster
2332
```

0 commit comments

Comments
 (0)