Connect a Managed Kubernetes cluster on a cloud server with other Selectel products
Create a network with a dedicated server
Use a Selectel global router to organize network connectivity between Managed Kubernetes clusters on a cloud server and a dedicated server.
-
Connect the network and subnet to the global router to the Cloud Platform project where the Managed Kubernetes cluster is located.
-
Create a cloud router. When creating it, check the Connect router to the Internet checkbox.
-
Connect the subnet you connected to the global router in step 2 to the cloud router.
-
For the subnet you connected to the cloud router in step 4, check the allocated address pool (the
allocation_poolparameter in the command output):openstack subnet show <subnet_ID>Specify
<subnet_ID>— the subnet ID, which can be viewed usingopenstack subnet list. -
Exclude the Cloud Router IP address from the address pool. To do this, delete the address pool allocated for the subnet and add a new pool without the Cloud Router IP address:
openstack subnet set --no-allocation-pool \--allocation-pool start=<first_pool_IP>,end=<last_pool_IP> \<subnet_ID>Specify:
<first_new_pool_IP>— the first IP address from the new pool;<last_new_pool_IP>— the last IP address from the new pool;- you can add multiple pools, each pool is added using the
--allocation-pool start=<first_pool_IP>,end=<last_pool_IP>option.
-
Set the cloud router IP address as the default gateway so that traffic is sent to the cloud router:
openstack subnet set --gateway <cloud_router_IP> <subnet_ID>Specify
<cloud_router_IP>— the IP address of the cloud router. -
Verify that the
gateway_ipparameter in the command output matches the cloud router IP address:openstack subnet show <subnet_ID>Please note that in the control panel, in the top menu Products → Global Router, the old gateway will be displayed for the subnet.
-
To configure connectivity with a dedicated server, add static routes. To do this, submit a ticket and specify the following:
- Project ID. You can find it in the control panel: open the project menu (name of the current project) and copy the project ID;
- ID of the subnet you connected to the cloud router in step 4. You can find it in the control panel: in the top menu, click Products → Global Router → router page → open the network block → in the subnet line, copy the value in the UUID column;
- IP address selected as the subnet gateway on the global router. You can find it in the control panel: in the top menu, click Products → Global Router → router page → open the network block → in the subnet line, copy the value in the Gateway column;
- CIDR of the destination subnet with the dedicated server.
-
Create a Managed Kubernetes cluster. When creating it, in the Network block, select the network you connected to the cloud router in step 4.
Create a network with a cloud server
In one project
- Create a private network and subnet.
- Connect the private subnet to the cloud router.
- Create a cluster in Managed Kubernetes and select the private subnet you created in step 1 as the subnet.
- Add cloud servers to the subnet.
Between projects
If the cloud servers and cluster are in different projects, you need to make the private network of one project available to another project — such a network is called cross-project.
- Create a private network and subnet.
- Connect the private subnet to the cloud router.
- Create a cluster in Managed Kubernetes and select the private subnet you created in step 1 as the subnet.
- Configure access to a private network across projects.
- In the target project, add cloud servers to the subnet.
Create a network with Managed Databases
You can connect a Managed Kubernetes cluster and a Cloud Databases cluster to the network in the same way as a cloud server — in one project and between projects.