krane
krane copied to clipboard
Dockerize krane
In order to make it even more easy to use (not wasting time and system with Ruby and gems to be installed), it would be great to have this tool in a Docker container.
I'm open to this assuming we've got the infrastructure to make this happen easily. By and chance do you have an example Dockerfile we could build?
I'm open to this assuming we've got the infrastructure to make this happen easily.
Maybe you're thinking of the pipeline? If that's the case, as you're using Github, GH Actions would do it otherwise there are plainly of free options out there.
By and chance do you have an example Dockerfile we could build?
Not yet but it shouldn't be that hard since krane is just a gem. I will give it a try and let you know.
If you're talking about being able to execute krane via docker run... (and not the pipeline-build) maybe this will help - https://github.com/strowi/deploy/.
We're using this as general "deploy"container for docker-compose + kubernetes, it definitely could be slimmed down if only krane is wanted. But it might help to get you started.;) The main problem might be getting all the variables/config-files into the container...
After thinking about this more, I'm hesitant to actually build a container. kubectl is only supporting one version a head a one behind (https://kubernetes.io/docs/setup/release/version-skew-policy/#kubectl) which makes me think we'll never include a version that makes enough people happy.
I'm still happy to add an example Dockerfile to the documentation though.
Sorry @dturn I don't understand what's the issue here.
@dturn is right. The kubectl-version is (more or less) bound to the cluster-version. So having kubectl-v1.18 in the docker-image you could only support clusters with v1.18+v1.19. Same goes the other way around for deprecations. With the linked deploy-image we are only supporting a handful of clusters we have control over, so this is not a problem. But "in the open" you will get a lot of trouble.
Workaround could be mounting kubectl from the host, or downloading it in an init-script (this can/will get you probably rate-limited at least).
Another option would be building plain old krane binaries using something like https://github.com/pmq20/ruby-packer or https://github.com/phusion/traveling-ruby . If it needs to collaborate with other elements from the system like kubectl and the kube config, seems like the best fit would be to make it a program! It is definitely annoying to have to install a whole system ruby just to run krane if you aren't using ruby for anything else.
I agree with @airhorns, krane should be available as a binary.