forked from Azure/acs-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathk8s-vnet-predeploy.sh
More file actions
executable file
·14 lines (10 loc) · 941 Bytes
/
k8s-vnet-predeploy.sh
File metadata and controls
executable file
·14 lines (10 loc) · 941 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/bash
az network vnet create -g ${RESOURCE_GROUP} -n KubernetesCustomVNET --address-prefixes 10.239.0.0/16 10.244.0.0/16 --subnet-name KubernetesSubnet --subnet-prefix 10.239.0.0/16
tempfile="$(mktemp)"
trap "rm -rf \"${tempfile}\"" EXIT
jq ".properties.masterProfile.vnetSubnetId = \"/subscriptions/${SUBSCRIPTION_ID}/resourceGroups/${RESOURCE_GROUP}/providers/Microsoft.Network/virtualNetworks/KubernetesCustomVNET/subnets/KubernetesSubnet\"" ${CLUSTER_DEFINITION} > $tempfile && mv $tempfile ${CLUSTER_DEFINITION}
indx=0
for poolname in `jq -r '.properties.agentPoolProfiles[].name' "${CLUSTER_DEFINITION}"`; do
jq ".properties.agentPoolProfiles[$indx].vnetSubnetId = \"/subscriptions/${SUBSCRIPTION_ID}/resourceGroups/${RESOURCE_GROUP}/providers/Microsoft.Network/virtualNetworks/KubernetesCustomVNET/subnets/KubernetesSubnet\"" ${CLUSTER_DEFINITION} > $tempfile && mv $tempfile ${CLUSTER_DEFINITION}
indx=$((indx+1))
done