Interview Prep/Kubernetes/Services, Ingress and DNS

You want to rate limit and add basic auth at the ingress. How?

IntermediateScenarioServices, Ingress and DNS
Answer

Situation read → A staging site must be protected and API abuse limited.

What I'd do →

  1. For ingress-nginx use annotations nginx.ingress.kubernetes.io/limit-rps and auth-type: basic with auth-secret
  2. Create the htpasswd secret with htpasswd -c auth user and kubectl create secret generic basic-auth --from-file=auth
  3. Use OAuth2 Proxy for real SSO
  4. Apply WAF at the CDN or ALB layer for serious protection
  5. Verify with curl -u user:pass

Why → Cheap controls at the edge protect the backend before traffic reaches the app.

Interview tip → Say basic auth is for staging, SSO for production.

All Kubernetes questions Roadmap: Kubernetes networking, storage & scaling

More on Services, Ingress and DNS