F5BnkGateway¶
Note
Deprecated as of 2.4.0. Use a GatewaySettings resource instead.
Overview¶
Function¶
Declares the CIDR range for dual-stack, IPv4, or IPv6 addressing in a CNE instance. The system uses the CIDR block to allocate IP addresses for the service.
Using this resource is optional. When you apply it, the F5 IPAM controller allocates the IP address in the IPAM resource, and the gateway resource is updated with the allocated IP address and status. The system also validates the static IP address in the gateway resource against the CIDR range. When you don’t apply it, the gateway resource isn’t updated with an IP address, and the system doesn’t validate the static IP address.
Names¶
Singular name |
Plural name |
Short name |
|---|---|---|
f5-bnkgateway |
f5-bnkgateways |
— |
API group and version¶
k8s.f5net.com/v1
Scope¶
Namespace
Specification¶
spec¶
Field |
Required |
Default |
Description |
|---|---|---|---|
|
No |
— |
Configuration for ingress traffic. |
spec.ingressConfig¶
Field |
Required |
Default |
Description |
|---|---|---|---|
|
No |
— |
List of default listener networks. Must contain no more than 16 items. |
Note
All networks must use the same provider. Use either f5-ip-provider for all networks or infoblox for all networks.
spec.ingressConfig.defaultListenerNetworks[]¶
Set only one of ipv4BaseCidr or ipv6BaseCidr. Set at least one of ipv4BaseCidr, ipv6BaseCidr, or both startAddress and endAddress.
Field |
Required |
Default |
Description |
|---|---|---|---|
|
Yes |
— |
Name or label that identifies the IP block. Must be 1 to 64 characters. |
|
No |
— |
Base CIDR for IPv4 addresses. |
|
No |
— |
Base CIDR for IPv6 addresses. |
|
No |
— |
Starting address of the network range. Can be an IPv4 or IPv6 address. |
|
No |
— |
Ending address of the network range. Can be an IPv4 or IPv6 address. |
|
No |
— |
Availability zone for this CIDR block in cloud environments. Required for zone-aware IP allocation. |
|
No |
|
IP address provider. Accepted values: |
|
No |
— |
Infoblox network view. Required when |
Example manifest¶
The following manifest defines the CIDR range, start address, and end address for an IPv4 listener network and an IPv6 listener network. The system applies these values to the IPAM resource so the F5 IPAM controller (FIC) can allocate IP addresses.
apiVersion: k8s.f5net.com/v1
kind: F5BnkGateway
metadata:
name: my-gateway
namespace: f5-bnk
spec:
ingressConfig:
defaultListenerNetworks:
- name: default_ipv4
ipv4BaseCidr: 198.51.100.100/24
startAddress: 198.51.100.160
endAddress: 198.51.100.170
- name: default_ipv6
ipv6BaseCidr: 2001:db8::22:22:22:100/112
startAddress: 2001:db8::22:22:22:161
endAddress: 2001:db8::22:22:22:170
Note
Make sure this resource shares the same name and namespace as the gateway resource it provides IPAM services for. Make sure each listener network item specifies either ipv4BaseCidr or ipv6BaseCidr, but not both. For dual-stack configurations, create separate items: one for IPv4 and one for IPv6.
Prerequisites¶
Before you configure this resource, make sure that:
The
F5SPKVlanresource is configured.
Apply the resource¶
To apply the resource in a namespace:
Copy the example manifest into a
bnkgateway.yamlfile, then modify and save it.Verify that the CNE controller is installed in the namespace.
Apply the resource in the same namespace as the CNE controller:
kubectl apply -f bnkgateway.yaml -n f5-bnk
Verify the resource:
kubectl get f5-bnkgateways -n f5-bnk
Use cases¶
This section lists how the application behaves when BNKGateway is applied and not applied.
BNKGateway is applied
When BNKGateway CR is applied,
F5 IPAM controller allocates the IP address in the IPAM CR, and the gateway resource is updated with the allocated IP address and relevant status.
The static IP address specified in the gateway resource is validated based on the CIDR range specified in the BNKGateway CR.
BNKGateway is not applied
When BNKGateway is not applied,
The gateway resource is not updated with the IP address and relevant status.
F5 IPAM controller does not validate the static IP address specified in the gateway resource.
For more details on Gateway CR and how to use, see Gateway.
Sample BNKGateway CR¶
This example CR defines the CIDR range, start address, and end address for each listener network (IPv4 and IPv6). The defined values are applied to the IPAM CR to enable the FIC to allocate IP address.
apiVersion: k8s.f5net.com/v1
kind: F5BnkGateway
metadata:
name: my-gateway
namespace: f5-bnk
spec:
ingressConfig:
defaultListenerNetworks:
- name: default_ipv4
ipv4BaseCidr: 22.22.22.100/24
startAddress: 22.22.22.160
endAddress: 22.22.22.170
- name: default_ipv6
ipv6BaseCidr: 2002::22:22:22:100/112
startAddress: 2002::22:22:22:161
endAddress: 2002::22:22:22:170
BNKGateway CRD Parameters¶
This section provides the list of parameters and the related attributes of the BNKGateway. You must deploy BNKGateway within a Kubernetes namespace to manage the IP addresses using the F5 IPAM controller.
The table below includes the parameter name, description, and default value of the parameters available in the spec section of BNKGateway.
Parameter |
Description |
|---|---|
|
Specifies that the configuration is for ingress traffic. |
|
Specifies the list of default listener networks. |
|
Specifies name or label for identifying the IP Block. |
|
Specifies the base CIDR for IPv4 addresses. |
|
Specifies the base CIDR for IPv6 addresses. |
|
Specifies the starting address of the network range. The value can be for either IPv4 or IPv6. |
|
Specifies the last address of the network range. The value can be for either IPv4 or IPv6. |
Configure BNKGateway¶
Prerequisites¶
Make sure the F5SPKVlan resource is configured.
Create BNKGateway resource¶
To create the BNKGateway CR in the namespace with CIDR range,
Copy the above sample code to a yaml file. For eg:<test-bnkgateway>.yaml
Modify and save the yaml file.
Verify if the CNE controller is installed in the namespace.
Apply the BNKGateway CR in the same namespace where the CNE controller is installed.
Use the below command to appy the CR.
$ kubectl apply -f <test-bnkgateway>.yaml -n <namespace-name>
Example
$ kubectl apply -f bnkgateway.yaml -n f5-bnk
f5bnkgateway.k8s.f5net.com/my-gateway created
Note
Make sure this resource shares the same name and namespace as the Gateway resource for which IPAM services are provided.
Make sure each listener network item specify either
ipv4BaseCidroripv6BaseCidr, but not both. For dual‑stack configurations, create separate items: one for IPv4 and one for IPv6.
Verify BNKGateway CR¶
Use the below command to very if the Netpolicy CR status.
$ kubectl get f5-bnkgateways -n <namespace>
Example
$ kubectl get f5-bnkgateways -n f5-bnk
NAME READY MESSAGE AGE
my-gateway True CR config sent to all grpc endpoints 25s
Editing the resource¶
This section provides the details to edit this resource. You can perform the following actions,
You must recreate the file to edit the CIDR range of the listener network. See Modify the CIDR range
You can only increase the IP pool size by editing the start and end IP addresses for the defined CIDR range. See Modify the IP addresses
Modify the CIDR range¶
To modify the CIDR range of the configured network,
Delete the existing BNKGateway CR (for example, test-bnkgateway.yaml) file from the namespace.
Create a new BNKGateway CR file with the modified IPv4 or IPv6 CIDR ranges using these parameters:
ingressConfig.defaultListenerNetworks.ipv4BaseCidr
ingressConfig.defaultListenerNetworks.ipv6BaseCidr.
Apply the new BNKGateway CR file to the namespace.
Note
You cannot change the CIDR range using Insert mode.
You may edit the CIDR range if you experience any one of these situations,
Incorrect CIDR range.
Include or delete a CIDR range
Modify the IP addresses¶
To extend the size of an IP pool (startAddress and endAddress) for the defined CIDR range,
Open the BNKGateway CR (for example, test-bnkgateway.yaml)file in the editor.
Edit the startAddress or/and endAddress of the required IP version (IPv4 or IPv6). The examples in the following table describe the possible edits,
IP address
From
To
Description
IPv4 startAddress
10.42.1.250
10.42.1.248
The start address can only be decreased.
IPv4 endAddress
10.42.1.253
10.42.1.254
The end address can only be increased.
IPv6 startAddress
2001:db8::f1
2001:db8::f0
The start address can only be decreased.
IPv6 endAddress
2001:db8::f4
2001:db8::f6
The IP address can only be increased.
Save and close the file.
You may edit the IP address if you experience any one of these situations,
Increase IP pool size.
Configuration issue due to incorrect IP address.