0
0
Kubernetesdevops~10 mins

Why advanced patterns matter in Kubernetes - Test Your Understanding

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

Complete the code to create a basic Pod in Kubernetes.

Kubernetes
apiVersion: v1
kind: Pod
metadata:
  name: my-pod
spec:
  containers:
  - name: my-container
    image: [1]
Drag options to blanks, or click blank then click option'
Anginx
Bdocker
Ckubectl
Dpodman
Attempts:
3 left
💡 Hint
Common Mistakes
Using command-line tools like kubectl or podman instead of an image name.
2fill in blank
medium

Complete the code to expose a Deployment with a Service of type LoadBalancer.

Kubernetes
apiVersion: v1
kind: Service
metadata:
  name: my-service
spec:
  type: [1]
  selector:
    app: my-app
  ports:
  - protocol: TCP
    port: 80
    targetPort: 8080
Drag options to blanks, or click blank then click option'
ANodePort
BLoadBalancer
CClusterIP
DExternalName
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing ClusterIP when external access is needed.
3fill in blank
hard

Fix the error in the Deployment spec to correctly set the number of replicas.

Kubernetes
apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-deployment
spec:
  replicas: [1]
  selector:
    matchLabels:
      app: my-app
  template:
    metadata:
      labels:
        app: my-app
    spec:
      containers:
      - name: my-container
        image: nginx
Drag options to blanks, or click blank then click option'
A3
B"3"
Creplicas
Dthree
Attempts:
3 left
💡 Hint
Common Mistakes
Putting the number in quotes, which makes it a string.
4fill in blank
hard

Fill both blanks to create a ConfigMap and mount it as a volume in a Pod.

Kubernetes
apiVersion: v1
kind: Pod
metadata:
  name: configmap-pod
spec:
  containers:
  - name: app
    image: busybox
    volumeMounts:
    - name: config-volume
      mountPath: [1]
  volumes:
  - name: config-volume
    configMap:
      name: [2]
Drag options to blanks, or click blank then click option'
A/etc/config
B/var/data
Cmy-config
Ddefault-config
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong mount paths or ConfigMap names that don't exist.
5fill in blank
hard

Fill all three blanks to create a Horizontal Pod Autoscaler targeting a Deployment.

Kubernetes
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: [1]
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: [2]
    name: [3]
  minReplicas: 1
  maxReplicas: 5
  metrics:
  - type: Resource
    resource:
      name: cpu
      target:
        type: Utilization
        averageUtilization: 50
Drag options to blanks, or click blank then click option'
Amy-hpa
BDeployment
Cmy-deployment
DPod
Attempts:
3 left
💡 Hint
Common Mistakes
Using Pod as kind or mismatching names.