我已经在 ubuntu(arm64 位版本)上安装了 microk8s,我想访问由microk8s enable registry
. 但是我得到一个 ImagePullBackOff 错误,我试图修改/var/snap/microk8s/current/args/containerd.toml
配置,但它不起作用:
[plugins.cri.registry]
[plugins.cri.registry.mirrors]
[plugins.cri.registry.mirrors."docker.io"]
endpoint = ["https://registry-1.docker.io"]
[plugins.cri.registry.mirrors."localhost:32000"]
endpoint = ["http://localhost:32000"]
[plugins.cri.registry.mirrors."192.168.0.45:32000"]
endpoint = ["http://192.168.0.45:32000"]
[plugins.cri.registry.configs."192.168.0.45:32000".tls]
insecure_skip_verify = true
我的吊舱状态:
microk8s.kubectl describe pod myapp-7d655f6ccd-gpgkx
Name: myapp-7d655f6ccd-gpgkx
Namespace: default
Priority: 0
Node: 192.168.0.66/192.168.0.66
Start Time: Mon, 15 Mar 2021 16:53:30 +0000
Labels: app=myapp
pod-template-hash=7d655f6ccd
Annotations: <none>
Status: Pending
IP: 10.1.54.7
IPs:
IP: 10.1.54.7
Controlled By: ReplicaSet/myapp-7d655f6ccd
Containers:
myapp:
Container ID:
Image: 192.168.0.45:32000/myapp:latest
Image ID:
Port: 9000/TCP
Host Port: 0/TCP
State: Waiting
Reason: ImagePullBackOff
Ready: False
Restart Count: 0
Limits:
memory: 384Mi
Requests:
memory: 128Mi
Environment:
REDIS: redis
MYSQL: mysql
Mounts:
/var/run/secrets/kubernetes.io/serviceaccount from default-token-dn4bk (ro)
Conditions:
Type Status
Initialized True
Ready False
ContainersReady False
PodScheduled True
Volumes:
default-token-dn4bk:
Type: Secret (a volume populated by a Secret)
SecretName: default-token-dn4bk
Optional: false
QoS Class: Burstable
Node-Selectors: <none>
Tolerations: node.kubernetes.io/not-ready:NoExecute for 300s
node.kubernetes.io/unreachable:NoExecute for 300s
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 15m default-scheduler Successfully assigned default/myapp-7d655f6ccd-gpgkx to 192.168.0.66
Normal Pulling 14m (x4 over 15m) kubelet Pulling image "192.168.0.45:32000/myapp:latest"
Warning Failed 14m (x4 over 15m) kubelet Failed to pull image "192.168.0.45:32000/myapp:latest": rpc error: code = Unknown desc = failed to resolve image "192.168.0.45:32000/myapp:latest": no available registry endpoint: failed to do request: Head "https://192.168.0.45:32000/v2/myapp/manifests/latest": http: server gave HTTP response to HTTPS client
Warning Failed 14m (x4 over 15m) kubelet Error: ErrImagePull
Warning Failed 13m (x6 over 15m) kubelet Error: ImagePullBackOff
Normal BackOff 20s (x63 over 15m) kubelet Back-off pulling image "192.168.0.45:32000/myapp:latest"
版本信息:
microk8s.kubectl version
Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.15", GitCommit:"73dd5c840662bb066a146d0871216333181f4b64", GitTreeState:"clean", BuildDate:"2021-01-13T13:22:41Z", GoVersion:"go1.13.15", Compiler:"gc", Platform:"linux/arm64"}
Server Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.15", GitCommit:"73dd5c840662bb066a146d0871216333181f4b64", GitTreeState:"clean", BuildDate:"2021-01-13T13:14:05Z", GoVersion:"go1.13.15", Compiler:"gc", Platform:"linux/arm64"}
似乎它想使用 https 而不是 http。
如何在带有 containerd 的 microk8s 中使用不安全选项?