### VirtualServer with TLS Profile Example Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/upgradeProcess.md This example demonstrates how to configure a VirtualServer with a TLSProfile for TLS termination, which relies on SNI. ```yaml apiVersion: cis.f5.com/v1 kind: VirtualServer metadata: name: my-virtual-server namespace: default spec: host: myapp.example.com tlsProfile: secretRef: name: my-tls-secret pools: - service: my-service servicePort: 80 ``` -------------------------------- ### Install CIS Controller Deployment Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/config_examples/Install/k8s/README.md Update the CIS deployment file with the required image and configuration parameters, then apply it to install the CIS Controller. ```shell kubectl create -f ./docs/config_examples/Install/k8s/sample-k8s-bigip-ctlr.yaml ``` -------------------------------- ### Unsecure Virtual Server Example Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/upgradeProcess.md This example shows how to create a Virtual Server on BIG-IP with a VIP that will load balance traffic for a specified domain. ```yaml apiVersion: cis.f5.com/v1 kind: VirtualServer metadata: name: unsecure-virtual-server namespace: default spec: host: unsecure.example.com pools: - service: my-unsecure-service servicePort: 8080 ``` -------------------------------- ### Install CIS Controller on OpenShift Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/config_examples/Install/openshift/README.md Update the CIS deployment file with the required image and configuration parameters, then install the CIS Controller. ```shell oc create -f ./docs/config_examples/Install/openshift/f5-k8s-bigip-ctlr-openshift.yaml ``` -------------------------------- ### Install CIS Controller Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/config_examples/Install/cis-webhook/README.md Install the CIS Controller by applying the deployment file. Ensure the image and config parameters are updated as needed. Use `kubectl` for Kubernetes and `oc` for OpenShift. ```shell kubectl create -f ./docs/config_examples/Install/cis-webhook/sample-k8s-bigip-ctlr.yaml ``` ```shell oc create -f ./docs/config_examples/Install/cis-webhook/sample-k8s-bigip-ctlr.yaml ``` -------------------------------- ### Add Helm Repo and Install cert-manager Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/config_examples/Install/cis-webhook/README.md Add the Jetstack Helm repository, update it, and install cert-manager. Ensure Helm is installed on your jumpbox. ```shell helm repo add jetstack https://charts.jetstack.io helm repo update helm install cert-manager jetstack/cert-manager --namespace cert-manager ``` -------------------------------- ### Install Helm Chart (Manual Secrets) Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/config_examples/Install/openshift/README.md Install the CIS Helm chart using a custom values.yaml file. This command assumes that BIG-IP credential secrets have been created manually. ```shell helm install -f values.yaml f5-stable/f5-bigip-ctlr ``` -------------------------------- ### Install Helm Chart (Create Secrets with Helm) Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/config_examples/Install/openshift/README.md Install the CIS Helm chart and have Helm automatically create the BIG-IP credential secret. This requires providing BIG-IP credentials as environment variables or directly in the command. ```shell helm install --set bigip_secret.create="true" --set bigip_secret.username=$BIGIP_USERNAME --set bigip_secret.password=$BIGIP_PASSWORD -f values.yaml f5-stable/f5-bigip-ctlr ``` -------------------------------- ### Install F5 CRDs Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/config_examples/customResourceDefinitions/crd_update.md Installs the F5 CRDs by downloading the definition file from a specified GitHub release version. Ensure the CIS_VERSION environment variable is set correctly. ```sh export CIS_VERSION= # For example # export CIS_VERSION=v2.12.0 # or # export CIS_VERSION=2.x-master # # the latter if using a CIS image with :latest label # kubectl create -f https://raw.githubusercontent.com/F5Networks/k8s-bigip-ctlr/${CIS_VERSION}/docs/config_examples/customResourceDefinitions/customresourcedefinitions.yml ``` -------------------------------- ### Policy CRD with VirtualServer Example Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/RELEASE-NOTES.rst Example showing a Policy CRD associated with a VirtualServer. This demonstrates how policies can be applied to specific virtual servers. ```yaml apiVersion: cis.f5.com/v1 kind: Policy metadata: name: virtualserver-with-policy namespace: cis-test spec: policyName: "virtualserver-with-policy" targets: - virtualServer: http-vs rules: - name: "rule-1" conditions: - "http_host ends_with example.com" actions: - "continue" ``` -------------------------------- ### Install F5 BIG-IP Ingress Helm Chart Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/helm-charts/f5-bigip-ingress/README.md Installs the F5 BIG-IP Ingress chart using a custom values file. Ensure you have added the F5 stable chart repository or are referencing a local chart. ```bash helm repo add f5-stable https://f5networks.github.io/charts/stable helm install -f path/to/custom-values.yaml f5-stable/f5-bigip-ingress ``` ```bash # from fork helm install -f path/to/custom-values.yaml charts/src/stable/f5-bigip-ingress/ ``` -------------------------------- ### Health Monitors in EDNS Example Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/upgradeProcess.md This example configures health monitors for GSLB pools in DNS. Health monitoring is supported for each pool member. ```yaml apiVersion: cis.f5.com/v1 kind: ExternalDNS metadata: name: externaldns-tcp-monitor namespace: kube-system spec: pools: - name: my-gslb-pool monitor: type: tcp interval: 30 timeout: 10 members: - hostname: poolmember1.example.com service: my-service servicePort: 80 - hostname: poolmember2.example.com service: my-service servicePort: 80 ``` -------------------------------- ### Install F5 CIS Controller Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/config_examples/Install/openshift/quick-start-guides/StandAlone/README.md Deploy the F5 CIS Controller by creating its deployment configuration. Ensure the deployment file is updated with the required image and configuration parameters. ```shell oc create -f ./docs/config_examples/Install/openshift/quick-start-guides/StandAlone/f5-k8s-bigip-ctlr-openshift.yaml ``` -------------------------------- ### Sample Route for Old Configuration Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/config_examples/next-gen-routes/migration-guide.md An example of an OpenShift Route resource configured for the older CIS route management. Note the use of annotations for F5-specific configurations. ```yaml apiVersion: route.openshift.io/v1 kind: Route metadata: annotations: virtual-server.f5.com/clientssl: /Common/bar-clientssl virtual-server.f5.com/serverssl: /Common/bar-serverssl virtual-server.f5.com/balance: least-connections-node virtual-server.f5.com/allow-source-range: "1.2.3.4/32,2.2.2.0/24" virtual-server.f5.com/waf: /Common/WAF_Policy virtual-server.f5.com/health: | [ { "path": "pytest-bar-1.com/", "send": "HTTP GET /", "interval": 5, "timeout": 10 } ] labels: f5type: systest name: svc-pytest-bar-1-com namespace: f5demo spec: host: pytest-bar-1.com path: / tls: termination: edge to: kind: Service name: svc-pytest-bar-1-com weight: 100 wildcardPolicy: None ``` -------------------------------- ### Configure HTTP Compression Profile Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/config_examples/customResource/VirtualServer/httpCompressionProfile/README.md Use the `httpProfileCompression` option to specify the path to the HTTP Compression Profile. This example shows how to reference the default compression profile. ```yaml #Example httpProfileCompression: /Common/compressionProfile ``` -------------------------------- ### Install Helm Chart (Older Kubernetes Versions) Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/config_examples/Install/openshift/README.md Install a specific version of the CIS Helm chart (0.0.14) which is recommended for Kubernetes versions lower than 1.18. This command also skips CRDs. ```shell helm install --skip-crds -f values.yaml f5-stable/f5-bigip-ctlr --version 0.0.14 ``` -------------------------------- ### Complete Production TransportServer Example Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/config_examples/customResource/TransportServer/profileInspection/README.md A comprehensive TransportServer configuration for a production environment, including multiple protocol inspection profiles, connection mirroring, and advanced pool settings. ```yaml apiVersion: cis.f5.com/v1 kind: TransportServer metadata: name: production-tcp-service namespace: production spec: virtualServerAddress: "10.192.75.113" virtualServerPort: 1521 type: tcp mode: standard profiles: profileProtocolInspection: "/Common/oracle_protocol_inspection" tcp: client: "/Common/tcp-wan-optimized" server: "/Common/tcp-lan-optimized" connectionMirroring: enabled allowVlans: - "/Common/internal-vlan" - "/Common/dmz-vlan" pool: service: oracle-database servicePort: 1521 serviceNamespace: database monitor: type: tcp interval: 10 timeout: 31 loadBalancingMethod: least-connections-member ``` -------------------------------- ### Golang Vendor Dependency Error Example Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/DEVEL.md An example of a build error that can occur when Go dependencies in the vendor directory and $GOPATH differ. This often happens when the vendor directory is not properly managed. ```go pkg/aspen/controller.go:127: cannot use a.clientset (type *"aspen/vendor/k8s.io/client-go/kubernetes".Clientset) as type "k8s.io/client-go/kubernetes".Interface in argument to informers.NewSharedInformerFactory: *"aspen/vendor/k8s.io/client-go/kubernetes".Clientset does not implement "k8s.io/client-go/kubernetes".Interface (wrong type for Apps method) have Apps() "aspen/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1".AppsV1beta1Interface want Apps() "k8s.io/client-go/kubernetes/typed/apps/v1beta1".AppsV1beta1Interface ``` -------------------------------- ### VirtualServer CRD with Health Monitor 'timeUntilUp' Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/RELEASE-NOTES.rst Example showing the 'timeUntilUp' field in the Monitor CR for a VirtualServer. This allows configuring the time before a monitor is considered 'up'. ```yaml apiVersion: cis.f5.com/v1 kind: VirtualServer metadata: name: virtualserver-health-monitor-timeuntilup namespace: cis-test spec: virtualServerName: "virtualserver-health-monitor-timeuntilup" backend: serviceName: http-svc servicePort: 80 monitor: monitorType: "http" interval: 30 timeout: 10 timeUntilUp: 60 ``` -------------------------------- ### Configure HTML Profile in Virtual Server Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/config_examples/customResource/VirtualServer/htmlProfile/README.md Use the `htmlProfile` option to specify the HTML profile for the virtual server. This example shows the basic syntax. ```yaml #Example htmlProfile: /Common/html ``` -------------------------------- ### Deploy Sample Application Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/config_examples/multicluster/default-mode/IngressLink/README.md Apply the necessary Kubernetes resources to deploy a sample application for testing the IngressLink integration. ```bash kubectl apply -f https://raw.githubusercontent.com/F5Networks/k8s-bigip-ctlr/2.x-master/docs/config_examples/customResource/IngressLink/ingress-example/cafe.yaml kubectl apply -f https://raw.githubusercontent.com/F5Networks/k8s-bigip-ctlr/2.x-master/docs/config_examples/customResource/IngressLink/ingress-example/cafe-secret.yaml kubectl apply -f https://raw.githubusercontent.com/F5Networks/k8s-bigip-ctlr/2.x-master/docs/config_examples/customResource/IngressLink/ingress-example/cafe-ingress.yaml ``` -------------------------------- ### CRD Not Found Log Example Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/config_examples/customResourceDefinitions/crd_update.md An example log message indicating that a CRD, such as TransportServer, was not found. This typically occurs when the CRD is not installed or has been removed. ```shell E0412 10:59:47.965255 1 reflector.go:138] github.com/F5Networks/k8s-bigip-ctlr/pkg/controller/informers.go:75: Failed to watch *v1.TransportServer: failed to list *v1.TransportServer: the server could not find the requested resource (get transportservers.cis.f5.com) ``` -------------------------------- ### Create f5-hello-world Deployment and Service Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/config_examples/configmap/user-defined-configmap/deployments/create-f5-hello-world.md Use this shell script to create the f5-hello-world deployment and service resources in the default namespace. ```bash #!/bin/bash kubectl create -f f5-hello-world-deployment.yaml kubectl create -f f5-hello-world-service.yaml ``` -------------------------------- ### Install Helm Chart (Skip CRDs) Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/config_examples/Install/openshift/README.md Install the CIS Helm chart while skipping the Custom Resource Definitions (CRDs) installation. This is useful if CRDs are managed separately or if you are using older Kubernetes versions. ```shell helm install --skip-crds -f values.yaml f5-stable/f5-bigip-ctlr ``` -------------------------------- ### Deploy Sample Application Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/config_examples/Install/openshift/quick-start-guides/StandAlone/README.md Deploy the sample 'cafe' application to the OpenShift cluster using the provided YAML configuration. ```shell oc create -f docs/config_examples/Install/openshift/quick-start-guides/demo-app/cafe/ ``` -------------------------------- ### Complete Production VirtualServer Example Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/config_examples/customResource/VirtualServer/profileInspection/README.md A comprehensive VirtualServer configuration for a production environment, including multiple profiles for protocol inspection, TCP, HTTP, and WAF, along with detailed pool configurations. ```yaml apiVersion: cis.f5.com/v1 kind: VirtualServer metadata: name: production-web-app namespace: production spec: host: app.production.com virtualServerAddress: "10.192.75.113" virtualServerHTTPPort: 80 virtualServerHTTPSPort: 443 tlsProfileName: "production-tls" httpTraffic: redirect profiles: profileProtocolInspection: "/Common/production_security_profile" tcp: client: "/Common/tcp-mobile-optimized" server: "/Common/tcp-lan-optimized" http: "/Common/http-compression" waf: "/Common/production-asm-policy" pools: - path: "/api/v1" service: api-v1-service servicePort: 8080 waf: "/Common/api-security-policy" - path: "/api/v2" service: api-v2-service servicePort: 8081 - path: "/static" service: static-service servicePort: 80 - path: "/" service: web-service servicePort: 80 ``` -------------------------------- ### Policy CRD with TransportServer Example Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/RELEASE-NOTES.rst Example illustrating a Policy CRD applied to a TransportServer. This shows how policies can manage traffic for transport-level services. ```yaml apiVersion: cis.f5.com/v1 kind: Policy metadata: name: transportserver-with-policy namespace: cis-test spec: policyName: "transportserver-with-policy" targets: - transportServer: tcp-ts rules: - name: "rule-1" conditions: - "tcp_port == 9000" actions: - "continue" ``` -------------------------------- ### Deploy Sample Application Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/config_examples/customResource/IngressLink/README.md Deploy a sample application, including its ingress resource, to test the IngressLink integration. Ensure the service exposing the NGINX Ingress Controller is of type 'nodeport'. ```kubectl kubectl apply -f https://raw.githubusercontent.com/F5Networks/k8s-bigip-ctlr/2.x-master/docs/config_examples/customResource/IngressLink/ingress-example/cafe.yaml ``` ```kubectl kubectl apply -f https://raw.githubusercontent.com/F5Networks/k8s-bigip-ctlr/2.x-master/docs/config_examples/customResource/IngressLink/ingress-example/cafe-secret.yaml ``` ```kubectl kubectl apply -f https://raw.githubusercontent.com/F5Networks/k8s-bigip-ctlr/2.x-master/docs/config_examples/customResource/IngressLink/ingress-example/cafe-ingress.yaml ``` -------------------------------- ### Install CIS CRDs for OpenShift Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/config_examples/Install/cis-webhook/README.md Install Custom Resource Definitions for CIS Controller in OpenShift. Set the CIS_VERSION environment variable to your desired version. ```shell export CIS_VERSION= # For example # export CIS_VERSION=v2.20.0 # or # export CIS_VERSION=2.x-master # the latter if using a CIS image with :latest label oc create -f https://raw.githubusercontent.com/F5Networks/k8s-bigip-ctlr/${CIS_VERSION}/docs/config_examples/customResourceDefinitions/customresourcedefinitions.yml ``` -------------------------------- ### Install CIS CRDs for Kubernetes Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/config_examples/Install/cis-webhook/README.md Install Custom Resource Definitions for CIS Controller in Kubernetes. Set the CIS_VERSION environment variable to your desired version. ```shell export CIS_VERSION= # For example # export CIS_VERSION=v2.20.0 # or # export CIS_VERSION=2.x-master # the latter if using a CIS image with :latest label kubectl create -f https://raw.githubusercontent.com/F5Networks/k8s-bigip-ctlr/${CIS_VERSION}/docs/config_examples/customResourceDefinitions/customresourcedefinitions.yml ``` -------------------------------- ### Deploy vs-with-adaptProfile.yaml Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/config_examples/customResource/VirtualServer/adaptProfile/README.md Deploy this YAML file to your cluster to create a Virtual Server with request and response adapt profiles on BIG-IP via CIS. ```yaml apiVersion: "cis.f5.com/v1" kind: VirtualServer metadata: name: "my-virtual-server" namespace: "default" spec: host: "example.com" service: "my-service" ipFwdMode: "ddos" profileAdapt: request: "/Common/example-requestadapt" response: "/Common/example-responseadapt" ``` -------------------------------- ### Update CIS Deployment Arguments for Next-Gen Routes Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/config_examples/next-gen-routes/migration-guide.md This example shows the updated arguments for the CIS deployment when migrating to Next-Gen Routes. It includes essential parameters like controller mode, extended ConfigMap, and other relevant configurations. ```yaml args: [ "--bigip-username=admin", "--bigip-password=admin", "--bigip-url=10.10.10.20", "--bigip-partition=openshift", "--pool-member-type=cluster", "--openshift-sdn-name=/Common/openshift_vxlan", "--controller-mode=openshift", "--namespace=f5demo", "--namespace=f5demo2", "--log-level=DEBUG", "--log-as3-response=true", "--extended-spec-configmap=f5demo2/extended-spec-config", "--insecure=true", "--route-label=f5type=systest", ] ``` -------------------------------- ### Install CIS Controller Deployments Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/config_examples/Install/openshift/quick-start-guides/HA/README.md Deploy the F5 CIS Controller instances for BIG-IP 01 and BIG-IP 02. Ensure the deployment files are updated with the required image and configuration parameters. ```shell oc create -f docs/config_examples/Install/openshift/quick-start-guides/HA/next-gen-route/cis/f5-bigip-ctlr-01-deployment.yaml oc create -f docs/config_examples/Install/openshift/quick-start-guides/HA/next-gen-route/cis/f5-bigip-ctlr-02-deployment.yaml ``` -------------------------------- ### Example CIS Deployment with Extended Spec ConfigMap Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/config_examples/next-gen-routes/README.md A sample Kubernetes Deployment for the CIS controller, configured to use an extended specification ConfigMap and running in OpenShift mode. ```yaml apiVersion: apps/v1 kind: Deployment metadata: annotations: labels: name: test-bigip-controller name: test-bigip-controller namespace: kube-system spec: selector: matchLabels: app: test-bigip-controller spec: containers: - args: - --bigip-partition - - --bigip-url - - --bigip-username - - --bigip-password - - --as3-validation=true - --disable-teems=true - --insecure - --route-label=systest - --extended-spec-configmap - default/extended-cm - --controller-mode - openshift - --openshift-sdn-name - /test/vxlan-tunnel-mp - --pool-member-type - cluster command: - /app/bin/k8s-bigip-ctlr image: f5networks/k8s-bigip-ctlr:latest imagePullPolicy: Always name: test-bigip-controller serviceAccount: bigip-controller serviceAccountName: bigip-controller ``` -------------------------------- ### Host Rewrite Configuration Example Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/config_examples/customResource/VirtualServer/HostRewrite/README.md Use the `hostRewrite` option within the `pools` configuration to specify the new hostname for requests. This example shows how to rewrite the host to `lab.internal.org` for requests matching the `/lab` path. ```yaml --- pools: - path: /lab service: svc-1 servicePort: 80 hostRewrite: lab.internal.org ``` -------------------------------- ### Run F5 CIS Controller Locally with Docker Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/README.md Use this command to run the F5 CIS controller locally for development testing. Replace '' with the necessary command-line arguments. ```shell docker run f5networks/k8s-bigip-ctlr /app/bin/k8s-bigip-ctlr ``` -------------------------------- ### Install Nginx Ingress Controller Helm Chart Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/config_examples/multicluster/default-mode/IngressLink/README.md Install the Nginx Ingress Controller using Helm, specifying the release name, chart location, and namespace. Refer to values.yaml for detailed CIS integration configuration. ```sh helm install --namespace nginx-ingress --create-namespace ``` -------------------------------- ### Deploy Virtual Server with HTML Profile Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/config_examples/customResource/VirtualServer/htmlProfile/README.md Deploy this YAML file to create a Virtual Server with an HTML Profile on BIG-IP via CIS. ```yaml apiVersion: cis.f5.com/v1 kind: VirtualServer metadata: name: vs-with-htmlProfile namespace: default spec: virtualServerName: "vs-with-htmlProfile" frontend: port: 80 backend: serviceName: "http-svc" servicePort: 80 htmlProfile: htmlProfile: "/Common/html" ``` -------------------------------- ### Policy CRD Example for HTTP/2 Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/upgradeProcess.md This example demonstrates the necessary modifications to a Policy CRD to leverage server-side HTTP/2 profiles in CIS version 2.13.0 and later. Ensure your Policy CRD is updated if you intend to use HTTP/2 functionality. ```yaml apiVersion: cis.f5.com/v1 kind: Policy metadata: name: http2-policy namespace: default spec: virtualServerName: http2-vs rules: - name: http2-rule actions: - http2profile: my-http2-profile ``` -------------------------------- ### Deploy Virtual Server with Persistence Profile Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/config_examples/customResource/VirtualServer/persistenceProfile/README.md Deploy this YAML file to create a Virtual Server with a Persistence Profile on BIG-IP via CIS. ```yaml #Example persistenceProfile: "source-address" ``` -------------------------------- ### Get Tenant AS3 Declaration Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/config_examples/as3-api-reference.md Retrieve the AS3 declaration for a specific tenant. ```APIDOC ## GET /mgmt/shared/appsvcs/declare/ ### Description Retrieves the AS3 declaration for a specified tenant. ### Method GET ### Endpoint https:///mgmt/shared/appsvcs/declare/ ### Request Example ```bash curl -ku username:password https:///mgmt/shared/appsvcs/declare/ ``` ``` -------------------------------- ### Deploy Virtual Server with Bot Defense Profile Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/config_examples/customResource/VirtualServer/BotDefense/README.md Deploy this YAML file to create a Virtual Server with a Bot Defense Profile on BIG-IP. ```yaml apiVersion: cis.f5.com/v1 kind: VirtualServer metadata: name: my-virtual-server namespace: default spec: virtualServerName: my-virtual-server frontend: port: 80 backend: serviceName: my-service servicePort: 8080 botDefense: /Common/bot-defense ``` -------------------------------- ### AS3 GTM Mode Declaration Error Example Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/upgradeProcess.md An example of an error message encountered when CIS attempts to post a declaration to BIG-IP in AS3 GTM Mode, specifically a 422 error indicating a declaration failure. This often occurs if GTM objects are not manually removed from the 'Common' partition prior to the upgrade. ```bash 2023/04/04 10:20:07 [DEBUG] [AS3] posting request to https://10.x.x.x/mgmt/shared/appsvcs/declare/test,test_gtm 2023/04/04 10:20:36 [ERROR] [AS3] Error response from BIG-IP: code: 422 --- tenant:test_gtm --- message: declaration failed ``` -------------------------------- ### Create Kubernetes Service for CIS Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/config_examples/Install/cis-webhook/README.md Create a Kubernetes Service for the CIS controller. Use `kubectl` for Kubernetes and `oc` for OpenShift. ```shell kubectl create -f ./docs/config_examples/Install/cis-webhook/cis-service.yaml ``` ```shell oc create -f ./docs/config_examples/Install/cis-webhook/cis-service.yaml ``` -------------------------------- ### Get CIS Events Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/troubleshooting.md Check for events in the CIS deployed kube-system namespace for any ContainerCreation issues. ```bash kubectl get events -n kube-system ``` -------------------------------- ### Get AS3 Version Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/config_examples/as3-api-reference.md Retrieve the current version of the AS3 API deployed on the BIG-IP system. ```APIDOC ## GET /mgmt/shared/appsvcs/info ### Description Retrieves the AS3 version information. ### Method GET ### Endpoint https://:8443/mgmt/shared/appsvcs/info ### Request Example ```bash curl -k https://localhost:8443/mgmt/shared/appsvcs/info ``` ``` -------------------------------- ### Get Tenant AS3 Declaration Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/config_examples/as3-api-reference.md Retrieve the AS3 declaration for a specific tenant. Authentication is required. ```bash curl -ku username:password https:///mgmt/shared/appsvcs/declare/ ``` -------------------------------- ### Install Nginx Ingress Controller CRDs Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/config_examples/multicluster/default-mode/IngressLink/README.md Apply the Custom Resource Definitions for the Nginx Ingress Controller using kubectl. ```sh kubectl apply -f https://raw.githubusercontent.com/nginx/kubernetes-ingress/v4.0.1/deploy/crds.yaml ``` -------------------------------- ### Deploy Virtual Server with WAF Policy Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/config_examples/customResource/VirtualServer/pool-waf/README.md Deploy this YAML file to create a Virtual Server on BIG-IP that includes an LTM Policy with WAF enabled. Ensure the WAF policy path is correctly specified. ```yaml apiVersion: "appprotect.f5.com/v1beta1" kind: "VirtualServer" metadata: name: "my-virtual-server" namespace: "default" spec: virtualServerName: "my-vs" backendServices: - name: "my-service" port: 80 serviceIPs: - "192.168.1.100" waf: "/Common/WAF_Policy1" ``` -------------------------------- ### Get AS3 Version Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/config_examples/as3-api-reference.md Use this endpoint to retrieve the current AS3 version information. Requires management IP access. ```bash curl -k https://localhost:8443/mgmt/shared/appsvcs/info ``` -------------------------------- ### Configure Alternate Backends Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/config_examples/customResource/VirtualServerWithTLSProfile/virtual-with-alternatebackends/README.md Use the `alternateBackends` option to specify alternative service pools for a virtual server. Traffic distribution can be controlled using weights. ```yaml alternateBackends: - service: svc-2 weight: 30 serviceNamespace: default ``` -------------------------------- ### IngressLink CRD with serviceAddress Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/RELEASE-NOTES.rst Example demonstrating the 'serviceAddress' field in the IngressLink CRD. This allows specifying a particular IP address for the IngressLink. ```yaml apiVersion: cis.f5.com/v1 kind: IngressLink metadata: name: ingresslink-with-serviceAddress namespace: cis-test spec: ingressLinkName: "ingresslink-with-serviceAddress" serviceAddress: "192.168.1.100" ``` -------------------------------- ### IngressLink CRD with bigipRouteDomain Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/RELEASE-NOTES.rst Example of configuring 'bigipRouteDomain' in an IngressLink CRD for static routing. This specifies the route domain for the IngressLink resource. ```yaml apiVersion: cis.f5.com/v1 kind: IngressLink metadata: name: ingresslink-with-bigipRouteDomain namespace: cis-test spec: ingressLinkName: "ingresslink-with-bigipRouteDomain" bigipRouteDomain: 30 ``` -------------------------------- ### Install CIS Controller Custom Resource Definitions Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/config_examples/Install/openshift/quick-start-guides/StandAlone/README.md Set the CIS_VERSION environment variable to the desired version or 'master' and then create the Custom Resource Definitions (CRDs) for the F5 CIS Controller. ```shell export CIS_VERSION= # For example # export CIS_VERSION=v2.20.0 # or # export CIS_VERSION=master # the latter if using a CIS image with :latest label oc create -f https://raw.githubusercontent.com/F5Networks/k8s-bigip-ctlr/${CIS_VERSION}/docs/config_examples/customResourceDefinitions/customresourcedefinitions.yml ``` -------------------------------- ### VirtualServer Profile Override Policy Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/config_examples/customResource/VirtualServer/profileInspection/README.md This example shows a Policy and a VirtualServer. The VirtualServer's `profileProtocolInspection` overrides the one defined in the Policy. ```yaml apiVersion: cis.f5.com/v1 kind: Policy metadata: name: base-security-policy namespace: default spec: profiles: profileProtocolInspection: "/Common/default_security_profile" --- apiVersion: cis.f5.com/v1 kind: VirtualServer metadata: name: custom-security-app namespace: default spec: host: custom.example.com virtualServerAddress: "10.192.75.112" policyName: base-security-policy profiles: profileProtocolInspection: "/Common/custom_security_profile" # Overrides policy pools: - path: "/" service: web-service servicePort: 80 ``` -------------------------------- ### Configure Persistence Profile in Virtual Server Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/config_examples/customResource/VirtualServer/persistenceProfile/README.md Use the `persistenceProfile` option to specify the desired persistence method for the virtual server. This example uses source IP persistence. ```yaml persistenceProfile: "source-address" ``` -------------------------------- ### Customizing CRD Label Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/config_examples/customResource/CustomResource.md Example of setting a custom label for CIS to watch custom resources. This overrides the default 'f5cr=true' behavior. ```bash --custom-resource-label=backend-cr=true ``` -------------------------------- ### Basic VirtualServer with Protocol Inspection Source: https://github.com/f5networks/k8s-bigip-ctlr/blob/master/docs/config_examples/customResource/VirtualServer/profileInspection/README.md Configure a basic VirtualServer to use a specific protocol inspection profile. Ensure the profile path is correctly specified. ```yaml apiVersion: cis.f5.com/v1 kind: VirtualServer metadata: name: my-virtualserver namespace: default spec: host: example.com virtualServerAddress: "10.192.75.108" profiles: profileProtocolInspection: "/Common/protocol_inspection_profile" pools: - path: / service: web-service servicePort: 80 ```