Skip to main content

whoami

Overview

  • Namespace: whoami
  • Purpose: Simple test service for debugging and validation
  • Age: 310 days
  • Status: Active

Workloads

Deployments

NameReplicasStatusAgePurpose
whoami1/1Ready310dTest HTTP service

Services

NameTypeCluster IPPortsPurpose
whoamiClusterIP10.29.84.16080HTTP endpoint

What is whoami?

whoami is a simple HTTP service that returns information about the request and the pod handling it. It's commonly used for:

  • Testing ingress/routing: Verify traffic routing works
  • Load balancer testing: See which pod handles each request
  • Network debugging: Test connectivity and DNS
  • Traefik/Ingress validation: Confirm ingress controller setup

Response Example

When you make a request to whoami, it returns:

Hostname: whoami-xxx-yyy
IP: 10.x.x.x
RemoteAddr: 10.x.x.x:xxxxx
GET / HTTP/1.1
Host: whoami
User-Agent: curl/7.x.x
Accept: */*
X-Forwarded-For: 10.x.x.x
...

Access

Internal Access (within cluster):

# From any pod in the cluster
kubectl run -it --rm debug --image=busybox --restart=Never -- wget -O- http://whoami.whoami.svc.cluster.local

# Port forward for local testing
kubectl port-forward -n whoami service/whoami 8080:80
# Then access http://localhost:8080

Via Ingress (if configured):

# Check if there's an ingress for whoami
kubectl get ingress -n whoami
kubectl get ingressroutes -n whoami # Traefik CRD

Management

View resources:

kubectl get all -n whoami

Check pod status:

kubectl get pods -n whoami -o wide

View logs:

kubectl logs -f deployment/whoami -n whoami

Restart:

kubectl rollout restart deployment/whoami -n whoami

Test the service:

# From within cluster
kubectl run -it --rm test --image=curlimages/curl --restart=Never -- curl http://whoami.whoami.svc.cluster.local

Scaling

Test load balancing by scaling:

# Scale to multiple replicas
kubectl scale deployment whoami -n whoami --replicas=3

# Make multiple requests to see different pods respond
kubectl run -it --rm test --image=curlimages/curl --restart=Never -- sh -c 'for i in $(seq 1 10); do curl http://whoami.whoami.svc.cluster.local && echo; done'

Configuration

View deployment details:

kubectl describe deployment whoami -n whoami
kubectl get deployment whoami -n whoami -o yaml

Use Cases

1. Test Traefik Ingress

Create an ingress to access whoami externally:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: whoami-ingress
namespace: whoami
annotations:
kubernetes.io/ingress.class: traefik
spec:
rules:
- host: whoami.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: whoami
port:
number: 80

2. Test Load Balancing

Scale and verify round-robin:

kubectl scale deployment whoami -n whoami --replicas=3
# Make multiple requests and observe different pod IPs

3. Debug Network Issues

Use whoami to test:

  • DNS resolution
  • Service mesh configuration
  • Network policies
  • Ingress routing

Monitoring

Resource usage:

kubectl top pods -n whoami

Events:

kubectl get events -n whoami --sort-by='.lastTimestamp'

Recommendations

  1. Purpose: This is a test/debug service

    • Not intended for production traffic
    • Useful for validation and testing
  2. Cleanup: If not actively used

    • Consider removing to free resources
    • Keep if regularly used for testing
  3. Resource Limits: Set appropriate limits

kubectl set resources deployment whoami -n whoami \
--limits=cpu=100m,memory=64Mi \
--requests=cpu=50m,memory=32Mi
  1. Ingress: If testing ingress
    • Create temporary ingress resources
    • Remove when testing is complete

Cleanup (if not needed)

To remove the whoami namespace:

# Delete the namespace and all resources
kubectl delete namespace whoami

Similar Tools

Other debugging tools you might use:

  • httpbin: More comprehensive HTTP testing
  • netshoot: Network debugging Swiss army knife
  • busybox: Lightweight debugging container

Documentation