Skip to content
This repository has been archived by the owner on May 1, 2023. It is now read-only.

Commit

Permalink
adapt to new gke auth plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasochem committed Jan 11, 2023
1 parent ed3850b commit 666659a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
8 changes: 4 additions & 4 deletions docker/polkadot-snapshot-engine/Dockerfile.template
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM google/cloud-sdk:slim

# install kubectl
RUN apt-get -y --no-install-recommends install jq gettext && \
curl -LO https://storage.googleapis.com/kubernetes-release/release/"$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)"/bin/linux/amd64/kubectl && \
chmod +x ./kubectl && \
mv ./kubectl /usr/local/bin
RUN apt-get -y --no-install-recommends install jq gettext google-cloud-sdk-gke-gcloud-auth-plugin && \
curl -LO https://storage.googleapis.com/kubernetes-release/release/"$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)"/bin/linux/amd64/kubectl && \
chmod +x ./kubectl && \
mv ./kubectl /usr/local/bin

COPY entrypoint.sh /snapshot-engine/

Expand Down
1 change: 1 addition & 0 deletions docker/polkadot-snapshot-engine/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ set -e
set -x

# workload identity allows this to work
export USE_GKE_GCLOUD_AUTH_PLUGIN=True
gcloud container clusters get-credentials blockchain --region us-central1

# first, delete old versions of pvc and snapshot that may still be present
Expand Down
4 changes: 3 additions & 1 deletion docker/snapshot-uploader/Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ FROM google/cloud-sdk:alpine
COPY --from=builder /usr/local/aws-cli/ /usr/local/aws-cli/
COPY --from=builder /aws-cli-bin/ /usr/local/bin/

RUN apk add --no-cache curl lz4 bash python3 && rm -rf /var/cache/apk/*
RUN apk add --no-cache curl lz4 bash python3 && rm -rf /var/cache/apk/* && \
gcloud components install gke-gcloud-auth-plugin

RUN aws --version # Just to make sure its installed alright

COPY entrypoint.sh /snapshot-uploader/
Expand Down
2 changes: 2 additions & 0 deletions docker/snapshot-uploader/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash -ex
# workload identity allows this to work
export USE_GKE_GCLOUD_AUTH_PLUGIN=True
gcloud components install gke-gcloud-auth-plugin
gcloud container clusters get-credentials blockchain --region us-central1

if [ "${CHAIN}" == "polkadot" ]; then
Expand Down

0 comments on commit 666659a

Please sign in to comment.