AKS icon indicating copy to clipboard operation
AKS copied to clipboard

Deploy Cluster without Kube-Proxy

Open chasewilson opened this issue 2 years ago • 12 comments

Customer would like to deploy Cluster without Kube-Proxy.

Example scenario:

Customers would like to deploy a cluster with BYO CNI + Cilium and not have the cluster contain Kube-Proxy.

Stems from #1846

chasewilson avatar Sep 24 '24 15:09 chasewilson

currently, just specifying

kubeProxyConfig:
  enabled: false

throws a validation error

{"code": "KubeProxyConfigDisabledBYOCNIOnly", "message": "Preflight validation check for resource(s) for container service {myAks} in resource group {myResourceGroup} failed. Message: Disabling kube-proxy is only allowed for bring your own (BYO) CNI clusters. For more information, please check https://aka.ms/byo-cni. Details: "}

is this check going to go away?

thewisenerd avatar Sep 28 '24 08:09 thewisenerd

@chasewilson Below command create AKS with BYO CNI and without kube-proxy:

kube-proxy-config.json
{
  "enabled": false,
  "mode": "IPVS",
  "ipvsConfig": {
    "scheduler": "LeastConnection",
    "TCPTimeoutSeconds": 900,
    "TCPFINTimeoutSeconds": 120,
    "UDPTimeoutSeconds": 300
  }
}

az aks create -n $clusterName -g $resourceGroup --location $location `
	--kube-proxy-config .\kube-proxy-config.json `
	--nodepool-name "system" `
	--vm-set-type VirtualMachineScaleSets `
	--node-count 2 `
	--node-vm-size Standard_B2as_v2 `
	--max-pods 50 `
	--load-balancer-sku standard `
	--enable-private-cluster `
	--dns-name-prefix $clusterName `
	--kubernetes-version 1.29.7 `
	--vnet-subnet-id $podSubnetId `
	--service-cidr "10.255.0.0/16" `
	--dns-service-ip "10.255.0.10" `
	--network-plugin none

@thewisenerd And I believe that is correct. If you use BYO CNI then you can disable installing kube-proxy. With Azure CNI powered by Cilium kube-proxy is not being installed by default.

bartwitkowski avatar Sep 30 '24 12:09 bartwitkowski

@chasewilson Below command create AKS with BYO CNI and without kube-proxy:

kube-proxy-config.json
{
  "enabled": false,
  "mode": "IPVS",
  "ipvsConfig": {
    "scheduler": "LeastConnection",
    "TCPTimeoutSeconds": 900,
    "TCPFINTimeoutSeconds": 120,
    "UDPTimeoutSeconds": 300
  }
}

az aks create -n $clusterName -g $resourceGroup --location $location `
	--kube-proxy-config .\kube-proxy-config.json `
	--nodepool-name "system" `
	--vm-set-type VirtualMachineScaleSets `
	--node-count 2 `
	--node-vm-size Standard_B2as_v2 `
	--max-pods 50 `
	--load-balancer-sku standard `
	--enable-private-cluster `
	--dns-name-prefix $clusterName `
	--kubernetes-version 1.29.7 `
	--vnet-subnet-id $podSubnetId `
	--service-cidr "10.255.0.0/16" `
	--dns-service-ip "10.255.0.10" `
	--network-plugin none

@thewisenerd And I believe that is correct. If you use BYO CNI then you can disable installing kube-proxy. With Azure CNI powered by Cilium kube-proxy is not being installed by default.

That is for sure the known (but not well documented) workaround, but there are few things making it troublesome. Firstly it does depend on #1846 which is not in GA and its latest update was "GA ETA: Retiring" due to Cilium, which at least in my mind does create worst case scenario that it might be removed in future API changes. Secondly Terraform for example doesn't get from API proper information to be able to track its state. Third, deploying Cilium with AKS with built-in feature, does deploy very old version of it. I and my customers would prefer controlling Cilium version independently with Helm as we are doing already.

kc8421 avatar Oct 07 '24 18:10 kc8421

@thewisenerd and @kc8421

Thanks for the this here. This isn't dependent on IPVS and can be done as @thewisenerd has described. The docs are confusing and it's not clear that this isn't dependent on IPVS. So, I'll update the docs to move the information somewhere less confusing!

Thank you for the input here and just to provide wrap up the recommendation in this thread if you're reading the bottom to catch the latest, please use @thewisenerd s instructions he provided earlier in this thread.

EDIT: I'll close this issue when docs update is complete and merged

chasewilson avatar Dec 06 '24 16:12 chasewilson

@chasewilson apologies, I do not understand this completely. Are you stating that just specifying kubeProxyConfig.enabled=false will no longer throw a validation error, and start working? any specific Microsoft.ContainerService/managedClusters API version to test this with?

or, is both kubeProxyConfig.enabled=false and --network-plugin none needed?

thewisenerd avatar Dec 10 '24 05:12 thewisenerd

@chasewilson apologies, I do not understand this completely. Are you stating that just specifying kubeProxyConfig.enabled=false will no longer throw a validation error, and start working? any specific Microsoft.ContainerService/managedClusters API version to test this with?

or, is both kubeProxyConfig.enabled=false and --network-plugin none needed?

@thewisenerd you can take a look at this blog that I wrote sometime back and see if it helps- https://medium.com/@amitmavgupta/installing-cilium-in-azure-kubernetes-service-byocni-with-no-kube-proxy-825b9007b24b

amitmavgupta avatar Dec 11 '24 04:12 amitmavgupta

@thewisenerd, at least based on documentation you must use *-preview API to even get the kubeProxyConfig out of it. For example 2024-09-01 doesn't have it, while 2024-09-02-preview does have it. Already year old preview API version does have it. Based on my experience you still need both kubeProxyConfig.enabled=false and --network-plugin none if you don't run with Azure CNI with Cilium (as mentioned earlier by the @bartwitkowski).

kc8421 avatar Dec 18 '24 11:12 kc8421

Any update on this? Do we know when kube-proxy disabling is official supported on the AKS API?

w1ndhunter avatar Mar 03 '25 12:03 w1ndhunter

I am also wondering if there's an update regarding this matter. The TF provider only supports functionality that is in the stable version of the API, and we would really like to deploy a cluster with BYOC with kube-proxy disabled using Terraform

Robsta86 avatar Jun 19 '25 10:06 Robsta86

Gentle ping. Any ETA?

asychev avatar Jan 20 '26 08:01 asychev

Q2 is the estimated GA ETA for this feature.

christine33-creator avatar Mar 05 '26 18:03 christine33-creator

Gentle nudge again. Any ETA to be provided?

kc8421 avatar Sep 01 '26 06:09 kc8421