Kubernetes: redundancy of the service-cluster-ip-subband for manual distribution

When creating a service, I can either specify a static IP address from the range of cluster IP addresses, or not specify any IP address, in which case such an address will be dynamically assigned.

But when a static IP address is specified, how can I make sure that it will not conflict with an existing dynamically assigned IP address? I could, for example, program a request if such an IP address is already in use. Or, what I prefer more is to specify an IP range that is cluster-reserved for manual distribution. for instance

  • IP Services Range: 10.20.0.0/16
  • Manual IP Services Range: 10.20.5.0/24

Now I can manage the IP address in the range of 10.20.5.0-10.22.5.255 myself, and the kubernetes can use the remaining pool for dynamic allocation. As usual, DHCP / IP static range works on home routers.

Is this scenario possible in quaternets?

+4
source share
1 answer

The IP address of the service that you select manually must be part of the selected range, or you will receive a response invalid(422) from the kubernetes. kubernetes documentation has a choice of your own ip section for services. If you have administrator rights for the cluster, the easiest option will be to perform kubectl get services --all-namespaces, which will show you each service provided in your cluster, indicating the corresponding CLUSTER-IP.

+1

Source: https://habr.com/ru/post/1687121/


All Articles