F5 BIG-IP Container Ingress Services (CIS)
repository·master·Indexed 18 days ago
https://github.com/f5networks/k8s-bigip-ctlrF5 BIG-IP Container Ingress Services (CIS) enables F5 BIG-IP services for applications in Kubernetes and OpenShift environments. It supports the Application Services 3 (AS3) declarative API, allowing configuration via Kubernetes ConfigMaps and labels. Key features include AS3 override functionality, trusted certificate management, custom route domain configuration, and automated dependency management for Go packages via the Import-Packages script.
What's inside k8s-bigip-ctlr
- F5 BIG-IP Container Ingress Services (CIS) for Kubernetes and OpenShift makes F5 BIG-IP services available to applications running within these container orchestration platforms. It acts as a bridge between Kubernetes/OpenShift resources and F5 BIG-IP infrastructure.
Multicluster CIS User Guides
masterF5 Container Ingress Services (CIS) provides several deployment patterns for managing services across multiple Kubernetes clusters. Depending on your architecture requirements, you can follow these specific guides:
- Standalone CIS: Use a single, standalone CIS instance to manage services across multiple clusters.
- CIS High Availability (HA): Implement CIS HA use-cases specifically designed for multi-cluster environments.
- Multicluster HA with Active-Active Mode: Configure high availability across multiple clusters using an active-active traffic distribution model.
- Multicluster HA with Ratio Mode: Configure high availability across multiple clusters using a ratio-based traffic distribution model.
Access F5 Container Ingress Services (CIS) User Guides
masterThe F5 Container Ingress Services (CIS) documentation provides specialized guides for integrating BIG-IP with various Kubernetes and OpenShift environments. These guides cover advanced networking topologies, multi-cluster deployments, and specific integration patterns like ExternalDNS, IPAM, and IngressLink.
Key categories of guides include:
- OpenShift Specifics: Guides for OVN-Kubernetes (Standalone and HA), OpenShift SDN, and OpenShift Routes vs CRDs.
- Multi-Cluster & High Availability: Deployments using BIG-IP DNS Failover, Flannel, and AWS multi-AZ BIG-IP HA.
- Integration Patterns: Using ExternalDNS with NGINX or BIG-IP, IPAM (including Infoblox integration), and Prometheus for metrics.
- Platform Specifics: Support for EKS Anywhere, Rancher, and Kube-Vip.
- Advanced Networking: F5 IngressLink and Service Type LoadBalancer configurations.
What is NodePortLocal (NPL)?
masterNodePortLocal (NPL) is a feature of the Antrea Agent that allows each port of a Service backend Pod to be reachable from the external network using a specific port on the Node where the Pod is running. This enables direct node-level access to pod ports via assigned NodePorts.Overview of NextGenController and RouteGroups
masterThe NextGenController extends native Kubernetes/OpenShift routes using an
extendedConfigMap. This allows for centralized management of BIG-IP resources like Virtual Servers (VIPs) and partitions.RouteGroups
Routes are organized into RouteGroups based on either a
namespaceor anamespaceLabel.- Mutual Exclusivity: You must use either
namespaceornamespaceLabelfor all RouteGroups in a singleextendedConfigMap; you cannot mix them. - Shared Resources: All routes within a single RouteGroup share the same
vserverAddr(VIP address),vserverName,bigIpPartition, andpolicyCRdefined in theextendedRouteSpec.
Multiple VIP and Partition Support
- CIS creates one VIP per RouteGroup.
- To enable multiple VIP support, the controller mode must be set to
openshift. - CIS sends a unified AS3 declaration to BIG-IP to avoid multiple posts, using the format:
mgmt/shared/appsvcs/declare/tenant1,tenant2.
extendedRouteSpec: - namespace: foo vserverAddr: 10.8.0.4 vserverName: nextgenroutes allowOverride: true bigIpPartition: MultiTenant policyCR: default/sample-policy - namespace: bar vserverAddr: 10.8.0.5 allowOverride: false- Mutual Exclusivity: You must use either
Overview of Multi-Cluster Support in CIS
masterMulti-Cluster support in CIS allows you to expose applications spread across multiple OpenShift or Kubernetes clusters using a single BIG-IP Virtual Server. This is achieved by deploying CIS in either a Standalone or High Availability (HA) topology.
Key Capabilities
- Single Virtual Server: One BIG-IP VS can represent apps in different clusters.
- Supported Modes: CIS supports
nodePortmode. Cluster mode is available with static route configuration on BIG-IP (no tunnels required). - Resource Types: Apps can be exposed using
ServiceTypeLB,Route,VS(Virtual Server), orTS(Transport Server) CR resources.
Prerequisites
- The cluster node where CIS is deployed must have network reachability to the API servers of all managed OpenShift/Kubernetes clusters.
- An
ExtendedConfigMapmust be created to enable multi-cluster functionality. - Kube-config files for every cluster must be available to CIS so it can access Pods, Services, Endpoints, and Nodes.
Precedence Rules for WAF, Source Range, and SSL Profiles
masterWhen configuring security and SSL settings, NextGenController follows specific precedence rules depending on whether settings are defined in the Route, the Policy CR, or the Extended ConfigMap.
WAF (Web Application Firewall)
- Policy CR: Highest precedence (configures WAF at the VirtualServer/VIP level).
- Route Annotation: Second precedence (configures WAF at the LTM Policy level).
- Exception: If
allowOverride: trueis set in the RouteGroup'sextendedConfigMap, the Route Annotation takes precedence over the Policy CR.
- Exception: If
Allow Source Range
- Policy CR: Highest precedence.
- Route Annotation: Second precedence.
- Exception: If
allowOverride: trueis set in the RouteGroup'sextendedConfigMap, the Route Annotation takes precedence over the Policy CR.
- Exception: If
SSL Profiles
- Route Annotation (BIG-IP reference/secret): Highest precedence.
- Route Certificate (
spec.certs): Second precedence. - Extended ConfigMap (
defaultTLS): Lowest precedence.
Override Policy Profiles with TransportServer Profiles
masterWhen a
TransportServeris associated with aPolicyviaspec.policyName, the profiles defined directly in theTransportServerspec take precedence over those defined in thePolicyspec. This allows for granular, per-server overrides of protocol inspection settings.apiVersion: cis.f5.com/v1 kind: Policy metadata: name: base-tcp-policy namespace: default spec: profiles: profileProtocolInspection: "/Common/default_tcp_inspection" --- apiVersion: cis.f5.com/v1 kind: TransportServer metadata: name: custom-tcp-server namespace: default spec: virtualServerAddress: "10.192.75.112" virtualServerPort: 8443 type: tcp mode: standard policyName: base-tcp-policy profiles: profileProtocolInspection: "/Common/custom_tcp_inspection" # Overrides policy pool: service: secure-tcp-service servicePort: 8443Understand Active-Active and Ratio modes in Multi-Cluster CIS
masterCIS supports two primary modes for multi-cluster traffic distribution:
Active-Active Mode: Distributes traffic equally across all participating clusters. When CIS is running on the Primary cluster, it updates pool members for Virtual Servers using members from both the HA clusters (Primary and Secondary) and all other remotely monitored clusters. If the Primary cluster fails and the Secondary cluster takes control, it will populate pool members from the Secondary cluster and all other remotely monitored clusters regardless of the HA mode.
Ratio Mode: Distributes traffic across multiple clusters based on a specific ratio defined for each cluster.
Critical Requirement for Fail-over: To ensure successful fail-over, CIS monitored resource manifests (such as routes, CRDs, and
extendedConfigmaps) must be identical and available in both the Primary and Secondary clusters. If the manifests are missing from the Secondary cluster, CIS on the Secondary cluster will not be able to take control and process them.Configure Default Pools and Pool Members
masterPools define how traffic is distributed to backend services. You can use a
defaultPoolwithin aVirtualServeror define explicitpools.Default Pool Configuration
A
defaultPoollinks a Kubernetes service to the BIG-IP.- Required:
service(the K8s service name) andservicePort(port, port name, or targetPort). - Reference: Set
referencetoserviceto use K8s service discovery, orbigipto reference an existing pool on the BIG-IP. - Load Balancing: Use
loadBalancingMethod(e.g.,round-robin).
Pool Components
When defining a pool, you can specify:
- Service Mapping:
service,servicePort, andserviceNamespace. - Path/Host Rewriting:
path(required) andhostRewriteto modify headers before reaching backends. - Health Monitoring: Use
monitor(for a single existing BIG-IP monitor) ormonitors(for multiple monitors). Note thatmonitorstakes priority if both are provided. - A/B Deployment: Use
alternateBackendsto define a list of secondary services with specificweightvalues. - NodePort Mode: Use
nodeMemberLabelto specify which Nodes to consider as members.
# Example Pool within a VirtualServer - pools: - name: my-pool path: /app service: my-service servicePort: 8080 loadBalancingMethod: least-connections monitors: - type: http name: my-custom-monitor reference: bigip- Required:
Use Ratio Mode for traffic distribution
masterRatio mode allows you to distribute traffic across multiple clusters based on a defined ratio for each cluster. This feature works in an active-active manner and is supported in both CIS High Availability (HA) and standalone environments.
When using Ratio mode, CIS splits traffic according to the
ratiovalues defined for each cluster in theextendedSpec. If a cluster is marked withadminState: disableoradminState: offline, its ratio is effectively ignored. It is recommended to set the ratio to0for any cluster that is disabled or offline.# Example of Ratio mode in a standalone topology extendedSpec: | mode: ratio localClusterRatio: 4 externalClustersConfig: - clusterName: cluster3 secret: default/kubeconfig3 ratio: 3 - clusterName: cluster4 secret: default/kubeconfig4 ratio: 4Configure automatic health monitors with autoMonitor
masterThe
autoMonitorparameter determines how CIS creates health monitors for pools when no custom health monitor annotation is provided in the Route.Supported values:
none(default): CIS will not create a health monitor for the pool.readiness-probe: CIS creates a health monitor based on the pod's configured readiness probe.service-endpoint: CIS creates a default TCP health monitor for the pool.
Timeout Configuration (
autoMonitorTimeout):- If not specified and a readiness probe exists: timeout is
3 * interval + 1. - If not specified, no readiness probe exists, and
autoMonitorisservice-endpoint: default timeout is16seconds. - If not specified, no readiness probe exists, and
autoMonitorisnone: no monitor is created.