|
| 1 | +{{- if and (ne (include "tenant.name" .) "tenant-root") .Values.tracingCentral }} |
| 2 | +# Shared-central tracing (opt-in via .Values.tracingCentral): allow ONLY the |
| 3 | +# per-tenant OTLP collector pods to reach the shared VictoriaTraces insert |
| 4 | +# (vtinsert) in tenant-root — the fixed location the vtinsert-generic |
| 5 | +# ExternalName in cozy-monitoring points at, for tenants at any depth. Egress is |
| 6 | +# endpoint-scoped to app.kubernetes.io/name=otel-traces, so no other tenant |
| 7 | +# workload gains this cross-boundary hop. Gated on tracingCentral so the |
| 8 | +# capability exists only for tenants that opted into the shared backend; the |
| 9 | +# operator sets it alongside the monitoring chart's tracingCollector.backend=central. |
| 10 | +# |
| 11 | +# Known limitation of the account-0 shared model: selection is by pod label, so |
| 12 | +# a tenant able to create pods could label one otel-traces, obtain this egress, |
| 13 | +# and write spans with an arbitrary `tenant` resource attribute into the shared |
| 14 | +# store. Real write- and read-side isolation on a shared backend needs an |
| 15 | +# authenticating proxy (vmauth) that derives the tenant from identity — deferred |
| 16 | +# future work per the design. Use the default per-tenant backend for hard |
| 17 | +# isolation. |
| 18 | +# |
| 19 | +# Kept in its own template file (one document, no empty guarded blocks) so the |
| 20 | +# opt-in/off-by-default contract is reliably assertable in helm-unittest. |
| 21 | +apiVersion: cilium.io/v2 |
| 22 | +kind: CiliumClusterwideNetworkPolicy |
| 23 | +metadata: |
| 24 | + name: {{ include "tenant.name" . }}-egress-traces-central |
| 25 | +spec: |
| 26 | + endpointSelector: |
| 27 | + matchLabels: |
| 28 | + "k8s:io.kubernetes.pod.namespace": "{{ include "tenant.name" . }}" |
| 29 | + "k8s:app.kubernetes.io/name": "otel-traces" |
| 30 | + egress: |
| 31 | + - toEndpoints: |
| 32 | + - matchLabels: |
| 33 | + "k8s:app.kubernetes.io/name": "vtinsert" |
| 34 | + "k8s:io.kubernetes.pod.namespace": tenant-root |
| 35 | +{{- end }} |
0 commit comments