2021-11-12 21:57:19 +00:00
|
|
|
Create a new ingress for the outpost
|
|
|
|
|
|
|
|
```yaml
|
2022-11-28 15:42:59 +00:00
|
|
|
apiVersion: networking.k8s.io/v1
|
2021-11-12 21:57:19 +00:00
|
|
|
kind: Ingress
|
|
|
|
metadata:
|
2022-05-09 19:22:41 +00:00
|
|
|
name: authentik-outpost
|
2021-11-12 21:57:19 +00:00
|
|
|
spec:
|
2022-05-09 19:22:41 +00:00
|
|
|
rules:
|
|
|
|
- host: app.company
|
|
|
|
http:
|
2022-11-28 15:42:59 +00:00
|
|
|
paths: /outpost.goauthentik.io
|
|
|
|
pathType: Prefix
|
|
|
|
backend:
|
|
|
|
# Or, to use an external Outpost, create an ExternalName service and reference that here.
|
|
|
|
# See https://kubernetes.io/docs/concepts/services-networking/service/#externalname
|
|
|
|
service:
|
|
|
|
name: ak-outpost-example-outpost
|
|
|
|
port:
|
|
|
|
number: 9000
|
2021-11-12 21:57:19 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
This ingress handles authentication requests, and the sign-in flow.
|
|
|
|
|
|
|
|
Add these annotations to the ingress you want to protect
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
metadata:
|
2022-05-09 19:22:41 +00:00
|
|
|
annotations:
|
2022-06-30 19:33:47 +00:00
|
|
|
# This should be the in-cluster DNS name for the authentik outpost service
|
|
|
|
# as when the external URL is specified here, nginx will overwrite some crucial headers
|
2022-05-09 19:22:41 +00:00
|
|
|
nginx.ingress.kubernetes.io/auth-url: |-
|
2022-06-30 19:33:47 +00:00
|
|
|
http://ak-outpost-example.authentik.svc.cluster.local:9000/outpost.goauthentik.io/auth/nginx
|
2022-05-09 19:22:41 +00:00
|
|
|
# If you're using domain-level auth, use the authentication URL instead of the application URL
|
|
|
|
nginx.ingress.kubernetes.io/auth-signin: |-
|
|
|
|
https://app.company/outpost.goauthentik.io/start?rd=$escaped_request_uri
|
|
|
|
nginx.ingress.kubernetes.io/auth-response-headers: |-
|
|
|
|
Set-Cookie,X-authentik-username,X-authentik-groups,X-authentik-email,X-authentik-name,X-authentik-uid
|
|
|
|
nginx.ingress.kubernetes.io/auth-snippet: |
|
|
|
|
proxy_set_header X-Forwarded-Host $http_host;
|
2021-11-12 21:57:19 +00:00
|
|
|
```
|