錯誤訊息
Failed to pull image "192.168.1.12:30004/dev/platform:latest": rpc error: code = Unknown desc = pinging container registry 192.168.1.12:30004: Get "https://192.168.1.12:30004/v2/": http: server gave HTTP response to HTTPS c lient
環境:kubernetes版本:1.22
私倉:harbor
底層作業系統:rhel 8.5
1.查到網路資料偏向docker insecure-registries設定,因此在朝向是否安裝docker在本機端,但安裝docker會影響到crio設定或者版本,因此選擇安裝podman
2.安裝完podman並設定podman的insecure-registries,(docker與podman安裝insecure-registries不一樣)
3.安裝完後測試pull imagesg是否正常
4.再次部屬前後端,依然發生問題Unknown key "keyPaths"問題,使用修正補丁
5.重新佈署可以正常了
sudo yum module enable -y container-tools:rhel8
sudo yum module install -y container-tools:rhel8
https://podman.io/getting-started/installation
sudo vim /etc/containers/registries.conf
[[registry]]
insecure = true
location = "192.168.1.12:30004"
$ sudo systemctl restart podman
$ podman info
https://williamlieurance.com/insecure-podman-registry/
pod設定完後再次重啟部屬,發現新問題錯誤無如下
Failed to pull image "192.168.1.12:30004/dev/platform:latest": rpc error: code = Unknown desc = invalid policy in "/etc/containers/policy.json": Unknown key "keyPaths"
$ sudo podman image trust set -f /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release registry.access.redhat.com
$ sudo podman image trust set -f /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release registry.redhat.io
$ cat <<EOF > /etc/containers/registries.d/registry.access.redhat.com.yaml
docker:
registry.access.redhat.com:
sigstore: https://access.redhat.com/webassets/docker/content/sigstore
EOF
> cat <<EOF > /etc/containers/registries.d/registry.redhat.io.yaml
docker:
registry.redhat.io:
sigstore: https://registry.redhat.io/containers/sigstore
EOF
https://github.com/cri-o/cri-o/issues/6197