0
0
Microservicessystem_design~10 mins

Kubernetes basics review in Microservices - Interactive Code Practice

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

Complete the code to create a Kubernetes pod manifest with the correct apiVersion.

Microservices
apiVersion: [1]
kind: Pod
metadata:
  name: my-pod
spec:
  containers:
  - name: my-container
    image: nginx
Drag options to blanks, or click blank then click option'
Aapps/v1
Bextensions/v1beta1
Cbatch/v1
Dv1
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'apps/v1' which is for Deployments, not Pods.
Using deprecated apiVersions like 'extensions/v1beta1'.
2fill in blank
medium

Complete the command to list all pods in the default namespace.

Microservices
kubectl [1] pods
Drag options to blanks, or click blank then click option'
Aget
Blist
Cdescribe
Dshow
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'list' which is not a valid kubectl command.
Using 'describe' which shows detailed info for a specific pod.
3fill in blank
hard

Fix the error in the command to expose a deployment as a service.

Microservices
kubectl expose deployment my-deployment --type=[1] --port=80
Drag options to blanks, or click blank then click option'
AClusterIP
BExternalIP
CNodePort
DLoadBalancer
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'ExternalIP' which is not a valid service type.
Using 'ClusterIP' which only exposes service inside the cluster.
4fill in blank
hard

Fill both blanks to create a deployment manifest with 3 replicas and the correct container image.

Microservices
apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-app
spec:
  replicas: [1]
  selector:
    matchLabels:
      app: my-app
  template:
    metadata:
      labels:
        app: my-app
    spec:
      containers:
      - name: app-container
        image: [2]
Drag options to blanks, or click blank then click option'
A3
Bnginx:latest
Cnginx
D1
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'nginx' without a tag which may pull an unexpected version.
Setting replicas to 1 instead of 3.
5fill in blank
hard

Fill all three blanks to create a ConfigMap manifest with a key-value pair.

Microservices
apiVersion: v1
kind: ConfigMap
metadata:
  name: my-config
data:
  [1]: "[2]"
  [3]: "true"
Drag options to blanks, or click blank then click option'
AenableFeatureX
Bfalse
CdebugMode
Dtrue
Attempts:
3 left
💡 Hint
Common Mistakes
Using boolean true/false without quotes which is invalid in YAML for ConfigMap data.
Mixing up keys and values.