Accessing the Kubecost dashboard

Let's follow these instructions to access the Kubecost dashboard where you can monitor your Kubernetes resources and their costs in real time:

  1. Get the list of the services in the kubecost namespace: 
$ kubectl get svc -nkubecost
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubecost-cost-analyzer ClusterIP 100.65.53.41 <none> 9001/TCP,9003/TCP,9090/TCP 13m
kubecost-grafana ClusterIP 100.69.52.23 <none> 80/TCP 13m
kubecost-prometheus-alertmanager ClusterIP 100.71.217.248 <none> 80/TCP 13m
kubecost-prometheus-kube-state-metrics ClusterIP None <none> 80/TCP 13m
kubecost-prometheus-node-exporter ClusterIP None <none> 9100/TCP 13m
kubecost-prometheus-pushgateway ClusterIP 100.69.137.163 <none> 9091/TCP 13m
kubecost-prometheus-server ClusterIP 100.64.7.82 <none> 80/TCP 13m

  1. Create a port forwarding to access the Kubecost UI using the kubectl port-forward command. This command will forward the local port 9090 to the Kubecost cost analyzer pod:
$ kubectl port-forward --namespace kubecost deployment/kubecost-cost-analyzer 9090
As an alternative, you can patch the kubecost-cost-analyzer service using the kubectl edit svc kubecost-cost-analyzer -nkubecost command and change the service type ClusterIP to LoadBalancer to expose the service externally using a cloud load balancer.
  1. Open the address http://localhost:9090 (or the External IP, if using LoadBalancer) in your web browser. You should see the Kubecost login page:

  1. The dashboard can be expanded by adding additional Kubecost endpoints into one and used to monitor multiple clusters from a single dashboard. If you have more than one cluster, click on the add new cluster icon and add your endpoint URLs from the other clusters:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.133.160