Bird
0
0

Given this LimitRange YAML applied in a namespace:

medium📝 Predict Output Q4 of 15
Kubernetes - Namespaces
Given this LimitRange YAML applied in a namespace:
apiVersion: v1
kind: LimitRange
metadata:
  name: mem-limit
spec:
  limits:
  - default:
      memory: "512Mi"
    type: Container

What happens if a pod container is created without specifying memory requests or limits?
AThe container will have no memory limit and can use unlimited memory.
BThe container will have a default memory limit of 512Mi applied automatically.
CThe pod creation will fail due to missing memory limits.
DThe container will have a default CPU limit of 512m applied.
Step-by-Step Solution
Solution:
  1. Step 1: Understand default field in LimitRange

    The default field sets default resource limits if none are specified by the container.
  2. Step 2: Apply to memory limit

    Since default memory is 512Mi, containers without memory limits get this limit automatically.
  3. Final Answer:

    The container will have a default memory limit of 512Mi applied automatically. -> Option B
  4. Quick Check:

    default memory limit applied = The container will have a default memory limit of 512Mi applied automatically. [OK]
Quick Trick: default sets resource limits if none specified in pod [OK]
Common Mistakes:
  • Assuming pod creation fails without limits
  • Confusing default with defaultRequest
  • Thinking CPU limits are set instead of memory

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes