107 lines
2.6 KiB
YAML
107 lines
2.6 KiB
YAML
# OAuth2-Proxy for kmsvc REST API
|
|||
|
|
# Protects gRPC-gateway (REST) endpoint with Authentik OIDC
|
||
|
|
|
||
|
|
apiVersion: v1
|
||
|
|
kind: ServiceAccount
|
||
|
|
metadata:
|
||
|
|
name: oauth2-proxy
|
||
|
|
namespace: sqs
|
||
|
|
|
||
|
|
---
|
||
|
|
apiVersion: apps/v1
|
||
|
|
kind: Deployment
|
||
|
|
metadata:
|
||
|
|
name: oauth2-proxy
|
||
|
|
namespace: sqs
|
||
|
|
spec:
|
||
|
|
replicas: 1
|
||
|
|
selector:
|
||
|
|
matchLabels:
|
||
|
|
app: oauth2-proxy
|
||
|
|
template:
|
||
|
|
metadata:
|
||
|
|
labels:
|
||
|
|
app: oauth2-proxy
|
||
|
|
annotations:
|
||
|
|
secret.reloader.stakater.com/reload: "kmsvc-oidc"
|
||
|
|
spec:
|
||
|
|
serviceAccountName: oauth2-proxy
|
||
|
|
containers:
|
||
|
|
- name: oauth2-proxy
|
||
|
|
image: quay.io/oauth2-proxy/oauth2-proxy:v7.5.1
|
||
|
|
imagePullPolicy: IfNotPresent
|
||
|
|
ports:
|
||
|
|
- name: http
|
||
|
|
containerPort: 4180
|
||
|
|
protocol: TCP
|
||
|
|
env:
|
||
|
|
- name: OAUTH2_PROXY_PROVIDER
|
||
|
|
value: "oidc"
|
||
|
|
- name: OAUTH2_PROXY_OIDC_ISSUER_URL
|
||
|
|
value: "https://authentik.riotpiao.homelab.com/application/o/kmsvc/"
|
||
|
|
- name: OAUTH2_PROXY_CLIENT_ID
|
||
|
|
value: "kmsvc"
|
||
|
|
- name: OAUTH2_PROXY_CLIENT_SECRET
|
||
|
|
valueFrom:
|
||
|
|
secretKeyRef:
|
||
|
|
name: kmsvc-oidc
|
||
|
|
key: clientSecret
|
||
|
|
- name: OAUTH2_PROXY_COOKIE_SECRET
|
||
|
|
valueFrom:
|
||
|
|
secretKeyRef:
|
||
|
|
name: kmsvc-oidc
|
||
|
|
key: cookieSecret
|
||
|
|
- name: OAUTH2_PROXY_REDIRECT_URL
|
||
|
|
value: "https://kmsvc.riotpiao.homelab.com/oauth2/callback"
|
||
|
|
- name: OAUTH2_PROXY_UPSTREAM
|
||
|
|
value: "http://kmsvc-management-service:8080"
|
||
|
|
- name: OAUTH2_PROXY_COOKIE_SECURE
|
||
|
|
value: "true"
|
||
|
|
- name: OAUTH2_PROXY_COOKIE_HTTPONLY
|
||
|
|
value: "true"
|
||
|
|
- name: OAUTH2_PROXY_COOKIE_SAMESITE
|
||
|
|
value: "Lax"
|
||
|
|
- name: OAUTH2_PROXY_EMAIL_DOMAIN
|
||
|
|
value: "*"
|
||
|
|
- name: OAUTH2_PROXY_SKIP_AUTH_REGEX
|
||
|
|
value: "^/health"
|
||
|
|
- name: OAUTH2_PROXY_PASS_AUTHORIZATION_HEADER
|
||
|
|
value: "true"
|
||
|
|
- name: OAUTH2_PROXY_REVERSE_PROXY
|
||
|
|
value: "true"
|
||
|
|
resources:
|
||
|
|
requests:
|
||
|
|
cpu: 100m
|
||
|
|
memory: 128Mi
|
||
|
|
limits:
|
||
|
|
cpu: 200m
|
||
|
|
memory: 256Mi
|
||
|
|
livenessProbe:
|
||
|
|
httpGet:
|
||
|
|
path: /ping
|
||
|
|
port: http
|
||
|
|
initialDelaySeconds: 10
|
||
|
|
periodSeconds: 10
|
||
|
|
readinessProbe:
|
||
|
|
httpGet:
|
||
|
|
path: /ping
|
||
|
|
port: http
|
||
|
|
initialDelaySeconds: 5
|
||
|
|
periodSeconds: 5
|
||
|
|
|
||
|
|
---
|
||
|
|
apiVersion: v1
|
||
|
|
kind: Service
|
||
|
|
metadata:
|
||
|
|
name: oauth2-proxy
|
||
|
|
namespace: sqs
|
||
|
|
spec:
|
||
|
|
type: ClusterIP
|
||
|
|
ports:
|
||
|
|
- port: 4180
|
||
|
|
targetPort: http
|
||
|
|
protocol: TCP
|
||
|
|
name: http
|
||
|
|
selector:
|
||
|
|
app: oauth2-proxy
|