Installing the Metrics Server 

The Metrics Server is required if we need to run kubectl commands to show the metrics:

$ helm install stable/metrics-server --name metrics --namespace kube-system --set fullnameOverride="metrics" --set args="{--logtostderr,--kubelet-insecure-tls,--kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname}"

To install the Metrics Server, follow these steps:

  1. Make sure that the v1beta1.metrics.k8s.io service is available:
$ kubectl get apiservice v1beta1.metrics.k8s.io
NAME SERVICE AVAILABLE AGE
v1beta1.metrics.k8s.io kube-system/metrics True 13m

If the service shows FailedDiscoveryCheck or MissingEndpoints, it might be the firewall issue. Make sure that HTTPS is enabled through the firewall.

If the AVAILABLE column shows False (MissingEndpoints), wait for the endpoints to become available. Try the preceding command again and make sure that the AVAILABLE column shows True for the  v1beta1.metrics.k8s.io API service.

  1. Run the following:
$ kubectl get --raw "/apis/metrics.k8s.io/v1beta1/nodes"

Please wait a few minutes and run the kubectl top nodes or kubectl top pods -A command to show the output.

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

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