This tutorial demonstrates how to implement basic network policies on CoreWeave Kubernetes Service (CKS) clusters to segment and secure Pod-to-Pod communication. By the end, you have a working default-deny network policy and a targeted allow rule, validated with test Pods. You’ll learn the rationale behind each step, CoreWeave-specific best practices, and how to validate your configuration. This tutorial is intended for platform engineers and cluster operators who need to enforce Pod-level network segmentation on CKS.Documentation Index
Fetch the complete documentation index at: https://docs.coreweave.com/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
- CKS cluster: You need access to a CoreWeave Kubernetes Service (CKS) cluster. CKS runs on bare-metal nodes with hardware isolation (NVIDIA BlueField-3 DPU) and uses the Cilium CNI by default for high-performance, eBPF-powered policy enforcement.
kubectlaccess: Ensurekubectlis installed and configured for your cluster identity and namespace.
Create or use an existing namespace
Namespaces provide logical segmentation and isolation in Kubernetes. They are foundational for multi-tenancy and enforcing network policies scoped to individual teams or workloads. This step ensures your resources don’t interfere with others and that network policies apply only within your segment. Replace[NAMESPACE] in the following examples with a name relevant to your application.
Deploy sample Pods
Deploy two simple Pods:backend: an NGINX server exposing port80, labeledapp: backend.frontend: a BusyBox Pod runningsleep, labeledapp: frontend.
backend, you exercise least privilege for service access.
Create a default deny policy for your namespace
By default, Pods in Kubernetes can communicate freely. In CoreWeave environments, this is mitigated by a defense-in-depth architecture (hardware isolation, Cilium default policies), but explicit Kubernetes network policies are still recommended for application-level segmentation. This policy blocks all ingress and egress traffic to Pods in the namespace unless specifically permitted:Create an allow policy for frontend to backend access
This policy allows only thefrontend Pod to access the backend Pod on any port. No other Pod in the namespace, nor from outside, can reach backend.
backend Pod and allows ingress traffic only from Pods labeled app: frontend within the same namespace. All other traffic remains denied, implementing the principle of least privilege where only specifically required connections are permitted.
At this point, your namespace has both a default-deny policy and a targeted allow rule. The following section confirms that these policies are working as expected.
Validate your network policies
Validation is crucial to ensure your policies have the intended effect. Here’s how to test and confirm enforcement:-
Enter the
frontendPod and attempt to reachbackend:You should receive the NGINX welcome message. -
Deploy a third Pod to test isolation:
Inside this shell, run:The connection should be refused or time out, demonstrating that only
frontendhas access. -
Confirm logs and network policy enforcement:
Check that your network policies are active and being enforced:
You should see both policies listed as active, with the correct Pod selectors and rules configured. To observe policy enforcement in action:When you run the connection tests from steps 1 and 2, you should see log entries showing allowed connections from
frontendand dropped connections from unauthorized Pods.