Prerequisites
- Aviatrix Controller 8.2 or later
- CoPilot 4.31 or later
- DCF for Kubernetes enabled with Log Enrichment turned on
- A cloud account onboarded in CoPilot for the cloud provider hosting the Kubernetes cluster
- MCP servers deployed as Kubernetes workloads via Helm, ArgoCD, Kustomize, or
kubectl apply
Procedure
- CoPilot UI
- Terraform
1
Deploy an Aviatrix spoke gateway in the cluster VPC
An Aviatrix spoke gateway in the same VPC as your Kubernetes cluster is the
enforcement point where the Aviatrix controller applies containment policy to
MCP server egress traffic.
- In CoPilot, navigate to Cloud Fabric > Gateways > Spoke Gateways and click + Spoke Gateway.
-
Provide the following details:
- In the Instances section, select a subnet in the cluster VPC for the gateway instance.
- Click Save.
2
Install the Aviatrix Kubernetes Firewall Helm chart
The Aviatrix Kubernetes Firewall Helm chart deploys the in-cluster components
that allow the Aviatrix controller to reconcile and enforce containment policies
on the cluster.Run the following command against the target cluster, replacing
<chart-version> with the current chart version from the
Aviatrix k8s-firewall-charts repository:3
Verify Aviatrix CRD installation
The Helm chart installs two Aviatrix CRDs on the cluster. Verify both are
present before continuing:Expected output:If either CRD is missing, re-run the Helm installation and check the output for
errors.
4
Onboard the Kubernetes cluster to Aviatrix DCF
- Navigate to Cloud Resources > Cloud Assets > Kubernetes Clusters.
- Click Onboard next to the target cluster.
-
Choose the appropriate access method for your cloud provider:
- AWS (EKS): Select Terraform or Command Line, apply the generated access entry and RBAC configuration, check the confirmation box, then click Onboard.
- Azure (AKS): Select Permissions on Cloud Account if the Aviatrix service principal has the required permissions, or Kubeconfig File to upload a kubeconfig. Click Onboard.
- Wait for the cluster status to show Yes (green) on the Kubernetes Clusters tab.
EKS clusters require a
view-nodes ClusterRole so the Controller can discover
node metadata. The CoPilot onboarding dialog generates the required YAML
automatically — apply it before clicking Onboard.5
Label MCP server pods
Aviatrix containment policies target pods by Kubernetes label selector. Ensure
each MCP server Deployment includes a unique, consistent label that identifies
the server.The following example uses Use a label scheme that uniquely identifies each MCP server, for example
app: github-mcp-server:mcp-server: github or app: <server-name>. The same label is referenced in
the containment policy in the next step.6
Author a containment policy for each MCP server
A Apply the policy:Repeat for each MCP server, adjusting the
FirewallPolicy resource defines the allowed egress destinations for pods
matching a label selector. Create one policy per MCP server and commit it to the
same repository as the server’s Deployment manifest.The following example permits pods labelled app: github-mcp-server in the
mcp-servers namespace to reach only api.github.com. All other egress is
denied.name, matchLabels selector, and
domains list to match that server’s identity and permitted destinations.Commit the
FirewallPolicy manifest to the same repository directory as the
server’s Deployment. This ensures it travels through the same review, CI/CD,
and rollback process as the server definition it protects.7
Verify containment
-
Check policy events to confirm the policy was applied successfully:
A successful apply produces an event with
Reason: UpdatePolicyListSuccess. - Navigate to Security > Distributed Cloud Firewall and select the cluster. Confirm the policy appears with the correct egress allow-list for each MCP server.
-
To confirm egress blocking is active, attempt a connection from an MCP server
pod to a destination not in its
domainslist and verify it is denied. The denied attempt appears in CoPilot per-connection logs alongside the server’s allowed traffic.