-
Notifications
You must be signed in to change notification settings - Fork 138
Add allowedSourcePrefixes annotation documentation #2613
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,52 @@ | ||||||
| --- | ||||||
| description: Allow pods to send traffic with a source IP address outside their own using the allowedSourcePrefixes annotation. | ||||||
| --- | ||||||
|
|
||||||
| # Allow pods to use additional source IP prefixes | ||||||
|
|
||||||
| ## Big picture | ||||||
|
|
||||||
| Allow pods to send egress traffic using source IP addresses outside their own pod IP, by specifying allowed source prefixes. | ||||||
|
|
||||||
| ## Value | ||||||
|
|
||||||
| By default, Calico blocks egress traffic from pods when the source IP does not match the pod IP. This is a security measure to prevent IP spoofing. In certain use cases, such as pods acting as a transparent proxy that preserves the original source IP, pods need to send traffic with a different source address. | ||||||
|
|
||||||
| ## Concepts | ||||||
|
|
||||||
| ### Source IP spoofing protection | ||||||
|
|
||||||
| Calico programs dataplane rules that drop egress packets from a pod if the source IP does not match the pod's own IP. The `allowedSourcePrefixes` annotation relaxes this restriction for specific IP prefixes on a per-pod basis. | ||||||
|
Check failure on line 19 in calico-cloud/networking/configuring/allowed-source-prefixes.mdx
|
||||||
|
|
||||||
| ### FelixConfiguration prerequisite | ||||||
|
|
||||||
| Because allowing non-pod source IPs is a security-sensitive operation, Felix disables support for the annotation by default. You must explicitly opt in by setting `workloadSourceSpoofing: Any` in the FelixConfiguration resource before the annotation takes effect. | ||||||
|
|
||||||
| ## Before you begin... | ||||||
|
|
||||||
| Enable `workloadSourceSpoofing` in the FelixConfiguration resource: | ||||||
|
|
||||||
| ```yaml | ||||||
| apiVersion: crd.projectcalico.org/v1 | ||||||
|
||||||
| apiVersion: crd.projectcalico.org/v1 | |
| apiVersion: projectcalico.org/v3 |
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,52 @@ | ||||||||||||
| --- | ||||||||||||
| description: Allow pods to send traffic with a source IP address outside their own using the allowedSourcePrefixes annotation. | ||||||||||||
| --- | ||||||||||||
|
|
||||||||||||
| # Allow pods to use additional source IP prefixes | ||||||||||||
|
|
||||||||||||
| ## Big picture | ||||||||||||
|
|
||||||||||||
| Allow pods to send egress traffic using source IP addresses outside their own pod IP, by specifying allowed source prefixes. | ||||||||||||
|
|
||||||||||||
| ## Value | ||||||||||||
|
|
||||||||||||
| By default, Calico blocks egress traffic from pods when the source IP does not match the pod IP. This is a security measure to prevent IP spoofing. In certain use cases, such as pods acting as a transparent proxy that preserves the original source IP, pods need to send traffic with a different source address. | ||||||||||||
|
|
||||||||||||
| ## Concepts | ||||||||||||
|
|
||||||||||||
| ### Source IP spoofing protection | ||||||||||||
|
|
||||||||||||
| Calico programs dataplane rules that drop egress packets from a pod if the source IP does not match the pod's own IP. The `allowedSourcePrefixes` annotation relaxes this restriction for specific IP prefixes on a per-pod basis. | ||||||||||||
|
Check failure on line 19 in calico-enterprise/networking/configuring/allowed-source-prefixes.mdx
|
||||||||||||
|
|
||||||||||||
| ### FelixConfiguration prerequisite | ||||||||||||
|
|
||||||||||||
| Because allowing non-pod source IPs is a security-sensitive operation, Felix disables support for the annotation by default. You must explicitly opt in by setting `workloadSourceSpoofing: Any` in the FelixConfiguration resource before the annotation takes effect. | ||||||||||||
|
|
||||||||||||
| ## Before you begin... | ||||||||||||
|
|
||||||||||||
| Enable `workloadSourceSpoofing` in the FelixConfiguration resource: | ||||||||||||
|
|
||||||||||||
|
Comment on lines
+27
to
+28
|
||||||||||||
| Enable `workloadSourceSpoofing` in the FelixConfiguration resource: | |
| Ensure the following prerequisites are met: | |
| - Your cluster is configured to use the Calico CNI plugin. | |
| - `workloadSourceSpoofing` is enabled in the FelixConfiguration resource: |
Copilot
AI
Mar 27, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The FelixConfiguration YAML example uses apiVersion: crd.projectcalico.org/v1, but other docs in this product use projectcalico.org/v3 for FelixConfiguration. Please align the apiVersion here (or explicitly call out when each apiVersion applies) to avoid users applying the wrong manifest.
| apiVersion: crd.projectcalico.org/v1 | |
| apiVersion: projectcalico.org/v3 |
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,52 @@ | ||||||||
| --- | ||||||||
| description: Allow pods to send traffic with a source IP address outside their own using the allowedSourcePrefixes annotation. | ||||||||
| --- | ||||||||
|
|
||||||||
| # Allow pods to use additional source IP prefixes | ||||||||
|
|
||||||||
| ## Big picture | ||||||||
|
|
||||||||
| Allow pods to send egress traffic using source IP addresses outside their own pod IP, by specifying allowed source prefixes. | ||||||||
|
|
||||||||
| ## Value | ||||||||
|
|
||||||||
| By default, Calico blocks egress traffic from pods when the source IP does not match the pod IP. This is a security measure to prevent IP spoofing. In certain use cases, such as pods acting as a transparent proxy that preserves the original source IP, pods need to send traffic with a different source address. | ||||||||
|
|
||||||||
| ## Concepts | ||||||||
|
|
||||||||
| ### Source IP spoofing protection | ||||||||
|
|
||||||||
| Calico programs dataplane rules that drop egress packets from a pod if the source IP does not match the pod's own IP. The `allowedSourcePrefixes` annotation relaxes this restriction for specific IP prefixes on a per-pod basis. | ||||||||
|
Check failure on line 19 in calico/networking/configuring/allowed-source-prefixes.mdx
|
||||||||
|
|
||||||||
| ### FelixConfiguration prerequisite | ||||||||
|
|
||||||||
| Because allowing non-pod source IPs is a security-sensitive operation, Felix disables support for the annotation by default. You must explicitly opt in by setting `workloadSourceSpoofing: Any` in the FelixConfiguration resource before the annotation takes effect. | ||||||||
|
|
||||||||
| ## Before you begin... | ||||||||
|
|
||||||||
|
||||||||
| Ensure your cluster is configured to use the Calico CNI plugin. |
Copilot
AI
Mar 27, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The FelixConfiguration YAML example uses apiVersion: crd.projectcalico.org/v1, but other docs in this product use projectcalico.org/v3 for FelixConfiguration. Please align the apiVersion here (or explicitly call out when each apiVersion applies) to avoid users applying the wrong manifest.
| apiVersion: crd.projectcalico.org/v1 | |
| apiVersion: projectcalico.org/v3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This page documents a Calico CNI pod annotation, but the prerequisites don’t mention that the cluster must be using Calico CNI (as is done in other annotation docs in this section). Add that prerequisite (and optionally link to the CNI plugin configuration page) before the FelixConfiguration step.