Kubernetes kubectl create -f kube-registry.yaml
中的Intalled注册表。
里面有码头图片:
curl http://192.168.99.100:5000/v2/_catalog
{"repositories":["app1"]}
也是前进:
kubectl port-forward --namespace kube-system \
$(kubectl get po -n kube-system | grep kube-registry-v0 | \
awk '{print $1;}') 5000:5000
在Kubernetes部署文件(image: 192.168.99.100:5000/app1
)中设置deployment.yaml
。
将其部署到集群后:
kubectl create -f deployment.yaml
检查Deployments
菜单上Kubernetes仪表板的状态,出现错误:
Failed to pull image "192.168.99.100:5000/app1": rpc error: code = 2 desc = Error response from daemon: {"message":"Get https://192.168.99.100:5000/v1/_ping: http: server gave HTTP response to HTTPS client"}
Error syncing pod
原因是无法从http协议获取注册表内容。如何解决?
已添加insecure-registries
(实际内容为192.168.99.100:5000
。这是一张不同的IP /端口图片。)
答案 0 :(得分:2)
minikube start --insecure-registry "10.0.0.0/24"
https://github.com/kubernetes/minikube/blob/master/docs/insecure_registry.md
答案 1 :(得分:1)
insecure-registries
在您的节点中创建此文件并重新启动docker进程,然后尝试部署
/etc/docker/daemon.json
{
"insecure-registries" : ["192.168.99.100:5000"]
}