Skip to content

Commit dc26f4f

Browse files
stubbiclaude
andauthored
fix: allow OTEL collector egress in NetworkPolicy (#40)
fix: allow OTEL collector egress in NetworkPolicy (ports 4317/4318) The NetworkPolicy blocked gRPC/HTTP connections to the OTEL collector, silently dropping trace exports. Adds egress rules for the standard OTLP ports. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 9c16a85 commit dc26f4f

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

internal/resources/networkpolicy.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,20 @@ func BuildNetworkPolicy(instance *paperclipv1alpha1.Instance) *networkingv1.Netw
6363
},
6464
}
6565

66+
// Allow egress to OTEL collector (gRPC + HTTP) for traces and metrics
67+
np.Spec.Egress = append(np.Spec.Egress, networkingv1.NetworkPolicyEgressRule{
68+
Ports: []networkingv1.NetworkPolicyPort{
69+
{
70+
Port: Ptr(intstr.FromInt32(4317)),
71+
Protocol: Ptr(corev1.ProtocolTCP),
72+
},
73+
{
74+
Port: Ptr(intstr.FromInt32(4318)),
75+
Protocol: Ptr(corev1.ProtocolTCP),
76+
},
77+
},
78+
})
79+
6680
// Allow egress to K8s API server when cloud sandbox is enabled.
6781
// The server needs to create/manage sandbox pods via the K8s API.
6882
// An explicit rule is needed because some CNIs (k3s Flannel, Calico)

0 commit comments

Comments
 (0)