diff --git a/cloudbuild/external.pkr.hcl b/cloudbuild/external.pkr.hcl index f0391436..095e2b43 100644 --- a/cloudbuild/external.pkr.hcl +++ b/cloudbuild/external.pkr.hcl @@ -118,6 +118,14 @@ build { "sudo systemctl daemon-reload", "sudo systemctl enable cri-docker.socket", "sudo systemctl enable cri-docker.service", + "cd $HOME", + "git clone https://github.com/kubernetes/cloud-provider-gcp.git", + "curl -Lo bazel https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-amd64 && sudo install bazel /usr/local/bin/", + "cd cloud-provider-gcp", + "curl --create-dirs -o third_party/licenses/cloud-provider-gcp/LICENSE https://raw.githubusercontent.com/kubernetes/cloud-provider-gcp/master/LICENSE", + "bazel build cmd/auth-provider-gcp", + "sudo mkdir -p /etc/kubernetes/bin/", + "sudo cp bazel-bin/cmd/auth-provider-gcp/auth-provider-gcp_/auth-provider-gcp /etc/kubernetes/bin/", ] } diff --git a/cloudbuild/internal.pkr.hcl b/cloudbuild/internal.pkr.hcl index f3b31970..2772d89d 100644 --- a/cloudbuild/internal.pkr.hcl +++ b/cloudbuild/internal.pkr.hcl @@ -115,6 +115,13 @@ build { "sudo systemctl daemon-reload", "sudo systemctl enable cri-docker.socket", "sudo systemctl enable cri-docker.service", + "cd $HOME", + "git clone https://github.com/kubernetes/cloud-provider-gcp.git", + "curl -Lo bazel https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-amd64 && sudo install bazel /usr/local/bin/", + "cd cloud-provider-gcp", + "bazel build cmd/auth-provider-gcp", + "sudo mkdir -p /etc/kubernetes/bin/", + "sudo cp bazel-bin/cmd/auth-provider-gcp/auth-provider-gcp_/auth-provider-gcp /etc/kubernetes/bin/", ] }