F5 BIG-IP Container Ingress Services (CIS)

repository·master·Indexed 18 days ago

https://github.com/f5networks/k8s-bigip-ctlr

F5 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.

Tokens
93K
Snippets
246
Records
361
Agent score
63%

What's inside k8s-bigip-ctlr

  1. Overview of F5 BIG-IP Container Ingress Services (CIS)

    master
    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.
  2. Multicluster CIS User Guides

    master

    F5 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.
  3. Access F5 Container Ingress Services (CIS) User Guides

    master

    The 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.
  4. Overview of NextGenController and RouteGroups

    master

    The 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 namespace or a namespaceLabel.

    • Mutual Exclusivity: You must use either namespace or namespaceLabel for all RouteGroups in a single extendedConfigMap; you cannot mix them.
    • Shared Resources: All routes within a single RouteGroup share the same vserverAddr (VIP address), vserverName, bigIpPartition, and policyCR defined in the extendedRouteSpec.

    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
  5. Overview of Multi-Cluster Support in CIS

    master

    Multi-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 nodePort mode. 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), or TS (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 ExtendedConfigMap must 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.
  6. Precedence Rules for WAF, Source Range, and SSL Profiles

    master

    When 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)

    1. Policy CR: Highest precedence (configures WAF at the VirtualServer/VIP level).
    2. Route Annotation: Second precedence (configures WAF at the LTM Policy level).
      • Exception: If allowOverride: true is set in the RouteGroup's extendedConfigMap, the Route Annotation takes precedence over the Policy CR.

    Allow Source Range

    1. Policy CR: Highest precedence.
    2. Route Annotation: Second precedence.
      • Exception: If allowOverride: true is set in the RouteGroup's extendedConfigMap, the Route Annotation takes precedence over the Policy CR.

    SSL Profiles

    1. Route Annotation (BIG-IP reference/secret): Highest precedence.
    2. Route Certificate (spec.certs): Second precedence.
    3. Extended ConfigMap (defaultTLS): Lowest precedence.
  7. Override Policy Profiles with TransportServer Profiles

    master

    When a TransportServer is associated with a Policy via spec.policyName, the profiles defined directly in the TransportServer spec take precedence over those defined in the Policy spec. 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: 8443
  8. Understand Active-Active and Ratio modes in Multi-Cluster CIS

    master

    CIS supports two primary modes for multi-cluster traffic distribution:

    1. 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.

    2. 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.

  9. Configure Default Pools and Pool Members

    master

    Pools define how traffic is distributed to backend services. You can use a defaultPool within a VirtualServer or define explicit pools.

    Default Pool Configuration

    A defaultPool links a Kubernetes service to the BIG-IP.

    • Required: service (the K8s service name) and servicePort (port, port name, or targetPort).
    • Reference: Set reference to service to use K8s service discovery, or bigip to 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, and serviceNamespace.
    • Path/Host Rewriting: path (required) and hostRewrite to modify headers before reaching backends.
    • Health Monitoring: Use monitor (for a single existing BIG-IP monitor) or monitors (for multiple monitors). Note that monitors takes priority if both are provided.
    • A/B Deployment: Use alternateBackends to define a list of secondary services with specific weight values.
    • NodePort Mode: Use nodeMemberLabel to 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
  10. Use Ratio Mode for traffic distribution

    master

    Ratio 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 ratio values defined for each cluster in the extendedSpec. If a cluster is marked with adminState: disable or adminState: offline, its ratio is effectively ignored. It is recommended to set the ratio to 0 for 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: 4
  11. Configure automatic health monitors with autoMonitor

    master

    The autoMonitor parameter 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 autoMonitor is service-endpoint: default timeout is 16 seconds.
    • If not specified, no readiness probe exists, and autoMonitor is none: no monitor is created.