Created
April 1, 2021 18:35
-
-
Save vixus0/def691ac3ff50e1bc41dc838e027a166 to your computer and use it in GitHub Desktop.
traefik-pomerium-kubernetes-forwardauth
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
apiVersion: traefik.containo.us/v1alpha1 | |
kind: Middleware | |
metadata: | |
name: forward-auth | |
namespace: pomerium | |
spec: | |
forwardAuth: | |
address: https://pomerium-proxy.pomerium.svc.cluster.local | |
trustForwardHeader: true | |
tls: | |
insecureSkipVerify: true | |
authResponseHeaders: | |
- Authorization | |
- Impersonate-User | |
- Impersonate-Group |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
apiVersion: traefik.containo.us/v1alpha1 | |
kind: IngressRoute | |
metadata: | |
name: kube-api | |
namespace: pomerium | |
spec: | |
routes: | |
- kind: Rule | |
match: Host(`<kube api external domain>`) && PathPrefix(`/.pomerium`) | |
services: | |
- name: pomerium-proxy | |
namespace: pomerium | |
port: 443 | |
- kind: Rule | |
match: Host(`<kube api external domain>`) | |
services: | |
- name: kubernetes | |
namespace: default | |
port: 443 | |
middlewares: | |
- name: forward-auth | |
namespace: pomerium |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
apiVersion: traefik.containo.us/v1alpha1 | |
kind: IngressRoute | |
metadata: | |
name: kube-api | |
namespace: pomerium | |
spec: | |
routes: | |
- kind: Rule | |
match: Host(`<kube api external domain>`) | |
services: | |
- name: pomerium-proxy | |
namespace: pomerium | |
port: 443 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
policy: | |
- from: https://<kube api external domain> | |
to: https://kubernetes.default.svc | |
tls_custom_ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt | |
allow_spdy: true | |
allowed_domains: | |
- <your domain> | |
kubernetes_service_account_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment