Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 82ed1c6078 | |||
| 0df274c0b2 | |||
| 658ec19ff1 | |||
| eb27dcf65b | |||
| e44cf95bb2 | |||
| df6ab28165 |
@@ -1,5 +1,41 @@
|
||||
---
|
||||
apiVersion: traefik.io/v1alpha1
|
||||
kind: Middleware
|
||||
metadata:
|
||||
name: keycloak-auth
|
||||
spec:
|
||||
forwardAuth:
|
||||
address: http://oauth2-proxy.oauth2-proxy.svc:80/oauth2/auth
|
||||
trustForwardHeader: true
|
||||
authResponseHeaders:
|
||||
- X-Auth-Request-User
|
||||
- X-Auth-Request-Email
|
||||
- X-Auth-Request-Groups
|
||||
---
|
||||
apiVersion: traefik.io/v1alpha1
|
||||
kind: Middleware
|
||||
metadata:
|
||||
name: keycloak-auth-redirect
|
||||
spec:
|
||||
errors:
|
||||
status:
|
||||
- "401"
|
||||
service:
|
||||
name: oauth2-proxy-redirect
|
||||
port: 80
|
||||
query: /oauth2/sign_in?rd={url}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: oauth2-proxy-redirect
|
||||
spec:
|
||||
type: ExternalName
|
||||
externalName: oauth2-proxy.oauth2-proxy.svc.cluster.local
|
||||
ports:
|
||||
- port: 80
|
||||
---
|
||||
apiVersion: traefik.io/v1alpha1
|
||||
kind: IngressRoute
|
||||
metadata:
|
||||
name: secret-reader
|
||||
@@ -9,11 +45,16 @@ spec:
|
||||
entryPoints:
|
||||
- websecure
|
||||
routes:
|
||||
- match: Host(`secret-reader.hexor.cy`) && PathPrefix(`/oauth2/`)
|
||||
kind: Rule
|
||||
services:
|
||||
- name: oauth2-proxy-redirect
|
||||
port: 80
|
||||
- match: Host(`secret-reader.hexor.cy`)
|
||||
kind: Rule
|
||||
middlewares:
|
||||
- name: keycloak-auth
|
||||
namespace: oauth2-proxy
|
||||
- name: keycloak-auth-redirect
|
||||
services:
|
||||
- name: secret-reader
|
||||
port: 80
|
||||
|
||||
@@ -10,10 +10,10 @@ spec:
|
||||
template:
|
||||
type: Opaque
|
||||
data:
|
||||
client_id: oauth2-proxy
|
||||
client_secret: |-
|
||||
client-id: oauth2-proxy
|
||||
client-secret: |-
|
||||
{{ .client_secret }}
|
||||
cookie_secret: |-
|
||||
cookie-secret: |-
|
||||
{{ .cookie_secret }}
|
||||
data:
|
||||
- secretKey: client_secret
|
||||
@@ -25,7 +25,7 @@ spec:
|
||||
conversionStrategy: Default
|
||||
decodingStrategy: None
|
||||
metadataPolicy: None
|
||||
key: PLACEHOLDER_VAULTWARDEN_ITEM_ID
|
||||
key: e62e8c4d-d538-43b2-a682-9cdf2a5a1165
|
||||
property: login.password
|
||||
- secretKey: cookie_secret
|
||||
sourceRef:
|
||||
@@ -36,5 +36,5 @@ spec:
|
||||
conversionStrategy: Default
|
||||
decodingStrategy: None
|
||||
metadataPolicy: None
|
||||
key: PLACEHOLDER_VAULTWARDEN_ITEM_ID
|
||||
key: e62e8c4d-d538-43b2-a682-9cdf2a5a1165
|
||||
property: fields[0].value
|
||||
|
||||
@@ -4,12 +4,11 @@ kind: Kustomization
|
||||
resources:
|
||||
- app.yaml
|
||||
- external-secrets.yaml
|
||||
- middleware.yaml
|
||||
|
||||
helmCharts:
|
||||
- name: oauth2-proxy
|
||||
repo: https://oauth2-proxy.github.io/manifests
|
||||
version: 7.12.6
|
||||
version: 10.4.3
|
||||
releaseName: oauth2-proxy
|
||||
namespace: oauth2-proxy
|
||||
valuesFile: values.yaml
|
||||
|
||||
@@ -1,15 +1,3 @@
|
||||
---
|
||||
apiVersion: traefik.io/v1alpha1
|
||||
kind: Middleware
|
||||
metadata:
|
||||
name: keycloak-auth
|
||||
namespace: oauth2-proxy
|
||||
spec:
|
||||
forwardAuth:
|
||||
address: http://oauth2-proxy.oauth2-proxy.svc:80/oauth2/auth
|
||||
trustForwardHeader: true
|
||||
authResponseHeaders:
|
||||
- X-Auth-Request-User
|
||||
- X-Auth-Request-Email
|
||||
- X-Auth-Request-Groups
|
||||
- Authorization
|
||||
# Middleware is deployed per-namespace alongside each IngressRoute
|
||||
# because Traefik does not allow cross-namespace middleware references.
|
||||
# See k8s/apps/mtproxy/secret-reader-ingress.yaml for example.
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
replicaCount: 1
|
||||
|
||||
config:
|
||||
existingSecret: oauth2-proxy-creds
|
||||
configFile: |-
|
||||
provider = "keycloak-oidc"
|
||||
provider_display_name = "Keycloak"
|
||||
@@ -21,23 +22,6 @@ config:
|
||||
code_challenge_method = "S256"
|
||||
scope = "openid profile email"
|
||||
|
||||
extraEnv:
|
||||
- name: OAUTH2_PROXY_CLIENT_ID
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: oauth2-proxy-creds
|
||||
key: client_id
|
||||
- name: OAUTH2_PROXY_CLIENT_SECRET
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: oauth2-proxy-creds
|
||||
key: client_secret
|
||||
- name: OAUTH2_PROXY_COOKIE_SECRET
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: oauth2-proxy-creds
|
||||
key: cookie_secret
|
||||
|
||||
ingress:
|
||||
enabled: true
|
||||
className: traefik
|
||||
|
||||
Reference in New Issue
Block a user