Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Controller stops posting changes at runtime when some ingress path has the + character #3561

Open
jmolinavizcaino opened this issue Sep 18, 2024 · 4 comments

Comments

@jmolinavizcaino
Copy link

jmolinavizcaino commented Sep 18, 2024

Setup Details

CIS Version : 2.16.1
Build: f5networks/k8s-bigip-ctlr:latest
BIGIP Version: Big IP 15.1.8 Build 0.0.7 Final
AS3 Version: 3.26.1
Agent Mode: AS3
Orchestration: K8S
Orchestration Version: v1.23.8
Pool Mode: Cluster
Additional Setup details:
Calico v3.24.3

Description

When a K8s administrator configure an ingress resource where the path value has a + symbol, the controller stops posting any further runtime changes to the F5 Big-IP LTM showing the next error.

2024/09/18 10:53:54 [ERROR] [AS3] Template is not valid. see errors
2024/09/18 10:53:54 [ERROR] - (root): Must validate one and only one schema (oneOf)

2024/09/18 10:53:54 [ERROR] - declaration.Shared: Must validate "then" as "if" was valid

2024/09/18 10:53:54 [ERROR] - declaration.Shared.rules.1.name: Does not match pattern '^[a-zA-Z0-9_-.:%]+$'

2024/09/18 10:53:54 [ERROR] - declaration.Shared: Must validate all the schemas (allOf)

2024/09/18 10:53:54 [ERROR] - declaration.Shared: Must validate "then" as "if" was valid

2024/09/18 10:53:54 [ERROR] - declaration.Shared.rules.1.name: Does not match pattern '^[a-zA-Z0-9_-.:%]+$'

2024/09/18 10:53:54 [ERROR] - declaration.Shared: Must validate all the schemas (allOf)

2024/09/18 10:53:54 [ERROR] - declaration.Shared: Must validate all the schemas (allOf)

Steps To Reproduce

  1. Create in K8s a ingress resource managed by the F5 controller where the key path value has a + character . Example:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
ingress.kubernetes.io/allow-http: "false"
ingress.kubernetes.io/ssl-redirect: "true"
kubernetes.io/ingress.class: test
virtual-server.f5.com/balance: predictive-member
virtual-server.f5.com/clientssl: '[ { "bigIpProfile": "/Common/clientssl"}]'
virtual-server.f5.com/rewrite-app-root: nginx-prueba.pre.upc.edu=/tmp/
virtual-server.f5.com/whitelist-source-range: 10.0.0.0/24
name: nginx-ingress
namespace: nginx-test
spec:
rules:

  • host: nginx-test.com
    http:
    paths:
    • backend:
      service:
      name: nginx-svc
      port:
      number: 80
      path: /++resource++
      pathType: ImplementationSpecific
  1. When the F5 controller try to make the changes in the F5 device reports the error showed previously,

Expected Result

The + symbol is a charecter valid in URI as is specifed in teh RFC https://datatracker.ietf.org/doc/html/rfc3986#page-12

The expected result is the F5 controller doesn't return the error and it should configure the rule in the policy.

Actual Result

In this situation, the F5 controller cannot make any changes futher changes in the F5 node until the ingress resource with the + symbol is deleted.

@jmolinavizcaino jmolinavizcaino added bug untriaged no JIRA created labels Sep 18, 2024
@jmolinavizcaino jmolinavizcaino changed the title Controller stops posting changes at runtime when some ingress path has the + symbol Controller stops posting changes at runtime when some ingress path has the + character Sep 18, 2024
@trinaths
Copy link
Contributor

@jmolinavizcaino CIS uses AS3 to configure objects in BIG-IP. Try this sample declaration in AS3 and share your findings to automation_toolchain_pm at f5 dot com.

@trinaths trinaths added awaiting response Awaiting response and removed untriaged no JIRA created labels Oct 18, 2024
@jmolinavizcaino
Copy link
Author

jmolinavizcaino commented Oct 18, 2024

@trinaths Sorry, but I don't understand your answer.

This error is reported before the CIS sends the AS3 configuration to the BIG-IP. It seems the controller has a validating process when it build the as3 schema that reports this error message.

I applied the same change with a AS3 definiton with postman and the BIG-IP applied the change without problem

@jmolinavizcaino
Copy link
Author

I tried to make the change with AS3 definition with Postman and I arrive to this conclusion:

If I put the + symbol in the name of the rule, the BIG-IP reports an error
{
"code": 422,
"errors": [
"/f5-dev-ie-dev/Shared/Ingress_A_B_C_D_443/rules/1/name: data "ingress_nginx_prueba_pre_upc_edu_++resource++ingress_nginx_prueba_nginx_ingress_nginx_svc_80" should match pattern "^[a-zA-Z0-9\-.:%]+$""
],
"declarationFullId": "",
"message": "declaration is invalid"
}

If I change the name without + but I maintain the + symbol in the rule condition, the change is applied:

"results": [
    {
        "code": 200,
        "message": "success",
        "lineCount": 30,
        "host": "localhost",
        "tenant": "f5-dev-ie-dev",
        "runTime": 2095
    }
],

I think the problem is how the F5 controller builds the name of the rule. It's necessary to overlook the + symbol when the name rule is builded by the controller.

I send this same comment to [email protected] .

@trinaths
Copy link
Contributor

Created [CONTCNTR-4955] for internal tracking.

@trinaths trinaths added JIRA and removed awaiting response Awaiting response labels Oct 23, 2024
vidyasagar-m added a commit to vidyasagar-m/k8s-bigip-ctlr that referenced this issue Oct 28, 2024
vidyasagar-m added a commit to vidyasagar-m/k8s-bigip-ctlr that referenced this issue Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants