Skip to main content
Link a Managed Kubernetes cluster to other services
Last update:

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.

  1. Create a global router.

  2. Connect the network and subnet to the global router to the project that hosts the Managed Kubernetes cluster.

  3. Create a cloud router. When creating, check the checkbox Connect the router to an external network.

  4. 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.

  5. For the created subnet of the global router, view the allocated address pool (parameter allocation_pool in the output of the command):

    openstack subnet show <subnet_ID>

    Specify <subnet_ID> — The subnet ID of the global router, can be viewed using openstack subnet list.

  6. 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;
    • several pools can be added, each pool is added using the option --allocation-pool start=<first_pool_IP>,end=<last_pool_IP>.
  7. 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.

  8. Check that the parameter gateway_ip in the command output corresponds to the IP address of the cloud router:

    openstack subnet show <subnet_ID>

    Note that in the Control Panel, under Network servicesSelectel Global Router the subnet will show the old gateway.

  9. To configure connectivity to a dedicated server, add static routes. To do this file a ticket and point it out:

    • The project ID is in control panels open the projects menu (name of the current project) and copy the project ID;
    • The subnet ID of the global router is in the control panels go to Network servicesSelectel Global Router. On the router page, expand the network block, find the desired subnet and copy the value in the column UUID;
    • The IP address selected as the subnet gateway on the global router — in the control panels go to Network servicesSelectel Global Router. On the router page, expand the network block, find the desired subnet and copy the value in the column Gateway;
    • CIDR of a destination subnet with a dedicated server.
  10. Create a Managed Kubernetes cluster. When creating, select in the block Network subnet of the global router.

Create a network with a cloud server

In one project.

  1. Create a private network and subnet.
  2. Connect a private subnet to the cloud router.
  3. Create a cluster Managed Kubernetes and select the private subnet created in step 1 as the subnet.
  4. 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.

  1. Create a private network and subnet.
  2. Connect a private subnet to the cloud router.
  3. Create a cluster Managed Kubernetes and select the private subnet created in step 1 as the subnet.
  4. Configure private network access in different projects.
  5. 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.