tf-kops-cluster icon indicating copy to clipboard operation
tf-kops-cluster copied to clipboard

Public subnets as variable

Open edahlseng opened this issue 8 years ago • 3 comments

It appears that there's no way to specify public subnets for reuse with the cluster -- only new subnets can be created. It would be awesome if public subnets could be specified directly, overriding the creation of new resources.

edahlseng avatar Dec 27 '17 21:12 edahlseng

Hi Eric! This is by design. Public subnets cannot be shared between clusters and must be created per cluster. This is because when Kubernetes creates ELBs for a Loadbalancer services, it looks for subnets that have the KubernetesCluster tag containing the cluster FQDN.

Make sense?

Thanks, Max

FutureSharks avatar Dec 28 '17 14:12 FutureSharks

Hi Max,

Thanks for the information. I'm still getting up to speed with all of the details and nuances of Kubernetes and kops.

Looking at Kubernetes documentation for running in existing VPCs, however, it appears that there's an option to specify the utility (public) subnets for the cluster? Though maybe this is only available in kops 1.8?

edahlseng avatar Dec 28 '17 22:12 edahlseng

So that is interesting, they have changed the behaviour in version 1.8:

This is important, for example, if your utility subnets are shared, you will not be able to launch any services that create Elastic Load Balancers (ELBs). Prior to kops 1.8 KubernetesCluster tag was used for this. This lead to several problems if there were more than one Kubernetes Cluster in a subnet. After you upgraded to kops 1.8 remove KubernetesCluster Tag from subnets otherwise kubernetes.io/cluster/<clustername> won't have any effect!

I'll have to rewrite the subnet stuff for this. Basically the subnets would have to be removed from the module, created outside the module and then tags added for each k8s cluster that would use the shared subnets.

FutureSharks avatar Dec 29 '17 13:12 FutureSharks