apiVersion: v1 kind: Namespace metadata: {name: flex-auth, labels: {net-kingdom/component: flex-auth}} --- apiVersion: v1 kind: Namespace metadata: {name: tenant-engine, labels: {net-kingdom/component: tenant-engine}} --- 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 securityContext: {runAsNonRoot: true, seccompProfile: {type: RuntimeDefault}} containers: - name: flex-auth image: forgejo.coulomb.social/coulomb/flex-auth@sha256:c25fc34a6cd7e64d955f8723ec70e176a583d5ae71d76280c4e2d89fba0fe0aa 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"] ports: [{name: http, containerPort: 8080}] securityContext: {allowPrivilegeEscalation: false, capabilities: {drop: ["ALL"]}, readOnlyRootFilesystem: true} resources: {requests: {cpu: 25m, memory: 32Mi}, limits: {cpu: 300m, memory: 192Mi}} readinessProbe: {httpGet: {path: /healthz, port: http}, periodSeconds: 5} livenessProbe: {httpGet: {path: /healthz, port: http}, periodSeconds: 20} --- apiVersion: v1 kind: Service metadata: {name: flex-auth-tenant-engine, namespace: flex-auth} spec: {selector: {app.kubernetes.io/name: flex-auth-tenant-engine}, ports: [{name: http, port: 8080, targetPort: http}]} --- apiVersion: apps/v1 kind: Deployment metadata: {name: flex-auth-user-engine, namespace: flex-auth} spec: replicas: 1 selector: {matchLabels: {app.kubernetes.io/name: flex-auth-user-engine}} template: metadata: {labels: {app.kubernetes.io/name: flex-auth-user-engine}} spec: automountServiceAccountToken: false securityContext: {runAsNonRoot: true, seccompProfile: {type: RuntimeDefault}} containers: - name: flex-auth image: forgejo.coulomb.social/coulomb/flex-auth@sha256:1f5290376dc5fcf456dc7a785e394d8b90949dabecd1d3e856f38557149bb5f4 args: ["serve", "--addr", "0.0.0.0:8080", "--registry", "/opt/flex-auth/examples/user-engine/registry_snapshot.json", "--policy", "/opt/flex-auth/examples/user-engine/policy_package.md"] ports: [{name: http, containerPort: 8080}] securityContext: {allowPrivilegeEscalation: false, capabilities: {drop: ["ALL"]}, readOnlyRootFilesystem: true} resources: {requests: {cpu: 25m, memory: 32Mi}, limits: {cpu: 300m, memory: 192Mi}} readinessProbe: {httpGet: {path: /healthz, port: http}, periodSeconds: 5} livenessProbe: {httpGet: {path: /healthz, port: http}, periodSeconds: 20} --- apiVersion: v1 kind: Service metadata: {name: flex-auth-user-engine, namespace: flex-auth} spec: {selector: {app.kubernetes.io/name: flex-auth-user-engine}, ports: [{name: http, port: 8080, targetPort: http}]} --- apiVersion: v1 kind: PersistentVolumeClaim metadata: {name: tenant-engine-data, namespace: tenant-engine} spec: {accessModes: [ReadWriteOnce], resources: {requests: {storage: 1Gi}}} --- apiVersion: apps/v1 kind: Deployment metadata: {name: tenant-engine, namespace: tenant-engine} spec: replicas: 1 strategy: {type: Recreate} selector: {matchLabels: {app.kubernetes.io/name: tenant-engine}} template: metadata: {labels: {app.kubernetes.io/name: tenant-engine}} spec: automountServiceAccountToken: false securityContext: {runAsNonRoot: true, fsGroup: 10001, seccompProfile: {type: RuntimeDefault}} containers: - name: tenant-engine image: forgejo.coulomb.social/coulomb/tenant-engine@sha256:2249e8c6ee44ae36081cddc52daf9c3f63acd18a95a5d620ab4fa7ac85149207 ports: [{name: http, containerPort: 8090}] env: - {name: TENANT_ENGINE_DATABASE_PATH, value: /data/tenant-engine.db} - {name: TENANT_ENGINE_FLEX_AUTH_URL, value: "http://flex-auth-tenant-engine.flex-auth.svc.cluster.local:8080"} volumeMounts: [{name: data, mountPath: /data}] securityContext: {allowPrivilegeEscalation: false, capabilities: {drop: ["ALL"]}, readOnlyRootFilesystem: true} resources: {requests: {cpu: 25m, memory: 48Mi}, limits: {cpu: 300m, memory: 192Mi}} readinessProbe: {httpGet: {path: /health, port: http}, periodSeconds: 5} livenessProbe: {httpGet: {path: /health, port: http}, periodSeconds: 20} volumes: [{name: data, persistentVolumeClaim: {claimName: tenant-engine-data}}] --- apiVersion: v1 kind: Service metadata: {name: tenant-engine, namespace: tenant-engine} spec: {selector: {app.kubernetes.io/name: tenant-engine}, ports: [{name: http, port: 8090, targetPort: http}]} --- apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: {name: flex-auth-tenant-engine, namespace: flex-auth} spec: podSelector: {matchLabels: {app.kubernetes.io/name: flex-auth-tenant-engine}} policyTypes: [Ingress, Egress] ingress: - from: - namespaceSelector: {matchLabels: {kubernetes.io/metadata.name: tenant-engine}} podSelector: {matchLabels: {app.kubernetes.io/name: tenant-engine}} ports: [{protocol: TCP, port: 8080}] egress: [] --- apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: {name: flex-auth-user-engine, namespace: flex-auth} spec: podSelector: {matchLabels: {app.kubernetes.io/name: flex-auth-user-engine}} policyTypes: [Ingress, Egress] ingress: - from: - namespaceSelector: {matchLabels: {kubernetes.io/metadata.name: user-engine}} podSelector: {matchLabels: {app.kubernetes.io/name: user-engine}} ports: [{protocol: TCP, port: 8080}] egress: [] --- apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: {name: tenant-engine, namespace: tenant-engine} spec: podSelector: {matchLabels: {app.kubernetes.io/name: tenant-engine}} policyTypes: [Ingress, Egress] ingress: - from: - namespaceSelector: {matchLabels: {kubernetes.io/metadata.name: user-engine}} podSelector: {matchLabels: {app.kubernetes.io/name: user-engine}} ports: [{protocol: TCP, port: 8090}] egress: - to: - namespaceSelector: {matchLabels: {kubernetes.io/metadata.name: flex-auth}} podSelector: {matchLabels: {app.kubernetes.io/name: flex-auth-tenant-engine}} ports: [{protocol: TCP, port: 8080}] - to: - namespaceSelector: {matchLabels: {kubernetes.io/metadata.name: kube-system}} ports: [{protocol: UDP, port: 53}, {protocol: TCP, port: 53}]