F5Networks / k8s-bigip-ctlr

Repository for F5 Container Ingress Services for Kubernetes & OpenShift.
Apache License 2.0
353 stars 193 forks source link

Optional health check paramaters don't appear to be optional #1440

Closed StevenBarre closed 3 years ago

StevenBarre commented 4 years ago

Setup Details

CIS Version : 2.1.0 Build: f5networks/k8s-bigip-ctlr:2.1.0 BIGIP Version: BIG-IP 14.1.2.6 Build 0.0.2 Point Release 6 AS3 Version: f5-appsvcs-3.20.0-3.noarch Agent Mode: AS3 Orchestration: OSCP Orchestration Version: v4.4 Pool Mode: Cluster

Description

https://github.com/F5Networks/k8s-bigip-ctlr/blob/master/docs/_static/config_examples/crd/CustomResource.md#virtualserver-1 lists only type and interval as required for a health check. But if I specify only those two parameters, the health check is not added to the pool members.

Steps To Reproduce

1) Create a VS with only the required health params

apiVersion: "cis.f5.com/v1"
kind: VirtualServer
metadata:
  name: my-new-virtual-server
  namespace: steve-test
  labels:
    f5cr: "true"
spec:
  host: cafe.example.com
  virtualServerAddress: "1.2.3.4"
  pools:
  - path: /
    service: django-psql-example
    servicePort: 8080
    monitor:
      type: http
      interval: 5

2) Check the pool members in the web console

image

3) Update the VS to have all health check params

apiVersion: "cis.f5.com/v1"
kind: VirtualServer
metadata:
  name: my-new-virtual-server
  namespace: steve-test
  labels:
    f5cr: "true"
spec:
  host: cafe.example.com
  virtualServerAddress: "142.34.151.117"
  pools:
  - path: /
    service: django-psql-example
    servicePort: 8080
    monitor:
      type: http
      interval: 5
      timeout: 10
      recv: ""
      send: /

4) Check the pool members in the web console

image

Expected Result

Health monitor added with default values when using only required parameters.

Actual Result

No health check added unless all parameters specified.

Diagnostic Information

CIS log with only required params

2020/08/04 17:33:25 [INFO] Enqueueing VirtualServer: &{{ } {my-new-virtual-server  steve-test /apis/cis.f5.com/v1/namespaces/steve-test/virtualservers/my-new-virtual-server bdabcd7a-685d-40de-a508-292b1cb3e0a5 14803477 1 2020-08-04 17:33:25 +0000 UTC <nil> <nil> map[f5cr:true] map[] [] []  []} {cafe.example.com 1.2.3.4 [{/ django-psql-example 8080  {http   5 0}}]  }}

CIS log with all health check params

2020/08/04 18:02:46 [INFO] Enqueueing VirtualServer: &{{ } {my-new-virtual-server  steve-test /apis/cis.f5.com/v1/namespaces/steve-test/virtualservers/my-new-virtual-server bdabcd7a-685d-40de-a508-292b1cb3e0a5 14828089 2 2020-08-04 17:33:25 +0000 UTC <nil> <nil> map[f5cr:true] map[] [] []  []} {cafe.example.com 1.2.3.4 [{/ django-psql-example 8080  {http /  5 10}}]  }}

Observations (if any)

Not sure if this is a bug in the code, or just the documentation needs to be updated to list all params as required.

cisbotctlr commented 4 years ago

cisbot will assign the issue to one of the devs. @devs, use /jira for internal tracking.

mdditt2000 commented 4 years ago

@sbarre-esit thank Steven for your feedback. You are correct we should set some defaults. Filing a backlog request request to get this added to the queue. Please dont hesitate to open many more as 2.1.1 and 2.1.2 are focused on getting CRDs ready for GA.

mdditt2000 commented 4 years ago

/jira - CONTCNTR-2054 for next sprint planning.

mdditt2000 commented 3 years ago

https://github.com/F5Networks/k8s-bigip-ctlr/pull/1454

mdditt2000 commented 3 years ago

Issue resolved and committed. CIS 2.1.1 posting next week.