Deploying workloads to GKE
The whole point of all the setup and configuration is to finally get to the point where you can deploy workloads to your GKE container clusters. Deploying workloads to GKE has gotten much easier over its lifetime; you can now even deploy simple workloads directly from images in Container Registry using the GCP Cloud Console. The three GKE deployment options are:
- kubectl run using command line parameters
- kubectl apply using YAML deployment file
- Kubernetes Engine Workloads dashboard
As noted earlier in this chapter, scripted deployments are much preferred when repeatability and testability are concerns. The console should only really be used when deploying trial or test workloads in an R&D type environment. The pinnacle of scripted deployments is when you get to parameterized YAML that is driven by an orchestration engine, for example Terraform, allowing you to test and deploy all of your workloads via a tried and true pipeline.
Here is an example of a basic deployment...