fix auth for spoolman

This commit is contained in:
Finn 2024-10-13 16:54:22 -07:00
parent 7475d7499c
commit 14554c31c8
3 changed files with 117 additions and 0 deletions

View file

@ -32,6 +32,31 @@ spec:
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: spoolman.herzfeld.casa
labels:
name: spoolman.herzfeld.casa
annotations:
traefik.ingress.kubernetes.io/router.middlewares: kube-system-traefik-forward-auth-herzfeld-casa@kubernetescrd
cert-manager.io/cluster-issuer: letsencrypt
spec:
tls:
- hosts: [spoolman.herzfeld.casa]
secretName: spoolman.herzfeld.casa
rules:
- host: spoolman.herzfeld.casa
http:
paths:
- pathType: Prefix
path: "/"
backend:
service:
name: spoolman
port:
number: 8080
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: spoolman-internal
labels:

View file

@ -4,6 +4,7 @@ resources:
- traefik-default-cert.yaml
- traefik-dashboard.yaml
- traefik-forward-auth.yaml
- traefik-forward-auth-herzfeld-casa.yaml
- secrets.yaml
configMapGenerator:
- name: traefik-additional-configs
@ -21,3 +22,12 @@ configMapGenerator:
- COOKIE_DOMAIN=k8s.home.finn.io
- AUTH_HOST=authproxy.k8s.home.finn.io
- LOG_LEVEL=info
- name: traefik-forward-auth-herzfeld-casa
namespace: kube-system
literals:
- DEFAULT_PROVIDER=oidc
- PROVIDERS_OIDC_ISSUER_URL=https://auth.janky.solutions/realms/janky.solutions
- PROVIDERS_OIDC_CLIENT_ID=authproxy.k8s.home.finn.io
- COOKIE_DOMAIN=herzfeld.casa
- AUTH_HOST=authproxy.herzfeld.casa
- LOG_LEVEL=info

View file

@ -0,0 +1,82 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: traefik-forward-auth-herzfeld-casa
namespace: kube-system
labels:
app: traefik-forward-auth-herzfeld-casa
spec:
replicas: 1
selector:
matchLabels:
app: traefik-forward-auth-herzfeld-casa
strategy:
type: Recreate
template:
metadata:
labels:
app: traefik-forward-auth-herzfeld-casa
spec:
terminationGracePeriodSeconds: 60
containers:
- image: git.janky.solutions/jankysolutions/infra/traefik-forward-auth:latest
name: traefik-forward-auth
resources:
limits:
memory: "128Mi"
cpu: "500m"
ports:
- containerPort: 4181
protocol: TCP
envFrom:
- configMapRef:
name: traefik-forward-auth-herzfeld-casa
- secretRef:
name: traefik-forward-auth-herzfeld-casa
---
apiVersion: v1
kind: Service
metadata:
name: traefik-forward-auth-herzfeld-casa
namespace: kube-system
spec:
selector:
app: traefik-forward-auth-herzfeld-casa
ports:
- name: auth-http
port: 4181
---
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
name: traefik-forward-auth-herzfeld-casa
namespace: kube-system
spec:
forwardAuth:
address: http://traefik-forward-auth-herzfeld-casa:4181
authResponseHeaders:
- X-Forwarded-User
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: traefik-forward-auth-herzfeld-casa
namespace: kube-system
annotations:
traefik.ingress.kubernetes.io/router.middlewares: kube-system-traefik-forward-auth-herzfeld-casa@kubernetescrd
cert-manager.io/cluster-issuer: letsencrypt
spec:
tls:
- hosts: [authproxy.herzfeld.casa]
secretName: authproxy.herzfeld.casa
rules:
- host: authproxy.herzfeld.casa
http:
paths:
- pathType: Prefix
path: "/"
backend:
service:
name: traefik-forward-auth-herzfeld-casa
port:
number: 4181