What is URL for Kibana UI
The most common way to expose internal server outside the cluster is an Ingress.
First, you need to have an Ingress controller running in your Kubernetes cluster.
There are two types of maintained Ingress controllers - GCE and nginx
Then, you need to create a yaml file as shown below and change it according to your needs:
apiVersion: extensions/v1beta1kind: Ingressmetadata: name: test-ingressspec: backend: serviceName: testsvc servicePort: 80
When you create it using kubectl create -f
, you should see something like this:
$ kubectl get ingressNAME RULE BACKEND ADDRESStest-ingress - testsvc:80 1.2.3.4
In this example, 1.2.3.4
is the IP allocated by Ingress controller.
When you have all things in place, you'll be able to access your application (Kibana) by IP 1.2.3.4
Please find more examples and use cases in Ingress documentation
You can also expose a Kubernetes service without using the Ingress resource:
I got it to work with these changes in ingress config
apiVersion: extensions/v1beta1 kind: Ingress metadata: name: kube namespace: kube-system annotations: kubernetes.io/ingress.class: nginx nginx.org/rewrites: "serviceName=kubernetes-dashboard rewrite=/;serviceName=kibana-logging rewrite=/"spec: rules: - host: HOSTNAME_OF_MASTER http: paths: - path: /kube-ui/ backend: serviceName: kubernetes-dashboard servicePort: 80 - path: /kibana/ backend: serviceName: kibana-logging servicePort: 5601
and my Kibana serive is setup as Nodeport
apiVersion: v1kind: Servicemetadata: name: kibana-logging namespace: kube-system labels: k8s-app: kibana-logging kubernetes.io/cluster-service: "true" addonmanager.kubernetes.io/mode: Reconcile kubernetes.io/name: "Kibana"spec: type: NodePort ports: - port: 5601 protocol: TCP targetPort: ui selector: k8s-app: kibana-logging
and dashboard is also configured as this
# ------------------- Dashboard Service ------------------- #kind: ServiceapiVersion: v1metadata: labels: k8s-app: kubernetes-dashboard name: kubernetes-dashboard namespace: kube-systemspec: type: NodePort ports: - port: 80 targetPort: 9090 selector: k8s-app: kubernetes-dashboard
once you have the svc running you can access kibana using the NodePort from any node. Example: http://node01_ip: 31325/app/kibana
$ kubectl get svc -o wide -n=kube-systemNAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTORelasticsearch-logging ClusterIP 10.xx.120.130 <none> 9200/TCP 11h k8s-app=elasticsearch-loggingheapster ClusterIP 10.xx.232.165 <none> 80/TCP 11h k8s-app=heapsterkibana-logging NodePort 10.xx.39.255 <none> 5601:31325/TCP 11h k8s-app=kibana-loggingkube-dns ClusterIP 10.xx.0.xx <none> 53/UDP,53/TCP 12h k8s-app=kube-dnskubernetes-dashboard NodePort 10.xx.xx.xx <none> 80:32086/TCP 11h k8s-app=kubernetes-dashboardmonitoring-influxdb ClusterIP 10.13.199.138 <none> 8086/TCP 11h k8s-app=influxdb