F5SPKTrafficDistribution¶
Overview¶
The F5SPKTrafficDistribution CR Role is only at the SPK Controller. It reads the weights configured against deployments, calculates the ratio for pool members based on these weights, and pushes this information to TMM. However, the F5SPKTrafficDistribution CR is never sent to TMM.
Note: The F5SPKTrafficDistribution CR allows configuration of multiple deployments, with their weights summing up to exactly 100. This document guides you through understanding, configuring and installing a simple F5SPKTrafficDistribution CR.
CR Parameters¶
The table below describes the F5SPKTrafficDistribution CR parameters:
Parameter | Description |
---|---|
metadata.name |
The name of the F5SPKTrafficDistribution object in the Kubernetes configuration. |
spec¶
The table below describes the CR spec
parameters.
Parameter | Description |
---|---|
backendRefs.deploymentName |
Specifies the traffic distribution deployment name. |
backendRefs.weight |
Specifies the weight against deployment for traffic distribution. The max is 100. |
CR example¶
apiVersion: "k8s.f5net.com/v2alpha1"
kind: F5SPKTrafficDistribution
metadata:
name: "f5ing-td-tcp"
spec:
backendRefs:
deploymentName: tcp-testapp-8050-f5ing-testapp-0
weight: 70
deploymentName: tcp-testapp-8050-f5ing-testapp-1
weight: 30
CR shortName¶
CR shortNames provide an easy way to view installed CRs, and their configuration parameters. The CR shortName can also be used to delete the CR instance. The F5SPKTrafficDistribution CR shortName is trafficdistribution. View CR instance:
oc get trafficdistribution -n <project>
View CR configuration:
oc get trafficdistribution -n <project> -o yaml
Requirements¶
Ensure you have:
- Installed a K8S Service object and application.
- Installed the SPK Controller Pods.
- IInstalled the CRDs.
- Have a Linux based workstation.
Installation¶
Use the following steps to install the example F5SPKTrafficDistribution CR.
Switch to the application Project:
oc project <project>
In this example, the application is in the spk-apps Project:
oc project spk-apps
Copy the example F5SPKIngressTCP CR into a YAML file:
apiVersion: "ingresstcp.k8s.f5net.com/v2alpha1" kind: F5SPKIngressTCP metadata: name: "f5ing-td-tcp" namespace: "spk-apps" service: name: "f5ing-td-tcp" port: 8050 spec: destinationAddress: "192.168.1.123" destinationPort: 80 ipv6destinationAddress: "2001::100:100" idleTimeout: 30 loadBalancingMethod: "RATIO_MEMBER" trafficDistributionStrategy: "f5ing-td-tcp" snat: "SRC_TRANS_AUTOMAP" persist: mode: "PERSIST_TYPE_SRCADDR" timeout: 60 ipv4PrefixLength: 24 vlans: vlanList: - vlan-external monitors: tcp: - interval: 3 timeout: 10
Notes:
- Make sure the
spec.loadBalancingMethod
is RATIO_MEMBER. - F5SPKTrafficDistribution CR will be applicable for TCP CR in SPK v1.8.0
- Make sure the
Install the F5SPKIngressTCP CR:
oc apply -f spk-ingress-tcp.yaml
Verify the status of the installed CR:
oc get f5-spk-ingresstcp -n spk-apps
In this example, the CR has installed successfully. Installation failures may indicate a missing CR dependancy such as a referenced VLAN.
NAME STATUS MESSAGE f5ing-td-tcp SUCCESS CR config sent to all grpc endpoints
Copy the example F5SPKTrafficDistribution CR into a YAML file:
apiVersion: "k8s.f5net.com/v2alpha1" kind: F5SPKTrafficDistribution metadata: name: "f5ing-td-tcp" spec: backendRefs: deploymentName: tcp-testapp-8050-f5ing-testapp-0 weight: 70 deploymentName: tcp-testapp-8050-f5ing-testapp-1 weight: 30
Install the F5SPKTrafficDistribution CR:
oc apply -f td-cr-tcp.yaml
Verify the status of the installed CR:
oc get td-cr-tcp.yaml
In this example, the CR has installed successfully. Installation failures may indicate a missing CR dependancy such as a referenced VLAN.
NAME STATUS MESSAGE f5ing-td-tcp SUCCESS CR config sent to all grpc endpoints
Feedback¶
Provide feedback to improve this document by emailing spkdocs@f5.com.