<p>I have set up a Google Cloud Platform kubernetes cluster (and Container Registry) with source code on GitHub. Source code is divided into folders with separate Dockerfiles for each microservice.</p>
<p>I want to set up CI/CD using GitHub actions.</p>
<p>As far as I understand, the <a href="https://github.com/actions/starter-workflows/blob/d9236ebe5585b1efd5732a29ea126807279ccd56/ci/google.yml" rel="nofollow noreferrer">default GKE workflow</a> will connect to gcloud using secrets, build the images and push them to Container Registry. And then perform an update.</p>
<h2>My questions</h2>
<ul>
<li>How is the deployment performed?</li>
<li>What is <strong>kustomize</strong> for?</li>
<li>Do I have to configure on gcloud anything else than <strong>GKE key / token</strong></li>
<li>Suppose I want to update multiple docker images. Will it suffice to build multiple images and push them? Like below (a little bit simplified for clarity), or do I have to also modify the <strong>Deploy</strong> job:</li>
</ul>
<pre><code>    - name: Build
      run: |-
        docker build -t &quot;gcr.io/$PROJECT_ID/$IMAGE_1:$GITHUB_SHA&quot; service1/.
        docker build -t &quot;gcr.io/$PROJECT_ID/$IMAGE_2:$GITHUB_SHA&quot; service2/.
        docker build -t &quot;gcr.io/$PROJECT_ID/$IMAGE_3:$GITHUB_SHA&quot; service3/.

    - name: Publish
      run: |-
        docker push &quot;gcr.io/$PROJECT_ID/$IMAGE_1:$GITHUB_SHA&quot;
        docker push &quot;gcr.io/$PROJECT_ID/$IMAGE_2:$GITHUB_SHA&quot;
        docker push &quot;gcr.io/$PROJECT_ID/$IMAGE_3:$GITHUB_SHA&quot;
</code></pre>
<hr />
<p>This is the deploy fragment from the GKE workflow:</p>
<pre><code>    # Deploy the Docker image to the GKE cluster
    - name: Deploy
      run: |-
        ./kustomize edit set image gcr.io/PROJECT_ID/IMAGE:TAG=gcr.io/$PROJECT_ID/$IMAGE:$GITHUB_SHA
        ./kustomize build . | kubectl apply -f -
        kubectl rollout status deployment/$DEPLOYMENT_NAME
        kubectl get services -o wide
</code></pre>

Piotr Kolecki
<blockquote>
<p>How is the deployment performed?</p>
</blockquote>
<p>To know how to deploy or run this workflow please refer this <a href="https://github.com/google-github-actions/setup-gcloud/tree/master/example-workflows/gke" rel="nofollow noreferrer">documentation</a></p>
<blockquote>
<p>What is kustomize for?</p>
</blockquote>
<p>kustomize is a <a href="https://kustomize.io/" rel="nofollow noreferrer">configuration mangement</a> for application configuration</p>
<blockquote>
<p>Do I have to configure on gcloud anything else than GKE key / token</p>
</blockquote>
<p>You don't have to unless you are adding additional layer of security for authenticating the workflow.</p>
<blockquote>
<p>Suppose I want to update multiple docker images. Will it suffice to build multiple images and push them? Like below (a little bit simplified for clarity), or do I have to also modify the Deploy job</p>
</blockquote>
<p>I think no need for modification of deploy job. It is enough to build multiple images and push them into the GCR</p>
