How do I detect kubernetes cluster provider (eks, aks) in helm charts?

1/29/2019

I want to write a generic helm chart that would work across all providers of kubernetes platfrom - Azure aks, AWS eks. There is at least one difference that I need to handle - AWS eks does not support sessionAffinity as part of Service spec.

What is the best way to (automatically) detect the kubernetes platfrom so that such differences can be handled? I can always ask the user to provide that as an input but I want to avoid that.

-- Nsen
amazon-eks
azure-aks
google-kubernetes-engine
kubernetes
kubernetes-helm

1 Answer

1/29/2019

According to the cloud providers document on Kubernetes, “The in-tree cloud providers typically need both --cloud-provider and --cloud-config specified in the command lines for the kube-apiserver, kube-controller-manager and the kubelet”. So, if you can query those values you can be able to achieve what you want.

-- ozrlz
Source: StackOverflow