0
0
Kubernetesdevops~10 mins

Limit ranges for defaults in Kubernetes - Interactive Code Practice

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

Complete the YAML to define a LimitRange with default CPU and memory limits.

Kubernetes
apiVersion: v1
kind: LimitRange
metadata:
  name: limits
spec:
  limits:
  - type: Container
    default:
      cpu: [1]
      memory: 512Mi
Drag options to blanks, or click blank then click option'
A500m
B1Gi
C100m
D256Mi
Attempts:
3 left
💡 Hint
Common Mistakes
Using memory units for CPU value
Omitting the 'm' suffix for CPU
2fill in blank
medium

Complete the YAML to set default request values for CPU and memory in a LimitRange.

Kubernetes
apiVersion: v1
kind: LimitRange
metadata:
  name: limits
spec:
  limits:
  - type: Container
    defaultRequest:
      cpu: [1]
      memory: 256Mi
Drag options to blanks, or click blank then click option'
A200m
B1Gi
C100m
D512Mi
Attempts:
3 left
💡 Hint
Common Mistakes
Using memory units for CPU request
Setting request higher than limit
3fill in blank
hard

Fix the error in the LimitRange YAML by completing the missing field for default CPU limit.

Kubernetes
apiVersion: v1
kind: LimitRange
metadata:
  name: limits
spec:
  limits:
  - type: Container
    default:
      cpu: [1]
      memory: 1Gi
Drag options to blanks, or click blank then click option'
A1000m
B1m
C1Gi
D100m
Attempts:
3 left
💡 Hint
Common Mistakes
Using memory units for CPU
Using too large or invalid CPU values
4fill in blank
hard

Fill both blanks to set default and defaultRequest memory limits in the LimitRange YAML.

Kubernetes
apiVersion: v1
kind: LimitRange
metadata:
  name: limits
spec:
  limits:
  - type: Container
    default:
      memory: [1]
    defaultRequest:
      memory: [2]
Drag options to blanks, or click blank then click option'
A512Mi
B256Mi
C1Gi
D128Mi
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping default and defaultRequest values
Using CPU units for memory
5fill in blank
hard

Fill all three blanks to complete the LimitRange YAML with default CPU, defaultRequest CPU, and defaultRequest memory.

Kubernetes
apiVersion: v1
kind: LimitRange
metadata:
  name: limits
spec:
  limits:
  - type: Container
    default:
      cpu: [1]
    defaultRequest:
      cpu: [2]
      memory: [3]
Drag options to blanks, or click blank then click option'
A100m
B200m
C256Mi
D512Mi
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing CPU and memory units
Setting requests higher than limits