目录
1、遇到问题
2、问题解决
2.1 查看docker服务
2.2 增加docker中国镜像源
必看项
2.3 解决docker pull失败
3、结果展示
1、遇到问题
安装部署完k3s时遇到如下问题:
sudo kubectl get pods -A
pod 容器状态一直为:ContainerCreating
查看容器详情信息:
sudo kubectl describe pods metrics-server-668d979685-rhbh6 -n kube-system
遇到问题:
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 5m11s default-scheduler Successfully assigned kube-system/metrics-server-668d979685-rhbh6 to localhost.localdomain
Warning FailedCreatePodSandBox 4m56s kubelet Failed to create pod sandbox: rpc error: code = Unknown desc = failed pulling image "rancher/mirrored-pause:3.6": error pulling image configuration: Get "https://production.cloudflare.docker.com/registry-v2/docker/registry/v2/blobs/sha256/7d/7d46a07936af93fcce097459055f93ab07331509aa55f4a2a90d95a3ace1850e/data?verify=1672027160-keVEaE4%2FLeKMYh1VCk7Ci9SDd1I%3D": net/http: TLS handshake timeout
Warning FailedCreatePodSandBox 4m24s kubelet Failed to create pod sandbox: rpc error: code = Unknown desc = failed pulling image "rancher/mirrored-pause:3.6": error pulling image configuration: Get "https://production.cloudflare.docker.com/registry-v2/docker/registry/v2/blobs/sha256/7d/7d46a07936af93fcce097459055f93ab07331509aa55f4a2a90d95a3ace1850e/data?verify=1672027192-zlAWIYprgyd%2FUKYt2bEMLmA%2FSMw%3D": net/http: TLS handshake timeout
Warning FailedCreatePodSandBox 3m55s kubelet Failed to create pod sandbox: rpc error: code = Unknown desc = failed pulling image "rancher/mirrored-pause:3.6": error pulling image configuration: Get "https://production.cloudflare.docker.com/registry-v2/docker/registry/v2/blobs/sha256/7d/7d46a07936af93fcce097459055f93ab07331509aa55f4a2a90d95a3ace1850e/data?verify=1672027221-Yq1yTvMAAEsT%2F%2B7sZ6tcNjfLrmw%3D": net/http: TLS handshake timeout
Warning FailedCreatePodSandBox 3m26s kubelet Failed to create pod sandbox: rpc error: code = Unknown desc = failed pulling image "rancher/mirrored-pause:3.6": error pulling image configuration: Get "https://production.cloudflare.docker.com/registry-v2/docker/registry/v2/blobs/sha256/7d/7d46a07936af93fcce097459055f93ab07331509aa55f4a2a90d95a3ace1850e/data?verify=1672027249-OUpAIbTr%2FeNPxuS4K9fXE6ExeDo%3D": net/http: TLS handshake timeout
Warning FailedCreatePodSandBox 3m kubelet Failed to create pod sandbox: rpc error: code = Unknown desc = failed pulling image "rancher/mirrored-pause:3.6": error pulling image configuration: Get "https://production.cloudflare.docker.com/registry-v2/docker/registry/v2/blobs/sha256/7d/7d46a07936af93fcce097459055f93ab07331509aa55f4a2a90d95a3ace1850e/data?verify=1672027275-u3KeZfKCsU7Y0rscReiQSUKNPFs%3D": net/http: TLS handshake timeout
Warning FailedCreatePodSandBox 2m34s kubelet Failed to create pod sandbox: rpc error: code = Unknown desc = failed pulling image "rancher/mirrored-pause:3.6": error pulling image configuration: Get "https://production.cloudflare.docker.com/registry-v2/docker/registry/v2/blobs/sha256/7d/7d46a07936af93fcce097459055f93ab07331509aa55f4a2a90d95a3ace1850e/data?verify=1672027301-ABta5R0hXlxC%2FRv5fCAp7yVVfH4%3D": net/http: TLS handshake timeout
Warning FailedCreatePodSandBox 2m6s kubelet Failed to create pod sandbox: rpc error: code = Unknown desc = failed pulling image "rancher/mirrored-pause:3.6": error pulling image configuration: Get "https://production.cloudflare.docker.com/registry-v2/docker/registry/v2/blobs/sha256/7d/7d46a07936af93fcce097459055f93ab07331509aa55f4a2a90d95a3ace1850e/data?verify=1672027329-Uvrv%2BBKeZPehE%2FwpIAouHEOVn28%3D": net/http: TLS handshake timeout
Warning FailedCreatePodSandBox 101s kubelet Failed to create pod sandbox: rpc error: code = Unknown desc = failed pulling image "rancher/mirrored-pause:3.6": error pulling image configuration: Get "https://production.cloudflare.docker.com/registry-v2/docker/registry/v2/blobs/sha256/7d/7d46a07936af93fcce097459055f93ab07331509aa55f4a2a90d95a3ace1850e/data?verify=1672027354-1547OVYolgxIu1H2cxB%2Fcr4lhX4%3D": net/http: TLS handshake timeout
Warning FailedCreatePodSandBox 74s kubelet Failed to create pod sandbox: rpc error: code = Unknown desc = failed pulling image "rancher/mirrored-pause:3.6": error pulling image configuration: Get "https://production.cloudflare.docker.com/registry-v2/docker/registry/v2/blobs/sha256/7d/7d46a07936af93fcce097459055f93ab07331509aa55f4a2a90d95a3ace1850e/data?verify=1672027381-R2CnKvNtdGFyn0Yh5ssZtcaWyHU%3D": net/http: TLS handshake timeout
Warning FailedCreatePodSandBox 16s (x2 over 47s) kubelet (combined from similar events): Failed to create pod sandbox: rpc error: code = Unknown desc = failed pulling image "rancher/mirrored-pause:3.6": error pulling image configuration: Get "https://production.cloudflare.docker.com/registry-v2/docker/registry/v2/blobs/sha256/7d/7d46a07936af93fcce097459055f93ab07331509aa55f4a2a90d95a3ace1850e/data?verify=1672027439-0p6%2Bu9IXV%2Fr%2Fly3U0EU%2B2yhLaTs%3D": net/http: TLS handshake timeout
2、问题解决
2.1 查看docker服务
sudo systemctl status docker
2.2 增加docker中国镜像源
sudo vi /etc/docker/daemon.json
{
"registry-mirrors":["https://hub-mirror.c.163.com","https://registry.aliyuncs.com","https://registry.docker-cn.com","https://docker.mirrors.ustc.edu.cn"]
}
必看项
最好是把daemon.json文件先建立好。
然后把文件放到/etc/docker/目录下。
最好去重启docker。
2.3 解决docker pull失败
重启docker服务。
sudo systemctl restart docker
即可拉取镜像!!!
3、结果展示
如果容器状态还没有改变,建议重新安装k3s。再次尝试。