[英]Using minikube to pull image from local Docker registry (with self-signed CA certificate)
Using minikube to pull image from local Docker registry (with self-signed CA certificate) 使用minikube从本地Docker注册表中提取映像(带有自签名CA证书)
I'd like to be able to run minikube so that it can access a local docker registry using a self signed CA certificate. 我希望能够运行minikube,以便它可以使用自签名CA证书访问本地docker注册表。 Ideally the process should be automated so that I can use a
*deployment.yaml
file to pull the required image without intervention. 理想情况下,该过程应该是自动化的,以便我可以使用
*deployment.yaml
文件无需干预即可提取所需的图像。
At the moment I'm using a workaroud as follows: 目前,我正在如下使用workaroud:
#ssh into the minikube instance
sudo minikube ssh
#create a folder for the certificate
sudo mkdir /etc/docker/certs.d/dave.local:5000
#copy the crt file from the registry computer to the minikube instance
sudo scp user@192.168.1.2:/home/dave/certs/domain.crt /etc/docker/certs.d/dave.local:5000
#then check login
docker login dave.local:5000
#then pull image so that it's already in minikube
docker pull dave.local:5000/davedockerimage
I then edit the *deployment.yaml
with imagePullPolicy: Never
. 然后,我使用
imagePullPolicy: Never
编辑*deployment.yaml
。 When I then run sudo kubectl create -f dave-deployment.yaml
it finds dave.local:5000/davedockerimage
locally on minikube it uses the already pulled image. 然后,当我运行
sudo kubectl create -f dave-deployment.yaml
它将在dave.local:5000/davedockerimage
本地找到dave.local:5000/davedockerimage
,它使用已拉出的图像。
If imagePullPolicy: Always
. 如果
imagePullPolicy: Always
。 The image pull fails in minikube. 图像拉取在minikube中失败。
I've been through a range of tutorials/stack overflow answers and have been unable to crack this. 我已经看过一系列教程/堆栈溢出答案,但无法破解。 Any help appreciated.
任何帮助表示赞赏。
作为在minikube中使用自签名证书的一种替代方法,您可以使用不安全的注册表选项启动minikube,如下所示:
minikube start --insecure-registry="dave.local:5000"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.