Has anyone ever done k8s stuff on GKE from inside ...
# kubernetes
p
Has anyone ever done k8s stuff on GKE from inside a docker container? I need to install the google clud sdk and the auth helper to connect to it but it is HUGE...
g
@proud-pizza-80589 yes we have - google cloud providers a docker image you can use for CLI stuff that comes with the auth helper preinstalled:
<http://gcr.io/google.com/cloudsdktool/google-cloud-cli|gcr.io/google.com/cloudsdktool/google-cloud-cli>
we used it as a base image for CI and then copied over files we needed for the other CI stuff, e.g:
Copy code
ARG NODE_VERSION=18.10.0
FROM node:${NODE_VERSION} AS node
FROM gcr.io/google.com/cloudsdktool/google-cloud-cli

COPY --from=node /usr/lib /usr/lib
COPY --from=node /usr/local/lib /usr/local/lib
COPY --from=node /usr/local/include /usr/local/include
COPY --from=node /usr/local/bin /usr/local/bin

# Source the shell on every RUN cmd so nvm is in the path
SHELL ["/bin/bash", "--login", "-c"]

RUN apt-get update -y
RUN apt-get autoclean
RUN apt-get autoremove
RUN apt-get install -y sudo
RUN echo Y | gcloud auth configure-docker us-east1-docker.pkg.dev
p
Yeah, i'm trying to slim down the container itself, but the stupid auth plugin i need requires the cloud sdk which is a few 100mb
b
I also spent too much time trying to get it down
p