Access Resources in Kubernetes cluster ClusterIP -> LoadBalancer
Quote from moshe on 09/12/2021, 10:03 amProblem
User working with Prometheus installed in kubernetes in a cluster environment cannot see the metrics / alerts /graphs / status management page.
Solution
Need to Change the type of the service from ClusterIP to NodePort in order to expose the service on the cluster IP
List all your Kubernetes services in monitoring namespace
kubectl get svc
get your service name for example: prometheus-grafana
run the following command
kubectl patch svc prometheus-grafana -p ‘{“spec”: {“type”: “LoadBalancer”}}’
run the command again
kubectl get svc
look for prometheus-grafana entry
prometheus-grafana LoadBalancer 10.100.203.207 promethues-grafana.us-east-1.elb.amazonaws.com 80:30355/TCP
Access it using browser
http://promethues-grafana.us-east-1.elb.amazonaws.com :30355
Problem
User working with Prometheus installed in kubernetes in a cluster environment cannot see the metrics / alerts /graphs / status management page.
Solution
Need to Change the type of the service from ClusterIP to NodePort in order to expose the service on the cluster IP
List all your Kubernetes services in monitoring namespace
kubectl get svc
get your service name for example: prometheus-grafana
run the following command
kubectl patch svc prometheus-grafana -p ‘{“spec”: {“type”: “LoadBalancer”}}’
run the command again
kubectl get svc
look for prometheus-grafana entry
prometheus-grafana LoadBalancer 10.100.203.207 promethues-grafana.us-east-1.elb.amazonaws.com 80:30355/TCP
Access it using browser
Uploaded files:http://promethues-grafana.us-east-1.elb.amazonaws.com :30355