@@ -8,14 +8,14 @@ AZIMG = mcr.microsoft.com/azure-cli
88AZCLI ?= docker run --rm -v $(AZCFG ) :/root/.azure -v $(KUBECFG ) :/root/.kube -v $(SSH ) :/root/.ssh $(AZIMG ) az
99
1010# overrideable variables
11- USER ?= $(whoami )
12- OSSKU ?= Ubuntu
13- CLUSTER ?= $(USER ) -$(REGION )
14- GROUP ?= $(CLUSTER )
15- REGION ?= westus2
1611SUB ?= $(AZURE_SUBSCRIPTION )
12+ CLUSTER ?= $(whoami ) -$(REGION )
13+ GROUP ?= $(CLUSTER )
1714VNET ?= $(CLUSTER )
18-
15+ # overrideable defaults
16+ REGION ?= westus2
17+ OS_SKU ?= Ubuntu
18+ VM_SIZE ?= Standard_B2s
1919
2020# #@ Help
2121
@@ -45,28 +45,30 @@ unset-kubeconf: ## Deletes the kubeconf for $CLUSTER
4545shell : # # print $AZCLI so it can be used outside of make
4646 @echo $(AZCLI )
4747
48-
49- # #@ SWIFT Infra
50-
51- vars : # # Show the env vars configured for the swift command
52- @echo SUB=$(SUB )
48+ vars : # # Show the input vars configured for the cluster commands
49+ @echo CLUSTER=$(CLUSTER )
5350 @echo GROUP=$(GROUP )
5451 @echo REGION=$(REGION )
52+ @echo SUB=$(SUB )
5553 @echo VNET=$(VNET )
56- @echo CLUSTER=$(CLUSTER )
54+ @echo OS_SKU=$(OS_SKU )
55+ @echo VM_SIZE=$(VM_SIZE )
56+
57+
58+ # #@ SWIFT Infra
5759
58- rg-up : # # Create resource group $GROUP in $SUB/$REGION
60+ rg-up : # # Create resource group
5961 @$(AZCLI ) group create --location $(REGION ) --name $(GROUP )
6062
61- rg-down : # # Delete the $GROUP in $SUB/$REGION
63+ rg-down : # # Delete resource group
6264 $(AZCLI ) group delete -g $(GROUP ) --yes
6365
64- net-up : # # Create required swift vnet/ subnets
66+ swift- net-up : # # Create vnet, nodenet and podnet subnets
6567 $(AZCLI ) network vnet create -g $(GROUP ) -l $(REGION ) --name $(VNET ) --address-prefixes 10.0.0.0/8 -o none
6668 $(AZCLI ) network vnet subnet create -g $(GROUP ) --vnet-name $(VNET ) --name nodenet --address-prefixes 10.240.0.0/16 -o none
6769 $(AZCLI ) network vnet subnet create -g $(GROUP ) --vnet-name $(VNET ) --name podnet --address-prefixes 10.241.0.0/16 -o none
6870
69- overlay-net-up :
71+ overlay-net-up : # # Create vnet, nodenet subnets
7072 $(AZCLI ) network vnet create -g $(GROUP ) -l $(REGION ) --name $(VNET ) --address-prefixes 10.0.0.0/8 -o none
7173 $(AZCLI ) network vnet subnet create -g $(GROUP ) --vnet-name $(VNET ) --name nodenet --address-prefix 10.10.0.0/16 -o none
7274
@@ -80,7 +82,7 @@ up: swift-up ## Alias to swift-up
8082overlay-up : rg-up overlay-net-up # # Brings up an Overlay AzCNI cluster
8183 $(AZCLI ) aks create -n $(CLUSTER ) -g $(GROUP ) -l $(REGION ) \
8284 --node-count 2 \
83- --node-vm-size Standard_B2s \
85+ --node-vm-size $( VM_SIZE ) \
8486 --load-balancer-sku basic \
8587 --network-plugin azure \
8688 --network-plugin-mode overlay \
@@ -90,23 +92,23 @@ overlay-up: rg-up overlay-net-up ## Brings up an Overlay AzCNI cluster
9092 --yes
9193 @$(MAKE ) set-kubeconf
9294
93- swift-byocni-up : rg-up net-up # # Bring up a SWIFT BYO CNI cluster
95+ swift-byocni-up : rg-up swift- net-up # # Bring up a SWIFT BYO CNI cluster
9496 $(AZCLI ) aks create -n $(CLUSTER ) -g $(GROUP ) -l $(REGION ) \
9597 --node-count 2 \
96- --node-vm-size Standard_B2s \
98+ --node-vm-size $( VM_SIZE ) \
9799 --load-balancer-sku basic \
98100 --network-plugin none \
99101 --vnet-subnet-id /subscriptions/$(SUB ) /resourceGroups/$(GROUP ) /providers/Microsoft.Network/virtualNetworks/$(VNET ) /subnets/nodenet \
100102 --pod-subnet-id /subscriptions/$(SUB ) /resourceGroups/$(GROUP ) /providers/Microsoft.Network/virtualNetworks/$(VNET ) /subnets/podnet \
101103 --no-ssh-key \
102- --os-sku $(OSSKU ) \
104+ --os-sku $(OS_SKU ) \
103105 --yes
104106 @$(MAKE ) set-kubeconf
105107
106- swift-cilium-up : rg-up net-up # # Bring up a SWIFT Cilium cluster
108+ swift-cilium-up : rg-up swift- net-up # # Bring up a SWIFT Cilium cluster
107109 $(AZCLI ) aks create -n $(CLUSTER ) -g $(GROUP ) -l $(REGION ) \
108110 --node-count 2 \
109- --node-vm-size Standard_B2s \
111+ --node-vm-size $( VM_SIZE ) \
110112 --load-balancer-sku basic \
111113 --network-plugin azure \
112114 --enable-cilium-dataplane \
@@ -117,10 +119,10 @@ swift-cilium-up: rg-up net-up ## Bring up a SWIFT Cilium cluster
117119 --yes
118120 @$(MAKE ) set-kubeconf
119121
120- swift-up : rg-up net-up # # Bring up a SWIFT AzCNI cluster
122+ swift-up : rg-up swift- net-up # # Bring up a SWIFT AzCNI cluster
121123 $(AZCLI ) aks create -n $(CLUSTER ) -g $(GROUP ) -l $(REGION ) \
122124 --node-count 2 \
123- --node-vm-size Standard_B2s \
125+ --node-vm-size $( VM_SIZE ) \
124126 --load-balancer-sku basic \
125127 --network-plugin azure \
126128 --vnet-subnet-id /subscriptions/$(SUB ) /resourceGroups/$(GROUP ) /providers/Microsoft.Network/virtualNetworks/$(VNET ) /subnets/nodenet \
0 commit comments