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 the network and subnet to the global router to the project that hosts the Managed Kubernetes cluster.
-
Create a cloud router. When creating it, check the box Connect the router to an external network.
-
Connect the subnet of the global router to the cloud router. When connecting, specify a cloud router IP address other than the global router IP address and service addresses
.253
и.254
. -
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 with theopenstack subnet list
command. -
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>
— the first IP address from the new pool;<last_new_pool_IP>
— the last IP address from the new pool;- multiple pools can be added, each pool is added using the
--allocation-pool
optionstart=<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 Global Router, the subnet will show the old gateway.
-
To configure connectivity to a dedicated server, add static routes. To do this, create a ticket and specify in it:
- ID of the project where the Managed Kubernetes cluster is located. You can copy it in the control panel: in the top menu click Products → Managed Kubernetes → open the projects menu (name of the current project) → in the project line click ;
- The subnet ID of the global router. You can copy it in the control panel: from the top menu, click Products → Global Router → Router page → open the network card → in the subnet row in the UUID column, click ;
- The IP address selected as the subnet gateway on the global router. You can copy in the control panel: in the top menu Products → Global Router → Router page → open the network card → in the subnet row in the Gateway column, click ;
- CIDR of a destination subnet with a dedicated server.
-
Create a Managed Kubernetes cluster. When creating, select in the Network subnet of the global router.
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 Managed Kubernetes and select the private subnet created in step 1 as the subnet.
- Add cloud servers to the subnet.
Between projects
If the cloud servers and the cluster are in different projects, you need to make the private network of one project available to the other project — this is called cross-project networking.
- Create a private network and subnet.
- Connect the private subnet to the cloud router.
- Create a cluster Managed Kubernetes and select the private subnet created in step 1 as the subnet.
- Configure private network access in different projects.
- In the target project, add cloud servers to the subnet.
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.