kubernetes cluster-info for a namespace

2/25/2018

I deployed these two services to my cluster under namespace prisma:

kubectl get services -n prisma

NAME       TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)          AGE
database   ClusterIP   10.23.252.18   <none>        3306/TCP         3d
prisma     NodePort    10.23.248.0    <none>        4466:31001/TCP   1d

But when I do cluster-info, it only shows the master and none of my services are showing up:

kubectl cluster-info -n prisma
Kubernetes master is running at https://my-cluster-ip

Is this correct?

I expect to see something like:

Kubernetes master is running at https://my-cluster-ip
Prisma is running at https://my-cluster-ip/api/v1/namespaces/prisma/services/prisma/proxy
...
-- Psidom
google-cloud-platform
kubernetes
prisma

1 Answer

2/25/2018

Yes, that's correct. kubectl cluster-info --help says:

Display addresses of the master and services with label kubernetes.io/cluster-service=true 

That label, under the kubernetes.io "namespace" (referring to the hierarchical syntax used in labels, not to namespace objects in clusters), has special meaning- it is used for services and other resources that are important parts of the cluster machinery, usually packaged and managed as addons. It is not to be used for ordinary tenant services.

If your services fall into the category of cluster infrastructure, you can add that label to them and their related resources. A good example of the use of this label is in the monitoring tool heapster-

https://github.com/kubernetes/kubernetes/blob/master/cluster/addons/cluster-monitoring/influxdb/heapster-controller.yaml

-- Jonah Benton
Source: StackOverflow