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
Which Service type exposes Pods only inside the cluster?
- ClusterIP
- NodePort
- LoadBalancer
- ExternalName
Show answer
Answer: A. ClusterIP
ClusterIP is the default and gives an internal virtual IP. NodePort and LoadBalancer add external reachability.
Which commands are valid parts of deploying and verifying an app on GKE?
- kubectl apply -f deployment.yaml
- kubectl expose deployment web --type=LoadBalancer --port=80
- kubectl rollout status deployment/web
- kubectl push image web
- 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: 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.
