Skip to content

Instantly share code, notes, and snippets.

@pjbgf
Created June 21, 2023 07:57
Show Gist options
  • Save pjbgf/aceb87e78ad28a62dba6349bdd678287 to your computer and use it in GitHub Desktop.
Save pjbgf/aceb87e78ad28a62dba6349bdd678287 to your computer and use it in GitHub Desktop.
Rancher Manager - Cilium Network Policies
apiVersion: cilium.io/v2
kind: CiliumNetworkPolicy
metadata:
name: webhook-strict
namespace: cattle-system
spec:
endpointSelector:
matchLabels:
app: rancher-webhook
ingress:
# Requests from apiserver running on host or remote-nodes.
- fromEntities:
- host
- remote-node
toPorts:
- ports:
- port: "9443"
- port: "8777" # capi
# Requests from apiserver.
- fromEndpoints:
- matchLabels:
"k8s:io.kubernetes.pod.namespace": kube-system
"k8s:k8s-app": kube-apiserver
toPorts:
- ports:
- port: "9443"
- port: "8777" # capi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment