0
0
Kubernetesdevops~20 mins

A/B testing with Ingress in Kubernetes - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Ingress A/B Testing Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Understanding A/B Testing with Kubernetes Ingress

What is the primary purpose of using Kubernetes Ingress for A/B testing?

ATo automatically scale backend pods based on traffic load
BTo encrypt all traffic between clients and backend services
CTo route a percentage of traffic to different backend services for comparison
DTo store user session data for backend services
Attempts:
2 left
💡 Hint

Think about how traffic can be split to test different versions of an application.

Configuration
intermediate
2:00remaining
Configuring Traffic Split in Ingress for A/B Testing

Given the following Ingress snippet, what percentage of traffic is routed to service-v2?

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ab-test-ingress
spec:
  rules:
  - http:
      paths:
      - path: /app
        pathType: Prefix
        backend:
          service:
            name: service-v1
            port:
              number: 80
      - path: /app
        pathType: Prefix
        backend:
          service:
            name: service-v2
            port:
              number: 80
  traffic:
    - serviceName: service-v1
      weight: 80
    - serviceName: service-v2
      weight: 20
A0%
B80%
C50%
D20%
Attempts:
2 left
💡 Hint

Look at the weight values assigned to each service.

💻 Command Output
advanced
2:00remaining
Output of kubectl describe Ingress with A/B Testing Annotations

What output will you see when running kubectl describe ingress ab-test-ingress if the Ingress has the annotation nginx.ingress.kubernetes.io/canary: "true" on service-v2 path?

Kubernetes
kubectl describe ingress ab-test-ingress
A
Annotations:
  nginx.ingress.kubernetes.io/canary: "true"
Rules:
  Host: <none>
  Paths:
    /app -> service-v1:80
    /app -> service-v2:80 (canary)
BError from server (NotFound): ingress "ab-test-ingress" not found
C
No annotations found
Rules:
  /app -> service-v1:80
  /app -> service-v2:80
D
Annotations:
  nginx.ingress.kubernetes.io/canary: "false"
Rules:
  /app -> service-v1:80
Attempts:
2 left
💡 Hint

Canary annotation marks the service as a canary deployment in the Ingress description.

Troubleshoot
advanced
2:00remaining
Troubleshooting Traffic Not Splitting in A/B Testing

You configured an Ingress with two services for A/B testing, but all traffic goes to service-v1 only. What is the most likely cause?

AThe services have different port numbers configured
BThe Ingress controller does not support traffic splitting by weight
CThe Ingress resource is missing the <code>spec.rules</code> section
DThe backend pods are not labeled with <code>app=service-v2</code>
Attempts:
2 left
💡 Hint

Not all Ingress controllers support weighted traffic splitting.

🔀 Workflow
expert
3:00remaining
Steps to Implement A/B Testing with Kubernetes Ingress

What is the correct order of steps to implement A/B testing using Kubernetes Ingress?

A1,2,3,4
B2,1,4,3
C1,3,2,4
D3,1,2,4
Attempts:
2 left
💡 Hint

Think about deploying first, then configuring routing, then monitoring, then adjusting.