metrics-server: Failed to get kubernetes address: No kubernetes source found

ENV:

centos7x86_64
Linux master 3.10.0-862.9.1.el7.x86_64
k8s v1.11.1
metrics-server 0.2.x

When I run the command of README, some error messages print.

# Kubernetes > 1.8
$ kubectl create -f deploy/1.8+/


#error pod logs
I0810 06:39:00.946780       1 heapster.go:71] /metrics-server
I0810 06:39:00.946833       1 heapster.go:72] Metrics Server version v0.2.1
F0810 06:39:00.946840       1 heapster.go:79] Failed to get kubernetes address: No kubernetes source found.


#deployment status
metrics-server
Back-off restarting failed container


#container
metrics-server-f5bc46bd7-hx8dc
Back-off restarting failed container



Maybe it can’t find the api-server addr,or the authorization is forbidden?

the kube-apiserve is running on 6443 port.


Are there have any docs i can read?

Thanks.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 2
  • Comments: 26 (3 by maintainers)

Commits related to this issue

Most upvoted comments

it seems because deploy/1.8+/metrics-server-deployment.yaml doesn’t have any options.

I’ve started metrics-server by adding “source” option referenced from https://github.com/kubernetes/heapster/blob/master/deploy/kube-config/google/heapster.yaml

+++ b/deploy/1.8+/metrics-server-deployment.yaml
@@ -31,6 +31,9 @@ spec:
       - name: metrics-server
         image: gcr.io/google_containers/metrics-server-amd64:v0.2.1
         imagePullPolicy: Always
+        command:
+        - /metrics-server
+        - --source=kubernetes:https://kubernetes.default
         volumeMounts:
         - name: tmp-dir
           mountPath: /tmp

maybe metrics-server needs any other options too, please make sure what kind of options have to be added.

ADDITION: this problem happens after the commit https://github.com/kubernetes-incubator/metrics-server/commit/a823af80d438d642c29e038ca5336004b2a8b97e. @DirectXMan12 , would you check this problem?

@unclok bingo!

Thank you so much.


I campare deploy/1.8+/metrics-server-deployment.yaml and https://github.com/kubernetes/heapster/blob/master/deploy/kube-config/google/heapster.yaml.

But just add the options you writed is running well.

here is the full deploy/1.8+/metrics-server-deployment.yaml

  1 ---
  2 apiVersion: v1
  3 kind: ServiceAccount
  4 metadata:
  5   name: metrics-server
  6   namespace: kube-system
  7 ---
  8 apiVersion: extensions/v1beta1
  9 kind: Deployment
 10 metadata:
 11   name: metrics-server
 12   namespace: kube-system
 13   labels:
 14     k8s-app: metrics-server
 15 spec:
 16   selector:
 17     matchLabels:
 18       k8s-app: metrics-server
 19   template:
 20     metadata:
 21       name: metrics-server
 22       labels:
 23         k8s-app: metrics-server
 24     spec:
 25       serviceAccountName: metrics-server
 26       volumes:
 27       # mount in tmp so we can safely use from-scratch images and/or read-only containers
 28       - name: tmp-dir
 29         emptyDir: {}
 30       containers:
 31       - name: metrics-server
 32         image: gcr.io/google_containers/metrics-server-amd64:v0.2.1
 33         imagePullPolicy: Always
 34         #issue-97 start
 35         command:
 36         - /metrics-server
 37         - --source=kubernetes:https://kubernetes.default
 38         #issue-97 end
 39         volumeMounts:
 40         - name: tmp-dir
 41           mountPath: /tmp
 42 

Same problem here with the same versions as the reporter:

centos7x86_64 Linux master 3.10.0-862.9.1.el7.x86_64 k8s v1.11.1 metrics-server 0.2.x