Connect a Managed Kubernetes cluster on a cloud server to other Servercore products
Create a network with a dedicated server
Use a Servercore global router to organize network connectivity between Managed Kubernetes clusters on a cloud server and a dedicated server.
-
Connect a 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 internet checkbox.
-
For the created global router subnet, view the allocated address pool (the
allocation_poolparameter in the command output):openstack subnet show <subnet_ID>Specify
<subnet_ID>— the global router 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 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; ;- you can add multiple pools, each 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 cloud router IP address. -
Check that the
gateway_ipparameter in the command output corresponds to the cloud router IP address:openstack subnet show <subnet_ID>Note that in the control panel, in the top menu Products → Global Router, the subnet will show the old gateway.
-
To configure connectivity with a dedicated server, add static routes. To do this, create a ticket and specify the following in it:
- Project ID — in the control panel, open the list of projects in the Project field and copy the project ID; ;
- Global router subnet ID — in the control panel, in the top menu click Products and select Global Router. On the router page, open the network block, find the required subnet, and copy the value in the UUID column;
- IP address chosen as the subnet gateway on the global router — in the control panel, in the top menu click Products and select Global Router. On the router page, open the network block, find the required subnet, and copy the value in the Gateway column;
- CIDR of the destination subnet with the dedicated server.
-
Create a Managed Kubernetes cluster. During creation, select the global router subnet in the Network block.
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 Managed Kubernetes cluster 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 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 Managed Kubernetes cluster and select the private subnet created in step 1 as the subnet.
- Configure access to the private network across different projects.
- In the target project, add cloud servers to the subnet.
Create a network with Managed Databases
Networking a Managed Kubernetes cluster and a Managed Database cluster can be done in the same way as a cloud server — in the same project and between projects.