public-cloud-roadmap
public-cloud-roadmap copied to clipboard
Kubernetes Cluster - specifying a private subnet
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.
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
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?
Yes indeed
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.
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.
Hi @LisaPerrier Any update ?
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++)
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.
We have had some new releases of the provider, but nothing on this yet, any ETA?
We missed this issue anniversary 🎂
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).