Deploy a Linux system container to a target cluster
This page describes how to prepare your cluster for deployment, and how to deploy your Linux system container using Skaffold.
After you have migrated a workload from your source platform, you can use the deployment artifacts generated by that process to deploy the migrated workload container to the cluster.
Skaffold can handle the workflow for building, pushing, and deploying your application.
Before you begin
Before deploying your workload, you should have first:
- Migrated the workload using Migrate to Containers.
- Reviewed the generate deployment files.
- Created the cluster where you want to deploy your workload. For more information, see:
- Set up
kubectl
and connected to the cluster.
Choose and set up your Docker registry
As part of your deployment, you build and upload the Docker image of your container to a Docker registry.
For the Docker registry you can choose to use:
Artifact Registry
Any Docker registry that supports basic authentication
The recommended solution is to use Artifact Registry in the same project of the deployment cluster. GKE can access the registry by default. For more information, see the requirements to integrate with GKE.
If you want to use you a private Docker registry, learn how to configure the registry.
Deploy your container with Skaffold
The skaffold.yaml
file is at the root folder of the generated artifacts.
To learn how to edit the skaffold.yaml
file, see the
Skaffold file reference.
To build and deploy your container, from the root folder of the generated artifacts, run the following command:
skaffold run -d REPOSITORY_PATH
Replace REPOSITORY_PATH with the path to your artifact repository.
For example,
us-central1-docker.pkg.dev/PROJECT_ID/REPOSITORY_NAME
.
This command builds the image, uploads it to the selected repository, and then deploys it to the default cluster.
To run Skaffold while building using Cloud Build, use the following command:
skaffold run -d REPOSITORY_PATH -p cloudbuild
What's next
- Learn how to complete post-migration image updates.