EgressGateway¶
Overview¶
The EgressGateway custom resource defines how application pods in selected namespaces send outbound traffic through a specific egress gateway.
Key characteristics:
Supports egress through both VLAN and VXLAN encapsulation
Supports multi-tenancy — deploy multiple EgressGateway CRs for different tenants
An EgressGateway creates IPv4 and IPv6 wildcard virtual servers when it has resolved dependencies, matching running pods, and active Traffic Management Microkernel (TMM) devices. When Calico with SNAT is used, Vxlan IPs are used as source addresses.
Does not include DNS46, NAT46, or DNS Virtual Server functionality
Scope and persona¶
Scope: Namespaced. Can be deployed in any namespace. The referenced GatewaySettings CR must be in the same namespace.
Persona: Application developer or tenant administrator.
API details¶
Property |
Value |
|---|---|
API group |
|
API version |
|
Kind |
|
Short name |
|
Scope |
Namespaced |
Spec fields¶
All three top-level fields are required: gatewayClassName, infrastructure, and sourceSelector.
Note
VLAN versus VXLAN is a cluster-wide setting, not configurable per EgressGateway. While EgressGateway supports both VLAN and VXLAN, the chosen mode is derived from the singleton Infra resource (
spec.egressDefaults) and applied to all EgressGateways. Individual EgressGateway resources cannot override this selection. To change the encapsulation mode, update the Infra resource.The
gatewayClassNamefield cannot be modified after the EgressGateway custom resource (CR) is created. If you need to change this value, delete and recreate the EgressGateway CR.
gatewayClassName¶
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
References the GatewayClass that binds this EgressGateway to the CNE controller. Determines which controller processes this CR. Length: 1–253 characters. Immutable. |
infrastructure¶
Infrastructure-level configuration for the EgressGateway.
parametersRef¶
References a GatewaySettings CR in the same namespace. Namespace scoping prevents cross-tenant reference escalation.
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
Name of the GatewaySettings resource. Length: 1–253 characters. Immutable. |
|
string |
Yes |
References a specific |
sourceSelector¶
Defines which pods are selected for egress through this gateway.
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
Determines how source pods are selected. Accepted values: |
|
object |
Conditional |
Namespace selection criteria. Required when |
|
object |
Conditional |
Pod selection criteria. Required when |
selectionMode values¶
Mode |
Behavior |
Required fields |
|---|---|---|
|
Selects all pods within the specified namespaces. |
|
|
Selects specific pods matched by pod selectors, across all namespaces. |
|
|
Selects pods that satisfy both namespace and pod selection criteria (intersection). |
|
namespaces¶
Field |
Type |
Required |
Description |
|---|---|---|---|
|
object (map) |
Conditional |
Selects namespaces by label key-value pairs. |
|
array of strings |
Conditional |
Selects namespaces by explicit name. Min 1 item. |
At least one of matchLabels or matchNames must be specified. When both are provided, the result is an intersection of all matched namespaces.
pods¶
Field |
Type |
Required |
Description |
|---|---|---|---|
|
object (map) |
Conditional |
Selects pods by label key-value pairs. |
|
array |
Conditional |
Selects pods by set-based label expressions. |
At least one of matchLabels or matchExpressions must be specified. When both are provided, pods must satisfy both (intersection).
matchExpressions¶
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
The label key that the selector applies to. |
|
string |
Yes |
Relationship to the set of values. Accepted values: |
|
array of strings |
Conditional |
An array of string values. Required and non-empty for |
Validation rules¶
Rule |
Message |
|---|---|
|
“pods must be specified when selectionMode is PodSelector” |
|
“namespaces must be specified when selectionMode is NamespaceSelector” |
|
“both namespaces and pods must be specified when selectionMode is Combined” |
|
“In/NotIn operators require non-empty values; Exists/DoesNotExist must have empty values” |
|
“gatewayClassName is immutable” |
Status fields¶
The controller populates the status section after reconciliation.
Top-level status¶
Field |
Type |
Description |
|---|---|---|
|
integer |
Most recent |
|
array |
Conditions describing the current state. Max 8 conditions. |
Condition types¶
Type |
Description |
|---|---|
|
The resource is syntactically valid and admitted by the controller. |
|
The controller has successfully programmed the resource on TMM. |
|
All referenced resources (GatewaySettings, etc.) are available and valid. |
Known reason values¶
Reason |
Description |
|---|---|
|
Reconciliation in progress (happy path). |
|
Fully reconciled (happy path). |
|
Spec is invalid. The controller surfaces the error and does not retry. Alias: |
|
A referenced resource does not exist. Create or check the referenced resource. |
|
A transient infrastructure issue occurred. |
Printer columns¶
When you run kubectl get egressgateways, the following columns display:
Column |
Source |
|---|---|
Programmed |
|
Age |
|
Example¶
apiVersion: gateway.k8s.f5.com/v1alpha1
kind: EgressGateway
metadata:
name: bnk-egress
namespace: f5-gateways
spec:
gatewayClassName: f5-bnk-gateways
infrastructure:
parametersRef:
name: my-gateway-settings
sectionName: default-egress
sourceSelector:
selectionMode: Combined
namespaces:
matchLabels:
tier: production
matchNames:
- my-tenant-ns
pods:
matchLabels:
app: web-app
version: v1