Why service does not have any active Endpoint when install grafana from helm to kubernetes-sigs/kind?

6/29/2019

https://github.com/kubernetes-sigs/kind - version 0.4.0 Create kubernetes from kubernetes-sigs/kind

kind create cluster
Creating cluster "kind" ...
 ✓ Ensuring node image (kindest/node:v1.15.0) 

kubectl create serviceaccount

kubectl create serviceaccount --namespace kube-system tiller
serviceaccount/tiller created

kubectl create clusterrolebinding

kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
clusterrolebinding.rbac.authorization.k8s.io/tiller-cluster-rule created

kubectl patch deploy

kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'
deployment.extensions/tiller-deploy patched


helm init

helm install stable/nginx-ingress

helm install --name grafana stable/grafana --set=ingress.enabled=True,ingress.hosts={grafana.domain.com} --namespace demo --set rbac.create=true

kubectl logs loping-wallaby-nginx-ingress-controller-76d574f8b7-5m6n5

W0629 17:13:59.709497       6 controller.go:797] Service "demo/grafana" does not have any active Endpoint.
[29/Jun/2019:17:14:03 +0000]TCP200000.000
I0629 17:14:45.223234       6 status.go:295] updating Ingress demo/grafana status from [] to [{ }]
I0629 17:14:45.226343       6 event.go:209] Event(v1.ObjectReference{Kind:"Ingress", Namespace:"demo", Name:"grafana", UID:"228cde81-cb97-4313-ad86-90a273b2206d", APIVersion:"extensions/v1beta1", ResourceVersion:"1938", FieldPath:""}): type: 'Normal' reason: 'UPDATE' Ingress demo/grafana

kubectl get ingress --all-namespaces

NAMESPACE   NAME      HOSTS                ADDRESS   PORTS   AGE
demo        grafana   grafana.domain.com             80      3m58s

kubectl get svc --all-namespaces -l app=grafana

NAMESPACE   NAME      TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)   AGE
default     grafana   ClusterIP   10.104.203.243   <none>        80/TCP    24m

kubectl get endpoints

NAME                                           ENDPOINTS                      AGE
grafana                                        10.244.0.10:3000               21m
kubernetes                                     172.17.0.2:6443                56m
loping-wallaby-nginx-ingress-controller        10.244.0.8:80,10.244.0.8:443   48m
loping-wallaby-nginx-ingress-default-backend   10.244.0.7:8080                48m

Thanks!

-- Anton Patsev
kubernetes
kubernetes-helm

2 Answers

7/2/2019

A few concerns about your current scenario:

  1. You have to check installed nginx-ingress helm chart in order to find out why grafana service resides in separate namespace default and not in demo namespace as per helm deploy parameter --namespace demo.

  2. Since you have not specified in helm install command controller.service.type parameter, Nginx Ingress Controller would be implemented with LoadBalancer type of relevant service, in this case Ingress Controller expects to receive external IP address using cloud provider’s load balancer and I assume that your current kubernetes provisioner kubernetes-sigs/kind is not a good choice to adopt outward access to the Kubernetes cluster. Therefore, I would suggest to use NodePort service for Nginx Ingress controller in order to expose 80 and 443 port on some specific port in the host machine.

    helm install --name grafana stable/grafana --set=ingress.enabled=True,ingress.hosts={grafana.domain.com} --namespace demo --set rbac.create=true --controller.service.type=NodePort

  3. Issue that you mentioned is more like harmless and doesn't significantly affect the Nginx Ingress Controller's functionality, because it means that for some short period of time Liveness probe for Grafana Pod has not been initiated and target enpoint has not been released during Grafana Helm chart deploy. You can even re-spawn Nginx Ingress controller Pod to justify my assumption.

-- mk_sta
Source: StackOverflow

6/30/2019

you are using type of service as "ClusterIp" , so you will not get external Ip address. Change the Service type to "Loadbalancer" then you get Ip address which you can browse through internet.

-- Chakith
Source: StackOverflow