0
0
Microservicessystem_design~10 mins

Horizontal Pod Autoscaler 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 specify the metric type for CPU utilization in a Horizontal Pod Autoscaler YAML.

Microservices
metrics:
  - type: [1]
Drag options to blanks, or click blank then click option'
AResource
BCustom
CMemory
DObject
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Memory' instead of 'Resource' as the metric type.
Confusing 'Custom' metrics with built-in resource metrics.
2fill in blank
medium

Complete the code to set the target average CPU utilization percentage in the Horizontal Pod Autoscaler spec.

Microservices
spec:
  targetCPUUtilizationPercentage: [1]
Drag options to blanks, or click blank then click option'
A100
B20
C80
D50
Attempts:
3 left
💡 Hint
Common Mistakes
Setting the target too low causing frequent scaling.
Setting the target too high causing resource exhaustion.
3fill in blank
hard

Fix the error in the YAML snippet by completing the missing field for specifying the resource name in the metric.

Microservices
metrics:
  - type: Resource
    resource:
      name: [1]
Drag options to blanks, or click blank then click option'
Anetwork
Bcpu
Cmemory
Ddisk
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'disk' or 'network' which are not standard resource names for HPA.
Using uppercase letters in resource names.
4fill in blank
hard

Fill both blanks to complete the YAML snippet for setting minimum and maximum replicas in Horizontal Pod Autoscaler.

Microservices
spec:
  minReplicas: [1]
  maxReplicas: [2]
Drag options to blanks, or click blank then click option'
A2
B10
C5
D20
Attempts:
3 left
💡 Hint
Common Mistakes
Setting minReplicas higher than maxReplicas.
Setting maxReplicas too low causing insufficient scaling.
5fill in blank
hard

Fill all three blanks to complete the YAML snippet for a Horizontal Pod Autoscaler targeting a deployment named 'web-app' in the 'default' namespace.

Microservices
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: web-app-hpa
  namespace: [1]
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: [2]
  minReplicas: 1
  maxReplicas: 5
  metrics:
    - type: Resource
      resource:
        name: cpu
        target:
          type: Utilization
          averageUtilization: [3]
Drag options to blanks, or click blank then click option'
Adefault
Bweb-app
C75
Dproduction
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect namespace or deployment name.
Setting unrealistic average utilization values.