Skip to content

Instantly share code, notes, and snippets.

@mowings
Last active December 10, 2019 23:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mowings/8585c60156942668db05abf3102198d0 to your computer and use it in GitHub Desktop.
Save mowings/8585c60156942668db05abf3102198d0 to your computer and use it in GitHub Desktop.
kubernetes-metrics. kubectl top pod -- cannot find pod

The deployjent yaml typically does not work out of the box. Fix deploy/1.8+/metrics-server-deployment.yaml as follows:

      containers:
      - name: metrics-server
        image: k8s.gcr.io/metrics-server-amd64:v0.3.6
        args:
          - --cert-dir=/tmp
          - --secure-port=4443
          - --kubelet-insecure-tls
          - --kubelet-preferred-address-types=InternalIP

You are adding a couple of commands to the metrics server, instead of using the defaults, which appear to not work in most places. After editing this file

kubectl apply -f deployments/1.8+ # per docs

After a minute or so, you should be able to get metrics

Be sure metrics are running prior to installing the kubernetes-dashboard. If not, you will need to force restart both the dashboard metrics scraper AND the dashboard pods

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment