titan-iac/services/logging/oauth2-proxy.yaml

105 lines
3.2 KiB
YAML
Raw Normal View History

2026-01-08 22:31:45 -03:00
# services/logging/oauth2-proxy.yaml
apiVersion: v1
kind: Service
metadata:
2026-01-09 08:54:07 -03:00
name: oauth2-proxy-logs
2026-01-08 22:31:45 -03:00
namespace: logging
labels:
2026-01-09 08:54:07 -03:00
app: oauth2-proxy-logs
2026-01-08 22:31:45 -03:00
spec:
ports:
- name: http
port: 80
targetPort: 4180
selector:
2026-01-09 08:54:07 -03:00
app: oauth2-proxy-logs
2026-01-08 22:31:45 -03:00
---
apiVersion: apps/v1
kind: Deployment
metadata:
2026-01-09 08:54:07 -03:00
name: oauth2-proxy-logs
2026-01-08 22:31:45 -03:00
namespace: logging
labels:
2026-01-09 08:54:07 -03:00
app: oauth2-proxy-logs
2026-01-08 22:31:45 -03:00
spec:
replicas: 2
selector:
matchLabels:
2026-01-09 08:54:07 -03:00
app: oauth2-proxy-logs
2026-01-08 22:31:45 -03:00
template:
metadata:
labels:
2026-01-09 08:54:07 -03:00
app: oauth2-proxy-logs
annotations:
vault.hashicorp.com/agent-inject: "true"
vault.hashicorp.com/role: "logging"
vault.hashicorp.com/agent-inject-secret-oidc-env: "kv/data/atlas/logging/oauth2-proxy-logs-oidc"
vault.hashicorp.com/agent-inject-template-oidc-env: |
{{- with secret "kv/data/atlas/logging/oauth2-proxy-logs-oidc" -}}
export OAUTH2_PROXY_CLIENT_ID="{{ .Data.data.client_id }}"
export OAUTH2_PROXY_CLIENT_SECRET="{{ .Data.data.client_secret }}"
export OAUTH2_PROXY_COOKIE_SECRET="{{ .Data.data.cookie_secret }}"
{{- end -}}
2026-01-08 22:31:45 -03:00
spec:
serviceAccountName: logging-vault-sync
imagePullSecrets:
- name: harbor-regcred
2026-01-08 22:31:45 -03:00
nodeSelector:
node-role.kubernetes.io/worker: "true"
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
2026-01-08 22:31:45 -03:00
- key: hardware
operator: In
values:
- rpi5
- rpi4
2026-01-08 22:31:45 -03:00
containers:
- name: oauth2-proxy
image: registry.bstein.dev/tools/oauth2-proxy-vault:v7.6.0
2026-01-08 22:31:45 -03:00
imagePullPolicy: IfNotPresent
2026-01-15 01:52:24 -03:00
command: ["/entrypoint.sh"]
2026-01-08 22:31:45 -03:00
args:
2026-01-15 01:52:24 -03:00
- /bin/oauth2-proxy
2026-01-08 22:31:45 -03:00
- --provider=oidc
- --redirect-url=https://logs.bstein.dev/oauth2/callback
- --oidc-issuer-url=https://sso.bstein.dev/realms/atlas
- --scope=openid profile email
2026-01-08 22:31:45 -03:00
- --email-domain=*
- --code-challenge-method=S256
2026-01-08 22:31:45 -03:00
- --set-xauthrequest=true
- --pass-access-token=true
- --set-authorization-header=true
- --cookie-secure=true
- --cookie-samesite=lax
- --cookie-refresh=20m
- --cookie-expire=168h
- --insecure-oidc-allow-unverified-email=true
2026-01-09 08:54:07 -03:00
- --upstream=http://opensearch-dashboards.logging.svc.cluster.local:5601
2026-01-08 22:31:45 -03:00
- --http-address=0.0.0.0:4180
- --skip-provider-button=true
- --skip-jwt-bearer-tokens=true
- --cookie-domain=logs.bstein.dev
env:
- name: VAULT_ENV_FILE
value: /vault/secrets/oidc-env
2026-01-08 22:31:45 -03:00
ports:
- containerPort: 4180
name: http
readinessProbe:
httpGet:
path: /ping
port: 4180
initialDelaySeconds: 5
periodSeconds: 10
livenessProbe:
httpGet:
path: /ping
port: 4180
initialDelaySeconds: 20
periodSeconds: 20