我正在尝试使用kubeadm安装Kubernetes后创建一个水平pod自动缩放.
主要症状是kubectl get hpa将列中的CPU指标返回TARGETS为"undefined":
$ kubectl get hpa
NAME REFERENCE TARGETS MINPODS MAXPODS REPLICAS AGE
fibonacci Deployment/fibonacci <unknown> / 50% 1 3 1 1h
Run Code Online (Sandbox Code Playgroud)
在进一步调查中,似乎hpa正在尝试从Heapster接收CPU指标 - 但在我的配置中,cpu指标由cAdvisor提供.
我根据以下输出做出这个假设kubectl describe hpa fibonacci:
Name: fibonacci
Namespace: default
Labels: <none>
Annotations: <none>
CreationTimestamp: Sun, 14 May 2017 18:08:53 +0000
Reference: Deployment/fibonacci
Metrics: ( current / target )
resource cpu on pods (as a percentage of request): <unknown> / 50%
Min replicas: 1
Max replicas: 3 …Run Code Online (Sandbox Code Playgroud)