应用资源配置清单后,heapster对应的pod始终没有启动。

[root@hdss7-22 ~]# kubectl get pods -n kube-system
NAME                                    READY   STATUS             RESTARTS   AGE
coredns-6b6c4f9648-ddlq8                1/1     Running            0          13d
heapster-b5b9f794-bwz9z                 0/1     ImagePullBackOff   0          10m
kubernetes-dashboard-76dcdb4677-x6r8f   1/1     Running            0          2d5h
traefik-ingress-vpxr7                   1/1     Running            0          2d2h
traefik-ingress-zxw69                   1/1     Running            0          11d

  在dashboard,查看pod状态,报错如下:

k8s交付heapster,启动pod失败,发现是harbor仓库问题_第1张图片

Failed to pull image "harbor.od.com/public/heapster:v1.5.4": rpc error: code = Unknown desc = Error response from daemon: Get http://harbor.od.com/v2/public/heapster/manifests/v1.5.4: Get http://harbor.od.com:180/service/token?scope=repository%3Apublic%2Fheapster%3Apull&service=harbor-registry: dial tcp 10.4.7.200:180: connect: connection timed out

  登录到harbor,报错返回502

[root@hdss7-21 ~]# docker login harbor.od.com
Authenticating with existing credentials...
Login did not succeed, error: Error response from daemon: Get http://harbor.od.com/v2/: Get http://harbor.od.com:180/service/token?account=admin&client_id=docker&offline_token=true&service=harbor-registry: dial tcp 10.4.7.200:180: connect: connection timed out
Username (admin): admin
Password: 
Error response from daemon: login attempt to http://harbor.od.com/v2/ failed with status: 502 Bad Gateway

  重启harbor

[root@hdss7-200 heapster]# cd /opt/harbor
[root@hdss7-200 harbor]# docker-compose ps
      Name                     Command               State             Ports
--------------------------------------------------------------------------------------
harbor-core         /harbor/start.sh                 Up
harbor-db           /entrypoint.sh postgres          Up      5432/tcp
harbor-jobservice   /harbor/start.sh                 Up
harbor-log          /bin/sh -c /usr/local/bin/ ...   Up      127.0.0.1:1514->10514/tcp
harbor-portal       nginx -g daemon off;             Up      80/tcp
nginx               nginx -g daemon off;             Up      0.0.0.0:180->80/tcp
redis               docker-entrypoint.sh redis ...   Up      6379/tcp
registry            /entrypoint.sh /etc/regist ...   Up      5000/tcp
registryctl         /harbor/start.sh                 Up
[root@hdss7-200 harbor]# docker-compose stop
Stopping nginx             ... done
Stopping harbor-jobservice ... done
Stopping harbor-portal     ... done
Stopping harbor-core       ... done
Stopping redis             ... done
Stopping registry          ... done
Stopping harbor-db         ... done
Stopping registryctl       ... done
Stopping harbor-log        ... done
[root@hdss7-200 harbor]# docker-compose ps
      Name                     Command                State     Ports
---------------------------------------------------------------------
harbor-core         /harbor/start.sh                 Exit 137
harbor-db           /entrypoint.sh postgres          Exit 255
harbor-jobservice   /harbor/start.sh                 Exit 137
harbor-log          /bin/sh -c /usr/local/bin/ ...   Exit 137
harbor-portal       nginx -g daemon off;             Exit 0
nginx               nginx -g daemon off;             Exit 0
redis               docker-entrypoint.sh redis ...   Exit 137
registry            /entrypoint.sh /etc/regist ...   Exit 137
registryctl         /harbor/start.sh                 Exit 137
[root@hdss7-200 harbor]# docker-compose rm
Going to remove nginx, harbor-jobservice, harbor-portal, harbor-core, redis, registry, harbor-db, registryctl, harbor-log
Are you sure? [yN] y
Removing nginx             ... done
Removing harbor-jobservice ... done
Creating harbor-log ... done
Removing harbor-core       ... done
Removing redis             ... done
Removing registry          ... done
Creating registry ... done
Creating harbor-core ... done
Removing harbor-log        ... done
Creating harbor-portal ... done
Creating nginx ... done
Creating harbor-db ... 
Creating registry ... 
Creating redis ... 
Creating registryctl ... 
Creating harbor-core ... 
Creating harbor-portal ... 
Creating harbor-jobservice ... 
Creating nginx ... 
[root@hdss7-200 harbor]# docker-compose ps
      Name                     Command               State             Ports
--------------------------------------------------------------------------------------
harbor-core         /harbor/start.sh                 Up
harbor-db           /entrypoint.sh postgres          Up      5432/tcp
harbor-jobservice   /harbor/start.sh                 Up
harbor-log          /bin/sh -c /usr/local/bin/ ...   Up      127.0.0.1:1514->10514/tcp
harbor-portal       nginx -g daemon off;             Up      80/tcp
nginx               nginx -g daemon off;             Up      0.0.0.0:180->80/tcp
redis               docker-entrypoint.sh redis ...   Up      6379/tcp
registry            /entrypoint.sh /etc/regist ...   Up      5000/tcp
registryctl         /harbor/start.sh                 Up

  登录harbor恢复正常:

[root@hdss7-21 ~]# docker login harbor.od.com
Authenticating with existing credentials...
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
 
Login Succeeded

  heapster启动成功:

[root@hdss7-22 ~]# kubectl get pods -n kube-system
NAME                                    READY   STATUS    RESTARTS   AGE
coredns-6b6c4f9648-ddlq8                1/1     Running   0          14d
heapster-b5b9f794-wl7wh                 1/1     Running   0          15h
kubernetes-dashboard-76dcdb4677-x6r8f   1/1     Running   0          2d23h
traefik-ingress-vpxr7                   1/1     Running   0          2d20h
traefik-ingress-zxw69                   1/1     Running   0          12d


  感谢老男孩黄导和他的沃佳云平台。