How to Secure Kubernetes Services Using Gateway API, Traefik, and OAuth2 Proxy

A technical guide details how to rebuild Kubernetes service authentication using Gateway API, Traefik, OAuth2 Proxy, and Pocket ID, replacing the older ingress-nginx annotation-based approach. The migration is prompted by ingress-nginx being retired, with Kubernetes now recommending Gateway API for traffic management. The setup exposes three HTTPS hostnames under a single domain, allowing OAuth2 Proxy to manage session cookies with a narrow, scoped domain. Traefik's Middleware CRD handles browser-based OIDC login and external authentication filtering, since Gateway API does not standardize these functions natively. The guide was validated on a local K3s cluster and uses standard Kubernetes and Helm commands, making it adaptable to other environments.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in