0

If deploy with filename on GKE, Supported builder images provided by Cloud Build can be found from official.

Also can found full list.

But both gke-deploy or kubectl can't suite my requirement. I want to run a command like

kustomize build ./overlays/production | kubectl apply -f -

Because I need to build a whole file with kustomize first, then use kubectl.

From Running inline bash scripts, I can try

steps:
...
- name: gcr.io/cloud-builders/gcloud
  entrypoint: bash
  args:
    - kustomize
    - build
    - ./overlays/production
    - |
    - kubectl
    - apply
    - -f
    - -

But I think it can't find which cluster on GKE to use. So how to use it in this case with Cloud Build instead of run it on local shell?

iooi
  • 453
  • 2
  • 10
  • 23

1 Answers1

1

One approach would be to install kustomize on the machine that has kubectl installed. Another option is to run kustomize outside the cluster and and then store the resulting yaml somewhere in an object store like S3 in case of AWS and then in the machine download the yaml files from the object store and run kubectl apply.

Malathi
  • 2,119
  • 15
  • 40