Link a Managed Kubernetes cluster to other services
Create a network with a dedicated server
Use a Selectel global router to organize network connectivity between Managed Kubernetes clusters and a dedicated server.
-
Connect network and subnets to global router to the cloud platform project that hosts the Managed Kubernetes cluster.
-
Create cloud router. When creating, check the box Connect router to external network.
-
Connect global router subnet to cloud router. When connecting, specify a cloud router IP address other than the global router IP address and the
.253
and.254
service addresses. -
For the created global router subnet, see the allocated address pool (
allocation_pool
parameter in the command output):openstack subnet show <subnet_ID>
Specify
<subnet_ID>
— the subnet ID of the global router, can be viewed withopenstack subnet list
. -
Exclude the IP address of the cloud router from the address pool. To do this, delete the address pool allocated to the global router 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>
is the first IP address from the new pool;<last_new_pool_IP>
is the last IP address from the new pool;- multiple pools can be added, each pool is added using the option
--allocation-pool start=<first_pool_IP>,end=<last_pool_IP>
.
-
Assign the IP address of the cloud router 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. -
Check that the
gateway_ip
parameter in the command output matches the IP address of the cloud router:openstack subnet show <subnet_ID>
Note that in the Control Panel, under Network Services → Selectel Global Router, the subnet will show the old gateway.
-
To configure connectivity to a dedicated server, add static routes. To do so, create a ticket and specify in it:
- Project ID — in control panel open the projects menu (name of the current project) and copy the project ID;
- Global Router Subnet ID — in control panel go to Network Services → Selectel Global Router. On the router page, expand the network block, find the desired subnet and and copy the value in the UUID column;
- IP address selected as the subnet gateway on the global router — in control panel go to Network Services → Selectel Global Router. On the router page, expand the network block, find the desired subnet and and copy the value in the Gateway column;
- CIDR of a destination subnet with a dedicated server.
-
Create Managed Kubernetes cluster. When creating, select the subnet of the global router in the Network block.
Create a network with a cloud server
In one project
- Create private network.
- Connect network to router.
- Create Cluster Managed Kubernetes and select the private network created in step 1 as the network.
- Merge to private-network cloud servers.
Between projects
If cloud servers and cluster are in different projects, you need to make the private network of one project available to the other project — such a network is called a cross-project network.
- Create private network.
- Connect network to router.
- Create Cluster Managed Kubernetes and select the private network created in step 1 as the network.
- Make private network crossproject-network.
- In the target project merge to cross-project network cloud servers.
Create a network with cloud databases
Networking a Managed Kubernetes cluster and a cloud database cluster can be done in the same way as a cloud server — in the same project and between projects.