0
0
Kubernetesdevops~10 mins

kubectl port-forward for local access in Kubernetes - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the command to forward local port 8080 to pod port 80.

Kubernetes
kubectl port-forward [1] 8080:80
Drag options to blanks, or click blank then click option'
Aservice/my-service
Bpod/my-pod
Cdeployment/my-deploy
Dnode/my-node
Attempts:
3 left
💡 Hint
Common Mistakes
Using service or deployment instead of pod.
Omitting the resource type prefix.
2fill in blank
medium

Complete the command to forward local port 5000 to port 5000 of pod named 'web-app'.

Kubernetes
kubectl port-forward [1] 5000:5000
Drag options to blanks, or click blank then click option'
Apod/web-app
Bservice/web-app
Cpod/webapp
Ddeployment/web-app
Attempts:
3 left
💡 Hint
Common Mistakes
Using service or deployment instead of pod.
Misspelling the pod name.
3fill in blank
hard

Fix the error in the command to forward port 8080 to pod 'api-server'.

Kubernetes
kubectl port-forward [1] 8080:8080
Drag options to blanks, or click blank then click option'
Aapi-server
Bservice/api-server
Cpod/api-server
Ddeployment/api-server
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting the resource type prefix.
Using service or deployment instead of pod.
4fill in blank
hard

Fill both blanks to forward local port 3000 to pod 'frontend' port 80 and local port 5000 to pod 'backend' port 5000.

Kubernetes
kubectl port-forward [1] 3000:80 & kubectl port-forward [2] 5000:5000
Drag options to blanks, or click blank then click option'
Apod/frontend
Bservice/frontend
Cpod/backend
Ddeployment/backend
Attempts:
3 left
💡 Hint
Common Mistakes
Using service or deployment instead of pod.
Mixing pod names between commands.
5fill in blank
hard

Fill all three blanks to create a port-forward command that forwards local port 9090 to pod 'db' port 5432, and local port 8080 to pod 'cache' port 6379.

Kubernetes
kubectl port-forward [1] [2]:5432 & kubectl port-forward [3] 8080:6379
Drag options to blanks, or click blank then click option'
Apod/db
B9090
Cpod/cache
D5432
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping pod names or ports.
Using wrong port numbers or missing pod prefixes.