Skip to content

Commit

Permalink
feat(gke): Enables gcloud auth plugin for 1.26+ GKE clusters (#5847) (#…
Browse files Browse the repository at this point in the history
…5850)

* feat(gke): Enables gcloud auth plugin for 1.26+ GKE clusters

Also bumps the SDK to the latest release.

* feat(gke): Bump google cloud sdk and add the plugin for GKE 1.26+

https://cloud.google.com/blog/products/containers-kubernetes/kubectl-auth-changes-in-gke
(cherry picked from commit 2dc786f)

Co-authored-by: Jason <jason.mcintosh@armory.io>
Co-authored-by: Fernando Freire <dogonthehorizon@gmail.com>
  • Loading branch information
3 people committed Jan 27, 2023
1 parent 98522b5 commit 31e8fc3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions Dockerfile.slim
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ENV KUBECTL_RELEASE=1.20.6
ENV AWS_CLI_VERSION=1.18.152
ENV AWS_CLI_S3_CMD=2.0.2
ENV AWS_AIM_AUTHENTICATOR_VERSION=0.5.5
ENV GOOGLE_CLOUD_SDK_VERSION=398.0.0
ENV GOOGLE_CLOUD_SDK_VERSION=412.0.0
ENV ECR_TOKEN_VERSION=v1.0.2

ENV PATH "$PATH:/usr/local/bin/:/opt/google-cloud-sdk/bin/:/usr/local/bin/aws-iam-authenticator"
Expand All @@ -32,7 +32,8 @@ RUN [ $TARGETARCH == 'amd64' ] && export GCP_ARCH="x86_64" || export GCP_ARCH="
&& mkdir -p /opt && cd /opt \
&& tar -xzf /google-cloud-sdk-${GOOGLE_CLOUD_SDK_VERSION}-linux-${GCP_ARCH}.tar.gz \
&& rm /google-cloud-sdk-${GOOGLE_CLOUD_SDK_VERSION}-linux-${GCP_ARCH}.tar.gz \
&& CLOUDSDK_PYTHON="python3" /opt/google-cloud-sdk/install.sh --usage-reporting=false --bash-completion=false --additional-components app-engine-java app-engine-go \
&& CLOUDSDK_PYTHON="python3" /opt/google-cloud-sdk/install.sh --usage-reporting=false --bash-completion=false \
--additional-components app-engine-java app-engine-go gke-gcloud-auth-plugin \
&& rm -rf ~/.config/gcloud \
&& rm -rf /opt/google-cloud-sdk/.install/.backup

Expand All @@ -55,4 +56,4 @@ RUN mkdir -p /opt/clouddriver/plugins && chown -R spinnaker:nogroup /opt/clouddr

USER spinnaker

CMD ["/opt/clouddriver/bin/clouddriver"]
CMD ["/opt/clouddriver/bin/clouddriver"]
5 changes: 3 additions & 2 deletions Dockerfile.ubuntu
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM ubuntu:bionic
LABEL maintainer="sig-platform@spinnaker.io"
ARG TARGETARCH
ENV GOOGLE_CLOUD_SDK_VERSION=398.0.0
ENV GOOGLE_CLOUD_SDK_VERSION=412.0.0
ENV PATH "$PATH:/opt/google-cloud-sdk/bin/"

RUN apt-get update && apt-get install -y curl gnupg && \
Expand Down Expand Up @@ -30,7 +30,8 @@ RUN [ $TARGETARCH == 'amd64' ] && export GCP_ARCH="x86_64" || export GCP_ARCH="
&& mkdir -p /opt && cd /opt \
&& tar -xzf /google-cloud-sdk-${GOOGLE_CLOUD_SDK_VERSION}-linux-${GCP_ARCH}.tar.gz \
&& rm /google-cloud-sdk-${GOOGLE_CLOUD_SDK_VERSION}-linux-${GCP_ARCH}.tar.gz \
&& CLOUDSDK_PYTHON="python3" /opt/google-cloud-sdk/install.sh --usage-reporting=false --bash-completion=false --additional-components app-engine-java app-engine-go \
&& CLOUDSDK_PYTHON="python3" /opt/google-cloud-sdk/install.sh --usage-reporting=false --bash-completion=false \
--additional-components app-engine-java app-engine-go gke-gcloud-auth-plugin \
&& rm -rf ~/.config/gcloud \
&& rm -rf /opt/google-cloud-sdk/.install/.backup

Expand Down

0 comments on commit 31e8fc3

Please sign in to comment.