flex-auth/deploy/flex-auth-tenant-engine.yaml
tegwick 1e1e077b27 Implement inbound caller authentication (ADR 0004); close T03 and T05
TokenReview-based caller identity with audience-scoped tokens and exact
resource.system to ServiceAccount bindings, per ops-warden's recommendation.
Deletes the unwired tenant-engine live-roles adapter (T03) and adds
make verify-posture (T05). Source implements A2; running digest is still A0
until promotion, so tenancy.current.A stays 0.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-18 15:22:52 +02:00

125 lines
3.1 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: flex-auth-tenant-engine
namespace: flex-auth
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: flex-auth-tenant-engine
template:
metadata:
labels:
app.kubernetes.io/name: flex-auth-tenant-engine
spec:
automountServiceAccountToken: false
serviceAccountName: flex-auth-tenant-engine
containers:
- args:
- serve
- --addr
- 0.0.0.0:8080
- --registry
- /opt/flex-auth/examples/tenant-engine/registry_snapshot.json
- --policy
- /opt/flex-auth/examples/tenant-engine/policy_package.md
- --caller-auth-mode
- enforce
- --caller-kubernetes-url
- https://10.43.0.1
- --caller-binding
- tenant-engine=system:serviceaccount:tenant-engine:tenant-engine
image: forgejo.coulomb.social/coulomb/flex-auth@sha256:1bf060e61122693ce98359c167cc5fe8bdafc84e097e090eaa71af94d0f27cbc
livenessProbe:
httpGet:
path: /healthz
port: http
periodSeconds: 20
name: flex-auth
ports:
- containerPort: 8080
name: http
readinessProbe:
httpGet:
path: /healthz
port: http
periodSeconds: 5
resources:
limits:
cpu: 300m
memory: 192Mi
requests:
cpu: 25m
memory: 32Mi
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
volumeMounts:
- mountPath: /var/run/secrets/flex-auth-reviewer
name: flex-auth-reviewer
readOnly: true
securityContext:
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
volumes:
- name: flex-auth-reviewer
projected:
defaultMode: 0440
sources:
- serviceAccountToken:
audience: https://kubernetes.default.svc
expirationSeconds: 3600
path: token
- configMap:
items:
- key: ca.crt
path: ca.crt
name: kube-root-ca.crt
---
apiVersion: v1
kind: Service
metadata:
name: flex-auth-tenant-engine
namespace: flex-auth
spec:
ports:
- name: http
port: 8080
targetPort: http
selector:
app.kubernetes.io/name: flex-auth-tenant-engine
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: flex-auth-tenant-engine
namespace: flex-auth
spec:
egress:
- ports:
- port: 443
protocol: TCP
- port: 6443
protocol: TCP
ingress:
- from:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: tenant-engine
podSelector:
matchLabels:
app.kubernetes.io/name: tenant-engine
ports:
- port: 8080
protocol: TCP
podSelector:
matchLabels:
app.kubernetes.io/name: flex-auth-tenant-engine
policyTypes:
- Ingress
- Egress