Using minikube to pull image from local Docker registry (with self-signed CA certificate)
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
Using minikube to pull image from local Docker registry (with self-signed CA certificate)
I'd like to be able to run minikube so that it can access a local docker registry using a self signed CA certificate. Ideally the process should be automated so that I can use a *deployment.yaml
file to pull the required image without intervention.
At the moment I'm using a workaroud as follows:
#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
. 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.
If imagePullPolicy: Always
. The image pull fails in minikube.
I've been through a range of tutorials/stack overflow answers and have been unable to crack this. Any help appreciated.
docker kubernetes minikube
add a comment |
Using minikube to pull image from local Docker registry (with self-signed CA certificate)
I'd like to be able to run minikube so that it can access a local docker registry using a self signed CA certificate. Ideally the process should be automated so that I can use a *deployment.yaml
file to pull the required image without intervention.
At the moment I'm using a workaroud as follows:
#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
. 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.
If imagePullPolicy: Always
. The image pull fails in minikube.
I've been through a range of tutorials/stack overflow answers and have been unable to crack this. Any help appreciated.
docker kubernetes minikube
How does it fail? If you need todocker login
, does adding an appropriateimagePullSecret:
help?
– David Maze
Jan 4 at 17:03
I've tried usingimagePullSecret:
and that seems to work, but I get an issue with the certificateFailed to pull image "dave.local:5000/davedockerimage": rpc error: code = Unknown desc = Error response from daemon: Get https://dave.local:5000/v2/: x509: certificate signed by unknown authority
– tmn103
Jan 4 at 17:26
Once you moved the certs to /etc/docker/certs.d/dave.local:5000 did you reload docker daemon to use the certificate?
– Sujay Pillai
Jan 4 at 18:00
No, I didn't have to restart docker
– tmn103
Jan 4 at 18:11
add a comment |
Using minikube to pull image from local Docker registry (with self-signed CA certificate)
I'd like to be able to run minikube so that it can access a local docker registry using a self signed CA certificate. Ideally the process should be automated so that I can use a *deployment.yaml
file to pull the required image without intervention.
At the moment I'm using a workaroud as follows:
#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
. 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.
If imagePullPolicy: Always
. The image pull fails in minikube.
I've been through a range of tutorials/stack overflow answers and have been unable to crack this. Any help appreciated.
docker kubernetes minikube
Using minikube to pull image from local Docker registry (with self-signed CA certificate)
I'd like to be able to run minikube so that it can access a local docker registry using a self signed CA certificate. Ideally the process should be automated so that I can use a *deployment.yaml
file to pull the required image without intervention.
At the moment I'm using a workaroud as follows:
#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
. 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.
If imagePullPolicy: Always
. The image pull fails in minikube.
I've been through a range of tutorials/stack overflow answers and have been unable to crack this. Any help appreciated.
docker kubernetes minikube
docker kubernetes minikube
edited Jan 4 at 17:02
David Maze
16.5k31632
16.5k31632
asked Jan 4 at 17:00
tmn103tmn103
5610
5610
How does it fail? If you need todocker login
, does adding an appropriateimagePullSecret:
help?
– David Maze
Jan 4 at 17:03
I've tried usingimagePullSecret:
and that seems to work, but I get an issue with the certificateFailed to pull image "dave.local:5000/davedockerimage": rpc error: code = Unknown desc = Error response from daemon: Get https://dave.local:5000/v2/: x509: certificate signed by unknown authority
– tmn103
Jan 4 at 17:26
Once you moved the certs to /etc/docker/certs.d/dave.local:5000 did you reload docker daemon to use the certificate?
– Sujay Pillai
Jan 4 at 18:00
No, I didn't have to restart docker
– tmn103
Jan 4 at 18:11
add a comment |
How does it fail? If you need todocker login
, does adding an appropriateimagePullSecret:
help?
– David Maze
Jan 4 at 17:03
I've tried usingimagePullSecret:
and that seems to work, but I get an issue with the certificateFailed to pull image "dave.local:5000/davedockerimage": rpc error: code = Unknown desc = Error response from daemon: Get https://dave.local:5000/v2/: x509: certificate signed by unknown authority
– tmn103
Jan 4 at 17:26
Once you moved the certs to /etc/docker/certs.d/dave.local:5000 did you reload docker daemon to use the certificate?
– Sujay Pillai
Jan 4 at 18:00
No, I didn't have to restart docker
– tmn103
Jan 4 at 18:11
How does it fail? If you need to
docker login
, does adding an appropriate imagePullSecret:
help?– David Maze
Jan 4 at 17:03
How does it fail? If you need to
docker login
, does adding an appropriate imagePullSecret:
help?– David Maze
Jan 4 at 17:03
I've tried using
imagePullSecret:
and that seems to work, but I get an issue with the certificate Failed to pull image "dave.local:5000/davedockerimage": rpc error: code = Unknown desc = Error response from daemon: Get https://dave.local:5000/v2/: x509: certificate signed by unknown authority
– tmn103
Jan 4 at 17:26
I've tried using
imagePullSecret:
and that seems to work, but I get an issue with the certificate Failed to pull image "dave.local:5000/davedockerimage": rpc error: code = Unknown desc = Error response from daemon: Get https://dave.local:5000/v2/: x509: certificate signed by unknown authority
– tmn103
Jan 4 at 17:26
Once you moved the certs to /etc/docker/certs.d/dave.local:5000 did you reload docker daemon to use the certificate?
– Sujay Pillai
Jan 4 at 18:00
Once you moved the certs to /etc/docker/certs.d/dave.local:5000 did you reload docker daemon to use the certificate?
– Sujay Pillai
Jan 4 at 18:00
No, I didn't have to restart docker
– tmn103
Jan 4 at 18:11
No, I didn't have to restart docker
– tmn103
Jan 4 at 18:11
add a comment |
1 Answer
1
active
oldest
votes
As a alternative for using self signed certificate in minikube you can start minikube with insecure-registry option like below:
minikube start --insecure-registry="dave.local:5000"
I tried that previously, but the pull failed as it then looked forhttp://dave.local:5000/
rather thanhttps://dave.local:5000/
– tmn103
Jan 4 at 18:13
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54043190%2fusing-minikube-to-pull-image-from-local-docker-registry-with-self-signed-ca-cer%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
As a alternative for using self signed certificate in minikube you can start minikube with insecure-registry option like below:
minikube start --insecure-registry="dave.local:5000"
I tried that previously, but the pull failed as it then looked forhttp://dave.local:5000/
rather thanhttps://dave.local:5000/
– tmn103
Jan 4 at 18:13
add a comment |
As a alternative for using self signed certificate in minikube you can start minikube with insecure-registry option like below:
minikube start --insecure-registry="dave.local:5000"
I tried that previously, but the pull failed as it then looked forhttp://dave.local:5000/
rather thanhttps://dave.local:5000/
– tmn103
Jan 4 at 18:13
add a comment |
As a alternative for using self signed certificate in minikube you can start minikube with insecure-registry option like below:
minikube start --insecure-registry="dave.local:5000"
As a alternative for using self signed certificate in minikube you can start minikube with insecure-registry option like below:
minikube start --insecure-registry="dave.local:5000"
answered Jan 4 at 18:00
Hansika Madushan WeerasenaHansika Madushan Weerasena
634416
634416
I tried that previously, but the pull failed as it then looked forhttp://dave.local:5000/
rather thanhttps://dave.local:5000/
– tmn103
Jan 4 at 18:13
add a comment |
I tried that previously, but the pull failed as it then looked forhttp://dave.local:5000/
rather thanhttps://dave.local:5000/
– tmn103
Jan 4 at 18:13
I tried that previously, but the pull failed as it then looked for
http://dave.local:5000/
rather than https://dave.local:5000/
– tmn103
Jan 4 at 18:13
I tried that previously, but the pull failed as it then looked for
http://dave.local:5000/
rather than https://dave.local:5000/
– tmn103
Jan 4 at 18:13
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54043190%2fusing-minikube-to-pull-image-from-local-docker-registry-with-self-signed-ca-cer%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
How does it fail? If you need to
docker login
, does adding an appropriateimagePullSecret:
help?– David Maze
Jan 4 at 17:03
I've tried using
imagePullSecret:
and that seems to work, but I get an issue with the certificateFailed to pull image "dave.local:5000/davedockerimage": rpc error: code = Unknown desc = Error response from daemon: Get https://dave.local:5000/v2/: x509: certificate signed by unknown authority
– tmn103
Jan 4 at 17:26
Once you moved the certs to /etc/docker/certs.d/dave.local:5000 did you reload docker daemon to use the certificate?
– Sujay Pillai
Jan 4 at 18:00
No, I didn't have to restart docker
– tmn103
Jan 4 at 18:11