-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add kubectl installation to Dockerfile #49
Add kubectl installation to Dockerfile #49
Conversation
Co-authored-by: Bernd Schorgers <[email protected]>
I don't see why not. Opinions @adamconnelly @eliecharra? |
I think it's ok. The only concerns I would have would be:
But for point 1 the image is already huge compared to our base runner image, presumably because of the overhead of adding gcloud, so I don't think adding kubectl and the auth plugin will be a huge concern here. And for point 2, given that this is a GCP-specific image, and this is installing the version of kubectl provided by the gcloud command, I think that's fair enough. So long story short - I don't have any objections here. |
I'm not strongly against it, but I'm also not super enthusiastic about adding more and more tools to the image, whatever it's actual size. |
I think I agree with Elie on this one, adding such a tool could make this base image a bit fragile as well. Who knows what breaking change will be introduced in the kubectl. |
To give you some context as to why this is important for terraform workflows with GCP, you'll notice that the gke autopilot module from terraform-google-modules requires I was able to solve this without creating a custom runner so far by adding kubectl installation in the Initialization phase of my stacks, but thought that it made more sense to be in the offical gcp image |
Let's close this PR for now because of Elie's reasoning (possible breaking changes). I'd recommend building a custom image on top of this one. |
This pull request adds the installation of kubectl to the gcp section of the Dockerfile. The previous execution of
gcloud components install gke-gcloud-auth-plugin
supports kubectl authentication to gke clusters. Having the kubectl cli installed allows users to access their clusters.Usage of this runner image via spacelift requires a user customize the "Applying" workflow phase by adding the command
gcloud auth login --cred-file=/mnt/workspace/cred-file.json
(or wherever the gcp credentials file is)