public-cloud-roadmap icon indicating copy to clipboard operation
public-cloud-roadmap copied to clipboard

Kubernetes Cluster - specifying a private subnet

Open chris-cynation opened this issue 1 year ago • 10 comments

When working with terraform I realised that when deploying a kubernetes cluster on a private network I'm not able to select which subnet to place it in.

This causes issues out of the box when doing terraform destroy as it is unaware of the private subnet usage (without manually using depends_on).

I think it would be good to be able select the private subnet a kubernetes cluster should use.

chris-cynation avatar Mar 08 '23 11:03 chris-cynation

Hello @chris-cynation . I am not sure to get the issue : choosing a specific private subnet is one of the configuration parameter at kubernets cluster creation.

This documentations shows an example using it : https://registry.terraform.io/providers/ovh/ovh/latest/docs/resources/cloud_project_kube

image

mhurtrel avatar Mar 08 '23 12:03 mhurtrel

Oh, I think I see it is tolist(ovh_cloud_project_network_private.network.regions_attributes[*].openstackid)[0] selecting the first subnet on the network?

chris-cynation avatar Mar 08 '23 14:03 chris-cynation

Yes indeed

mhurtrel avatar Mar 08 '23 14:03 mhurtrel

Ah, then the improvement would be a way to get that from the output of creating the subnet so terraform can know there's a dependency.

Another aspect it helps with is when you've declared multiple subnets and want a clear link which one it is.

chris-cynation avatar Mar 08 '23 15:03 chris-cynation

Hello all, this has been prioritized on our end and you will soon be able to select the subnet of a given private network on cluster creation/reset.

LisaPerrier avatar Jun 27 '23 13:06 LisaPerrier

Hi @LisaPerrier Any update ?

danvy avatar Jan 13 '24 01:01 danvy

We probably also needing this, it seems be something in the backend api at: https://eu.api.ovh.com/console/#/cloud/project/%7BserviceName%7D/kube~POST nodesSubnetId field, but I haven't tried to post it.

The subnet that is choosen seems to be one with "lowest" id, it's also the one ip range showing up in OVH admin portal, so I got temporary around this by creating (and recreating) subnet and k8s clusters until they are in the right order (ugly++)

sennerholm avatar Feb 01 '24 12:02 sennerholm

Hello @danvy and @sennerholm, I do confirm that it is now possible to define the subnet you want to use for your MKS clusters. This is currently available through APIs using the 'nodesSubnetID' parameter (https://eu.api.ovh.com/console/#/cloud/project/%7BserviceName%7D/kube~POST). This is the OpenStack subnet ID that the cluster nodes will use. This files is Optional, can only be set on cluster creation or reset, can only be set if privateNetworkId is also set. If unspecified, it will be selected automatically when the first node is created.

Note that it will be available using the OVHcloud Manager (webUI) and Terraform soon. We will also add another optional parameter 'loadbalancerSubnetID' for users who want to have a dedicated subnet for their Public Cloud Load Balancers used alongside MKS.

antonin-a avatar Feb 06 '24 10:02 antonin-a

We have had some new releases of the provider, but nothing on this yet, any ETA?

sennerholm avatar Mar 12 '24 12:03 sennerholm

We missed this issue anniversary 🎂

danvy avatar Mar 14 '24 16:03 danvy

We are pleased to inform you that our Managed Kubernetes Service (MKS) now supports subnet management in the OVHcloud Control Panel and the Terraform provider.

It will now be possible to specify a subnet for an MKS cluster for the nodes and Octavia Public Load Balancer (optional for advanced user).

nicolaslacroux avatar Aug 21 '24 15:08 nicolaslacroux