- opentelemetry-collector/uralkal: kafka exporter (telemetry.traces, otlp_proto,
SASL_SSL, creds from otel-collector-kafka + kafka-ca), NetworkPolicy egress to kafka ns
- security-audit: add {topic: telemetry.traces, kind: traces} pipeline to
audit-processor config (requires k8s-audit-processor image with traces support —
update the pinned digest after CI build)
36 lines
1.7 KiB
YAML
36 lines
1.7 KiB
YAML
# Коллектору нужны только DNS, приём трейсов из mesh и egress в Kafka.
|
|
# По образцу security-audit/base/networkpolicy*.yaml.
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: NetworkPolicy
|
|
metadata:
|
|
name: otel-collector
|
|
spec:
|
|
podSelector:
|
|
matchLabels:
|
|
telemetry/collector: traces # podLabels HelmRelease opentelemetry-collector
|
|
policyTypes: [Ingress, Egress]
|
|
ingress:
|
|
# Трейсы принимаются от всех workload'ов mesh (sidecar'ы приложений, ingress-шлюз):
|
|
# список namespace-источников — весь контур, поэтому ограничение только по портам.
|
|
- ports:
|
|
- {port: 4317, protocol: TCP} # OTLP gRPC (приложения)
|
|
- {port: 4318, protocol: TCP} # OTLP HTTP (приложения)
|
|
- {port: 9411, protocol: TCP} # zipkin от sidecar'ов (meshConfig.defaultConfig.tracing)
|
|
- {port: 13133, protocol: TCP} # health_check (liveness/readiness kubelet)
|
|
egress:
|
|
- to:
|
|
- namespaceSelector:
|
|
matchLabels: {kubernetes.io/metadata.name: kube-system}
|
|
podSelector:
|
|
matchLabels: {k8s-app: kube-dns}
|
|
- ipBlock: {cidr: 169.254.25.10/32} # nodelocaldns kubespray; TODO(verify): enable_nodelocaldns в контуре
|
|
ports:
|
|
- {port: 53, protocol: UDP}
|
|
- {port: 53, protocol: TCP}
|
|
# client-листенер SASL_SSL: bootstrap kafka-kafka-contour и advertised-адреса подов controller-headless.
|
|
- to:
|
|
- namespaceSelector:
|
|
matchLabels: {kubernetes.io/metadata.name: kafka}
|
|
ports:
|
|
- {port: 9092, protocol: TCP}
|