Bitzu

Associate Cloud Engineer ยท Containers and serverless deployments

Deploying a containerized app to GKE

Pushing an image to Artifact Registry, Deployment and Service manifests, kubectl apply/expose, Service types (ClusterIP, NodePort, LoadBalancer), Ingress at a basic level, checking rollout.

Key points

  • Push the image to Artifact Registry, describe a Deployment (and a Service) in YAML, run kubectl apply -f, then check kubectl rollout status.
  • Service types: ClusterIP (internal only), NodePort (port on every node), LoadBalancer (external load balancer). kubectl expose creates a Service for an existing Deployment.

Practice questions

Single choice

Which Service type exposes Pods only inside the cluster?

  1. ClusterIP
  2. NodePort
  3. LoadBalancer
  4. ExternalName
Show answer

Answer: A. ClusterIP

ClusterIP is the default and gives an internal virtual IP. NodePort and LoadBalancer add external reachability.

Select all that apply

Which commands are valid parts of deploying and verifying an app on GKE?

  1. kubectl apply -f deployment.yaml
  2. kubectl expose deployment web --type=LoadBalancer --port=80
  3. kubectl rollout status deployment/web
  4. kubectl push image web
  5. gcloud gke deploy web
Show answer

Answer: A. kubectl apply -f deployment.yaml, B. kubectl expose deployment web --type=LoadBalancer --port=80, C. kubectl rollout status deployment/web

apply submits manifests, expose creates a Service, rollout status watches the rollout. kubectl push and gcloud gke deploy are not real commands for this.

True or false

True or false: a Deployment manifest on its own gives the Pods an external IP address.

Show answer

Answer: False

False. A Deployment only manages Pods and replicas. You need a Service (or Ingress) to expose them.

Practice 8 questions on this topic in Bitzu

Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.

Download on the App StoreGet it on Google Play

More Associate Cloud Engineer topics in this module