xtruder / nix-kubernetes

Kubernetes deployment manager written in nix (DEPRECATED for https://github.com/xtruder/kubenix)
MIT License
80 stars 4 forks source link

Containers specified as dockerTools images? #8

Open copumpkin opened 7 years ago

copumpkin commented 7 years ago

Is it possible to be Nix from start to finish and specify my container images using dockerTools instead of talking about images from a pre-existing registry? That would be amazing!

offlinehacker commented 7 years ago

Currently not, but I was thinking about having pre-deployment "hooks", that upload docker image or nix store(distributed nix store) somewhere. While in our case this is not as useful, as we have build process separated from provisioning, I understand the use case, where you let Hydra build everything and then you have one large closure of everything you need for running apps on your cluster.

On Fri, Jan 6, 2017, 3:32 AM Daniel Peebles notifications@github.com wrote:

Is it possible to be Nix from start to finish and specify my container images using dockerTools instead of talking about images from a pre-existing registry? That would be amazing!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/proteuslabs/nix-kubernetes/issues/8, or mute the thread https://github.com/notifications/unsubscribe-auth/AAjvSzCmoMGwLPWy0gNraExhZC-hQt6Bks5rPafPgaJpZM4LcWId .

copumpkin commented 7 years ago

Yeah, that would be amazing.

On Jan 6, 2017, at 04:28, Jaka Hudoklin notifications@github.com wrote:

Currently not, but I was thinking about having pre-deployment "hooks", that upload docker image or nix store(distributed nix store) somewhere. While in our case this is not as useful, as we have build process separated from provisioning, I understand the use case, where you let Hydra build everything and then you have one large closure of everything you need for running apps on your cluster.

On Fri, Jan 6, 2017, 3:32 AM Daniel Peebles notifications@github.com wrote:

Is it possible to be Nix from start to finish and specify my container images using dockerTools instead of talking about images from a pre-existing registry? That would be amazing!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/proteuslabs/nix-kubernetes/issues/8, or mute the thread https://github.com/notifications/unsubscribe-auth/AAjvSzCmoMGwLPWy0gNraExhZC-hQt6Bks5rPafPgaJpZM4LcWId .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

roberth commented 6 years ago

I've put together an example of how one might go about adding dockerTools images to a configuration.

It has the following files:

The only thing missing is upload to registry. I like @offlinehacker's suggestion of providing a hook. We can make the upload strategy pluggable by letting the user import the right module for it. Such a module could be provided by nix-kubernetes or the user. For the user, that might look like this in the future:

 imports = [ <nix-kubernetes/upload/gcr.nix> ];
 config.upload.gcr.foo = true;

An upload module simply reads the nixImages config and sets the upload hook to an appropriate script.

What do you think?