Azure CNI w/ bring your own VNET
This issue will track the enabling of "bring your own" VNET functionality using Azure CNI networking implementation.
At present, hooking up a pre-existing VNET to a new cluster deployment manifest is manual. We continually test this manual feature with the following process:
- Create a new VNET using the script here:
- https://github.com/Azure/acs-engine/blob/master/examples/vnet/k8s-vnet-predeploy.sh
- depends upon an existing resource group mapped to the env var
RESOURCE_GROUP - will inject the resultant vnet reference strings into an api model path, mapped to the env var
CLUSTER_DEFINITION
- depends upon an existing resource group mapped to the env var
- Generate ARM template data using the modified api model path.
bin/acs-engine generate --api-model $CLUSTER_DEFINITION
- Deploy the cluster given the resultant ARM template data from the above step.
az group deployment create -n <name-of-deployment> -g $RESOURCE_GROUP --template-file _output/<path-to-template-file> --parameters _output/<path-to-parameters-file>
- Add the route table to the VNET subnet using the script here:
- https://github.com/Azure/acs-engine/blob/master/examples/vnet/k8s-vnet-postdeploy.sh
- depends upon an mapping the env var
RESOURCE_GROUPto the$RESOURCE_GROUPreferenced in all of the above steps
- depends upon an mapping the env var
We should aim to keep the above flow 100% working for existing kubenet configurations w/ bring your own VNET, and make "networkPolicy": "azure" configurations work as well. In practice the final route table step may not be required due to native Azure CNI characteristics, but that's an implementation detail. The important thing is we don't want to add any new configuration vectors. We simply want a working process to support api models that look like this:
{
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorType": "Kubernetes",
"kubernetesConfig": {
"networkPolicy": "azure"
}
},
"masterProfile": {
"count": 1,
"dnsPrefix": "<dns-prefix>",
"vmSize": "Standard_D2_v2",
"vnetSubnetId": "/subscriptions/<sub-id>/resourceGroups/<resource-group>/providers/Microsoft.Network/virtualNetworks/<vnet-name>/subnets/<subnet-name>,
"firstConsecutiveStaticIP": "10.239.255.239"
},
"agentPoolProfiles": [
{
"name": "agentpri",
"count": 3,
"vmSize": "Standard_D2_v2",
"vnetSubnetId": "/subscriptions/<sub-id>/resourceGroups/<resource-group>/providers/Microsoft.Network/virtualNetworks/<vnet-name>/subnets/<subnet-name>",
"availabilityProfile": "AvailabilitySet"
},
<etc...>
(firstConsecutiveStaticIP makes sense in the context of the VNET-generating scripts referenced above, that's not supposed to be a static requirement.)
@xtophs @dtzar
@slack @khenidak @sauryadas
@jackfrancis We have tested and this works if customer specifies vnetCIDR in the cluster config. We need the vnet address space for internet connectivity to work (the iptables rule).
Are you asking that customer should not have to specify the vnetCIDR for the pre-existing Vnet?
@sharmasushant No, if we have a working pattern with the existing code, we should use it. Thanks!
I'm realizing, also, that step 4 above (add route table to VNET) should not be required w/ Azure CNI. Can you confirm that that plumbing is only required for kubenet + Azure VNET implementations?
// TODOs:
- add validation for Azure CNI + bring your own VNET configs: require
vnetCIDRproperty- @jackfrancis
- improve documentation
- @jackfrancis
I just deployed a k8s 1.9.6 with customvnet adn azure cni, the cluster is up adn kubcetl works, but there is not route table crated and using kubectl proxy I cannot access dashboard
Error: 'net/http: HTTP/1.x transport connection broken: malformed HTTP response "\x15\x03\x01\x00\x02\x02"'
Trying to reach: 'http://10.192.0.51:8443/'
My subnet is 10.192.0.0/10 and firt ip is 10.255.255.5
@jalberto did you include a vnetCidr value in the masterProfile api model that is within the IP space of your subnet (10.192.0.0/10)?
yes
On Mon, 2 Apr 2018 at 18:55 Jack Francis [email protected] wrote:
@jalberto https://github.com/jalberto did you include a vnetCidr value in the masterProfile api model that is within the IP space of your subnet (10.192.0.0/10)?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Azure/acs-engine/issues/1815#issuecomment-377977071, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGGV4CepUzzA_WqSTIo12nKexdW8H0Vks5tklfugaJpZM4QmqkS .