philpep / imago

Ensure kubernetes pods run on latest images builds from the docker registry
Apache License 2.0
95 stars 13 forks source link

check on local registry for new version #6

Open sgandon opened 5 years ago

sgandon commented 5 years ago

Hello, We are looking for a solution so that our developers can deploy some kubernetes manifest on their local machine using docker-for-desktop (windows/mac) or minikube. and then been able to build a new image locally and have their pod automatically restarted with this new image. I have performed some test using imago but was not sucessful. Any idea on how to make this work ?

philpep commented 5 years ago

Hi, I guess this is not working with imago because you don't have tls or a verified certificate on your registry server.

In your case imago might not the best tool to use, did you considered kubectl set image deployment/yourapp image=registry/image ?

sgandon commented 5 years ago

I may not have been clear, but everything is local to my machine, I don't want to use a remote registry but only the local docker registry. The idea is that when I build a new image locally (without pushing it to any remote registry) it will be automatically be used inside my local docker-for-mac k8s cluster.

sgandon commented 5 years ago

I have used the kubernetes imagepullPolicy: Never to make sure that it uses the local version of my image.

philpep commented 5 years ago

Oh, ok you're building inside the single-node cluster.

Maybe I can do something in imago to make this works. But I still think you can do this in a single shell command by using kubectl set image and docker client cli to get the sha256 image digest.

sgandon commented 5 years ago

ha ok. I'll try it manually. thanks.

sgandon commented 5 years ago

so I managed to make it work with 2 simple commands:

>docker inspect --format='{{index .RepoDigests 0}}' registry/webapp:1.0.0-20181114170846-gd2eb6d0
registry/webapp@sha256:3423b8d2b9a04c8a7b69b2c5c2bb386bf0213943004a7de0a45ba187a92b7235
>kubectl set image deployment test-webapp test-webapp=registry/webapp@sha256:3423b8d2b9a04c8a7b69b2c5c2bb386bf0213943004a7de0a45ba187a92b7235

but that would be great to have it automated for all images using a selector just like in imago. Do you think that would be an enhancement for imago ?

philpep commented 5 years ago

Great. Yes I think we can add support for local docker registry.

andreigec commented 4 years ago

is there also a way to accept self signed, or ignore ssl certs?