Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you find the cluster & service CIDR of a Kubernetes cluster?

How do you find the cluster/service CIDR for a Kubernetes cluster, once it is already running?

I know for Minikube, it is 10.0.0.1/24.

For GKE, you can find out via

gcloud container clusters describe XXXXXXX --zone=XXXXXX |   grep -e clusterIpv4Cidr -e servicesIpv4Cidr 

But how do you find out on a generic Kubernetes cluster, particularly via kubectl?

like image 267
richizy Avatar asked May 25 '17 22:05

richizy


People also ask

What is cluster value?

Cluster values automatically create groups with similar values using a fuzzy matching algorithm, and then maps each column's value to the best-matched group.

What is cluster give example?

The definition of a cluster is a group of people or things gathered or growing together. A bunch of grapes is an example of a cluster. A bouquet of flowers is an example of a cluster. noun.


1 Answers

Get Services IPs range

kubectl cluster-info dump | grep -m 1 service-cluster-ip-range 

You will see something like e.g. --service-cluster-ip-range=xxx.yy.0.0/13

Get Pods IPs range

kubectl cluster-info dump | grep -m 1 cluster-cidr 

You will see something like e.g. --cluster-cidr=xxx.yy.0.0/11

like image 187
Vasilis Vasilatos Avatar answered Sep 24 '22 06:09

Vasilis Vasilatos