<p>If deploy with filename on GKE, <a href="https://cloud.google.com/cloud-build/docs/cloud-builders#supported_builder_images_provided_by" rel="nofollow noreferrer">Supported builder images provided by Cloud Build</a> can be found from official.</p>
<p>Also can found <a href="https://github.com/GoogleCloudPlatform/cloud-builders#google-cloud-build-official-builder-images" rel="nofollow noreferrer">full list</a>.</p>
<p>But both <code>gke-deploy</code> or <code>kubectl</code> can't suite my requirement. I want to run a command like</p>
<pre><code>kustomize build ./overlays/production | kubectl apply -f -
</code></pre>
<p>Because I need to build a whole file with kustomize first, then use kubectl.</p>
<p>From <a href="https://cloud.google.com/cloud-build/docs/configuring-builds/run-bash-scripts#running_inline_bash_scripts" rel="nofollow noreferrer">Running inline bash scripts</a>, I can try</p>
<pre><code>steps:
...
- name: gcr.io/cloud-builders/gcloud
  entrypoint: bash
  args:
    - kustomize
    - build
    - ./overlays/production
    - |
    - kubectl
    - apply
    - -f
    - -
</code></pre>
<p>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?</p>

iooi
<p>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.</p>
