F5SPKStaticRoute

Note

Deprecated as of 2.4.0. Use an Infra resource instead.

Overview

Function

Declares a static route for a CNE instance, defining the destination, gateway, and interface used to route traffic.

Names

Singular name

Plural name

Short name

f5-spk-staticroute

f5-spk-staticroutes

—

API group and version

k8s.f5net.com/v1

Scope

Namespace

Specification

spec

Field

Required

Default

Description

destination
string

No

""

IPv4 address used for routing to the destination. Maximum length is 15 characters. When destination is 0.0.0.0, prefixLen must be 0. Otherwise, prefixLen must be 1 to 32.

destination_v6
string

No

""

IPv6 address used for routing to the destination. Maximum length is 39 characters. When destination_v6 is ::, prefixLen_v6 must be 0. Otherwise, prefixLen_v6 must be 1 to 128.

dynamic
boolean

No

false

Specifies whether this is a dynamic route. When false, this is a static route. Accepted values: true, false.

prefixLen
integer

No

32

Prefix length for the configured destination IPv4 address. Accepted values: 0 to 32.

prefixLen_v6
integer

No

120

Prefix length for the configured destination IPv6 address. Accepted values: 0 to 128.

type
string

No

gateway

Type of route to set, for example gateway or gateway_v6. Must be 1 to 255 characters.

gateway
string

No

""

IPv4 destination gateway address for routing the traffic. Maximum length is 32 characters.

gateway_v6
string

No

""

IPv6 destination gateway address for routing the traffic. Maximum length is 39 characters.

interface
string

No

""

Network interface responsible for receiving the incoming traffic. Maximum length is 255 characters.

vrf
string

No

""

Name of the VRF (tenant) this static route belongs to. When you don’t set this, the route is created in the default route domain. This field is immutable after creation. Maximum length is 255 characters.

Example manifest

apiVersion: "k8s.f5net.com/v1"
kind: F5SPKStaticRoute
metadata:
  name: "staticroute-ipv4"
  namespace: spk-ingress
spec:
  destination: 10.10.1.100
  prefixLen: 32
  type: gateway
  gateway: 10.146.134.1

Deployment

Use the following steps to deploy the example F5SPKStaticRoute CR, and verify the BIG-IP Next for Kubernetes TMM configuration.

  1. Copy the Example Manifest into a YAML file:

    apiVersion: "k8s.f5net.com/v1"
    kind: F5SPKStaticRoute
    metadata:
      name: "staticroute-ipv4"
      namespace: spk-ingress
    spec:
      destination: 10.10.1.100
      prefixLen: 32
      type: gateway
      gateway: 10.146.134.1
    
  2. Install the F5SPKStaticRoute CR:

    $ kubectl apply -f staticroute-ipv4.yaml -n f5-bnk # kind: F5SPKStaticRoute in f5-bnk
     f5spkstaticroute.k8s.f5net.com/staticroute-ipv4 created
    
  3. Verify the status of the installed CR:

    $ kubectl get f5-spk-staticroutes -n f5-bnk
    

    In this example, the CR has installed successfully. An installation failure may indicate an improper configuration. For example; no route to host.

    
    

NAME READY MESSAGE AGE staticroute-ipv4 True CR config sent to all grpc endpoints 15s


4. To verify the static route configuration, log in to the BIG-IP Next for Kubernetes TMM container and show the routing table:

_In this example, TMM is installed in the **spk-ingress** Project:_

```shell
kubectl exec -it deploy/f5-tmm -n f5-bnk -- bash
ip route

In this example, the gateway IP address is a remote host on TMM’s external VLAN:

default via 169.254.0.254 dev tmm
10.10.1.100 via 10.146.134.1 dev external
10.20.2.0/24 dev external proto kernel scope link src 10.146.134.2