Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add netpol template for traefik #6452

Merged
merged 1 commit into from
Aug 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 28 additions & 2 deletions pkg/rke2/np.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ var defaultKubeSystemPolicies = []policyTemplate{
},
},
{
// allows for all http and https traffic into the kube-system namespace to the ingress controller pods
// allows for all http and https traffic into the kube-system namespace to the ingress-nginx controller pods
name: "default-network-ingress-policy",
annotationKey: "np.rke2.io/ingress",
podSelector: metav1.LabelSelector{MatchLabels: labels.Set{"app.kubernetes.io/name": "rke2-ingress-nginx"}},
Expand All @@ -111,7 +111,7 @@ var defaultKubeSystemPolicies = []policyTemplate{
},
},
{
// allows for https traffic into the to the ingress controller webhook
// allows for https traffic into the to the ingress-nginx controller webhook
name: "default-network-ingress-webhook-policy",
annotationKey: "np.rke2.io/ingress-webhook",
podSelector: metav1.LabelSelector{MatchLabels: labels.Set{"app.kubernetes.io/name": "rke2-ingress-nginx"}},
Expand All @@ -129,6 +129,32 @@ var defaultKubeSystemPolicies = []policyTemplate{
},
},
},
{
// allows for all http and https traffic into the kube-system namespace to the traefik ingress controller pods
name: "default-network-traefik-policy",
annotationKey: "np.rke2.io/ingress",
podSelector: metav1.LabelSelector{MatchLabels: labels.Set{"app.kubernetes.io/name": "rke2-traefik"}},
ingress: []v1.NetworkPolicyIngressRule{
{
Ports: []v1.NetworkPolicyPort{
{
Protocol: &tcp,
Port: &intstr.IntOrString{
Type: intstr.String,
StrVal: "http",
},
},
{
Protocol: &tcp,
Port: &intstr.IntOrString{
Type: intstr.String,
StrVal: "https",
},
},
},
},
},
},
{
// allows for https traffic into the CSI snapshot validation webhook
name: "default-network-snapshot-validation-webhook-policy",
Expand Down
Loading