(O+P)ut

アウトプット



(O+P)ut

Output Log

【Heapster】Error in scraping containers from kubelet failed to get all container stats from...というエラー

スポンサーリンク

事象

Podのリソース(CPU/Memory)を確認すべくHeapsterをデプロイするも以下エラーで正常に利用ができない。

> kubectl logs -n kube-system heapster-d75f6848c-xbtf7
...
E0505 XX       1 manager.go:101] Error in scraping containers from kubelet:192.168.65.3:10255: failed to get all container stats from Kubelet URL "http://192.168.65.3:10255/stats/container/": Post http://192.168.65.3:10255/stats/container/: dial tcp 192.168.65.3:10255: getsockopt: connection refused
W0505 XX       1 manager.go:152] Failed to get all responses in time (got 0/1)
E0505 XX       1 manager.go:101] Error in scraping containers from kubelet:192.168.65.3:10255: failed to get all container stats from
...
E0505 XX       1 manager.go:101] Error in scraping containers from kubelet:192.168.65.3:10250: failed to get all container stats from Kubelet URL "https://192.168.65.3:10250/stats/container/": Post https://192.168.65.3:10250/stats/container/: x509: cannot validate certificate for 192.168.65.3 because it doesn't contain any IP SANs
環境情報
  • Windows 10 Enterprise
  • Docker Desktop 2.2.0
  • Heapster version v1.5.4

原因/対応策

kubeletにてhttpsが有効になっているのでHeapsterの起動オプションで設定を入れる。

具体的には設定を以下とする。

apiVersion: v1
kind: ServiceAccount
metadata:
  name: heapster
  namespace: kube-system
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: heapster
  namespace: kube-system
spec:
  replicas: 1
  template:
    metadata:
      labels:
        task: monitoring
        k8s-app: heapster
    spec:
      serviceAccountName: heapster
      containers:
      - name: heapster
        image: k8s.gcr.io/heapster-amd64:v1.5.4
        imagePullPolicy: IfNotPresent
        command:
        - /heapster
        - --source=kubernetes:https://kubernetes.default?kubeletHttps=true&kubeletPort=10250&insecure=true
---
apiVersion: v1
kind: Service
metadata:
  labels:
    task: monitoring
    # For use as a Cluster add-on (https://github.com/kubernetes/kubernetes/tree/master/cluster/addons)
    # If you are NOT using this as an addon, you should comment out this line.
    kubernetes.io/cluster-service: 'true'
    kubernetes.io/name: Heapster
  name: heapster
  namespace: kube-system
spec:
  ports:
  - port: 80
    targetPort: 8082
  selector:
    k8s-app: heapster

元ファイルとのdiffは以下。

$ diff heapster-controller.yaml heapster-controller_bk.yaml
27c27
<         - --source=kubernetes:https://kubernetes.default?kubeletHttps=true&kubeletPort=10250&insecure=true
---
>         - --source=kubernetes:https://kubernetes.default

補足

以下を実践している際に起きたエラーです。コマンド実行が成功した結果も以下に記載しています。

以上、同様の事象にお困りな方の参考になれば幸いです。


他の記事を読む