Build and deploy Windows IIS workloads

Skaffold handles the workflow for building, pushing and deploying your application. The Skaffold configuration skaffold.yaml is at the root folder of the generated artifacts. To learn how to edit the skaffold.yaml file, see the Skaffold file reference.

Before you begin

This document assumes that you've completed the migration and reviewed the generated migration artifacts.

Build the container image

Migrate to Containers CLI and Migrate to Containers on Google Cloud generate a different Skaffold configuration. The configuration generated by Migrate to Containers CLI lets you build single-arch images on a Windows machine as well as multi-arch images using Cloud Build on a Linux machine. However, the Skaffold configuration generated by Migrate to Containers on Google Cloud lets you build only multi-arch images using Cloud Build on a Linux machine.

If you use Cloud Shell, Skaffold is already installed. If you need to install Skaffold, see Installing Skaffold.

Build a single-arch image on a Windows machine

On a Windows machine, build a single-arch container image using Skaffold:

skaffold build -d eu.gcr.io/PROJECT_ID --cache-artifacts=false

Replace PROJECT_ID with the ID of the project which contains your workload cluster.

If you want to build and deploy the container image in the same step, then you can replace the build command with the run command.

Build a multi-arch image on a Linux machine

Set the following environment variables:

  • Mandatory
    • CLOUDBUILD_PROJECT: the project where you want Cloud Build to run
    • REGION: the region in which Cloud Build will run
    • ZONE: the zone in which Cloud Build will run
  • Optional - If the network and subnetwork are not specified, the default VPC and default subnetwork are used.
    • NETWORK: the network in which the Windows builder VMs will be created (VPC name)
    • SUBNETWORK: the subnetwork in which the Windows builders will be created

Follow the instructions in Building multi-arch images.

If you want to use custom worker pools for Cloud Build (to avoid firewall rules creation for example), set the following environment variables:

  • Mandatory
    • WORKERPOOL: the name of the workerpool
    • WORKERPOOL_REGION: the region of the workerpool
  • Optional
    • USE_INTERNAL_IP: true if the workerpool is connected with shared VPC to NETWORK

The commands to run a Windows build follows this format:

export CLOUDBUILD_PROJECT=CLOUDBUILD_PROJECT
export REGION=REGION
export ZONE=ZONE

skaffold build -d eu.gcr.io/PROJECT_ID

Replace PROJECT_ID with the ID of the project which contains your workload cluster.

If you want to build and deploy the container image in the same step, then you can replace the build command with the run command.

Deploy the container image

After the container image is built, use Skaffold to deploy it:

skaffold run -d eu.gcr.io/PROJECT_ID

Replace PROJECT_ID with the ID of the project which contains your workload cluster.

What's next