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

Set proper status on GRPCRoute, TCPRoute, TLSRoute and UDPRoute #6749

Open
2 of 4 tasks
programmer04 opened this issue Dec 2, 2024 · 0 comments
Open
2 of 4 tasks
Labels
area/debt area/gateway-api Relating to upstream Kubernetes SIG Networking Gateway API area/maintenance Cleanup, refactoring, and other maintenance improvements that don't change functionality.

Comments

@programmer04
Copy link
Member

Is there an existing issue for this?

  • I have searched the existing issues

Does this enhancement require public documentation?

  • I have added an Acceptance Criteria item for adding and/or adjusting public documentation (if applicable)

Problem Statement

For each of these routes, apply configuration that misses a target Service.

GRPCRoute

  status:
    parents:
    - conditions:
      - lastTransitionTime: "2024-12-02T10:13:37Z"
        message: ""
        observedGeneration: 1
        reason: Accepted
        status: "True"
        type: Accepted
      - lastTransitionTime: "2024-12-02T10:13:37Z"
        message: ""
        observedGeneration: 1
        reason: Unknown
        status: Unknown
        type: Programmed
      controllerName: konghq.com/kic-gateway-controller
      parentRef:
        group: gateway.networking.k8s.io
        kind: Gateway
        name: example-udproute
        namespace: default

Expected message with proper level is logged

[ingress-controller] 2024-12-02T09:53:20Z        debug   Object requested backendRef to target, but it does not exist, skipping...       {"object_name": "gateway.networking.k8s.io/v1, Kind=GRPCRoute default/grpcbin-via-http", "target_kind": "Service", "target_namespace": "default", "target_name": "grpcbin-via-http", "v": 1}

but wrong status is set for this route

...
status:
  parents:
  - conditions:
    - lastTransitionTime: "2024-12-02T09:48:49Z"
      message: ""
      observedGeneration: 1
      reason: Accepted
      status: "True"
      type: Accepted
    - lastTransitionTime: "2024-12-02T09:48:50Z"
      message: ""
      observedGeneration: 1
      reason: ConfiguredInGateway
      status: "True"
      type: Programmed
    controllerName: konghq.com/kic-gateway-controller
    parentRef:
      group: gateway.networking.k8s.io
      kind: Gateway
      name: kong
      namespace: default
...

TCPRoute

apiVersion: gateway.networking.k8s.io/v1
kind: GatewayClass
metadata:
  name: example-tcproute
  annotations:
    konghq.com/gatewayclass-unmanaged: "true"
spec:
  controllerName: konghq.com/kic-gateway-controller
---
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
  name: example-tcproute
spec:
  gatewayClassName: example-tcproute
  listeners:
    - name: http
      protocol: HTTP
      port: 80
    - name: tcp
      protocol: TCP
      port: 8888
---
apiVersion: gateway.networking.k8s.io/v1alpha2
kind: TCPRoute
metadata:
  name: tcpecho
spec:
  parentRefs:
    - name: example-tcproute
  rules:
    - backendRefs:
        - name: tcpecho
          port: 8888

Nothing is logged and status is unkown

...
status:
  parents:
  - conditions:
    - lastTransitionTime: "2024-12-02T09:54:57Z"
      message: ""
      observedGeneration: 1
      reason: Accepted
      status: "True"
      type: Accepted
    - lastTransitionTime: "2024-12-02T09:54:57Z"
      message: ""
      observedGeneration: 1
      reason: Unknown
      status: Unknown
      type: Programmed
    controllerName: konghq.com/kic-gateway-controller
    parentRef:
      group: gateway.networking.k8s.io
      kind: Gateway
      name: example-tcproute
      namespace: default

TLSRoute

apiVersion: v1
kind: Secret
metadata:
  name: tlsroute-example
data:
  tls.crt: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUVGekNDQXYrZ0F3SUJBZ0lVZTFvWnRWQVBOM1V2bXRkSHo5OFpYcDd2a3Znd0RRWUpLb1pJaHZjTkFRRUwKQlFBd2dZZ3hDekFKQmdOVkJBWVRBbFZUTVJNd0VRWURWUVFJREFwRFlXeHBabTl5Ym1saE1SWXdGQVlEVlFRSApEQTFUWVc0Z1JuSmhibU5wYzJOdk1SSXdFQVlEVlFRS0RBbExiMjVuSUVsdVl5NHhHREFXQmdOVkJBc01EMVJsCllXMGdTM1ZpWlhKdVpYUmxjekVlTUJ3R0ExVUVBd3dWZEd4emNtOTFkR1V1YTI5dVp5NWxlR0Z0Y0d4bE1DQVgKRFRJME1EY3dOVEUwTlRjek5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NXL1ZCendGS1dVU1RZYUdwTGFCK0VUZjArd2JCclVrCkEyVUVjUlpkTTdpNzZnRjN4clBMNFNLTVhGKzhralI5RnJ2T1F5MmlvY20wallEVjZRTSszZjdzM3BRL2dHSDIKaXJnMHUrYUtidDRHRlU5d0FRQ0gxa1I4WmlVRUNaV0R5MTMxTlF0WFJISUtMTnFzQ1FsMkYxUHhBb0dBZWlwNAp1SVZHWE1RZ3drS3RRaCtudDFoT0hiS1g4dGRUN2xwY1UwU0dZM1l1ZFRiREt1TFMwUFEyd2VEM2tUbncxNzRHCmQ3cXVjNDNiaVhMT1dYRE9YaStzcHBQTXNlSzA2d1F2OW9nRTV3TzMwdXdLVUVORmEwYS9scVVieTc2S1hoVEkKMnNDQ1ByTVgrUVNyRzhWS2k1MnJoYWFod1ZJSjlpcnAzWDJVODJFQ2dZQnRCQjdzejc1SU1wbThqelduQmh3SAo5YVlRQTVqczd0NXRpT3I4OXNaR0xmUDg5dDdrR0RPajA1S1B0OCtrS1lEdXdFVUxZOGpzNnpUcmdvdStBQlEyCmNlSjFoVmZxWC8yTWYvb3F1eUEzS2dMemRLS0M2clFCY1hTVUR2SVR2SlFuWHV3eGsyQS9nZ09jNTZoRW1sNm4KdXdqN1JPQkRiUzNaVUwyZXFYb2s3QT09Ci0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0K
type: kubernetes.io/tls
---
apiVersion: gateway.networking.k8s.io/v1
kind: GatewayClass
metadata:
  name: kong
  annotations:
    konghq.com/gatewayclass-unmanaged: "true"
spec:
  controllerName: konghq.com/kic-gateway-controller
---
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
  name: kong
spec:
  gatewayClassName: kong
  listeners:
    - name: http
      protocol: HTTP
      port: 80
    - name: tls
      protocol: TLS
      port: 8899
      hostname: tlsroute.kong.example
      tls:
        mode: Passthrough
        certificateRefs:
          - name: tlsroute-example
---
apiVersion: gateway.networking.k8s.io/v1alpha2
kind: TLSRoute
metadata:
  name: tlsecho
spec:
  parentRefs:
    - name: kong
  hostnames:
    - tlsroute.kong.example
  rules:
    - backendRefs:
        - name: tlsecho
          port: 8899

The below is constantly logged

[ingress-controller] 2024-12-02T10:31:30Z        debug   controllers.TLSRoute    Listener is not ready   {"GatewayV1Alpha2TLSRoute": {"name":"tlsecho","namespace":"default"}, "parentRef.gateway": "default/kong", "listener": "tls", "v": 1, "reason": "listener not programmed yet"}
[ingress-controller] 2024-12-02T10:31:30Z        debug   controllers.TLSRoute    Checking if the tlsroute's gateways are ready   {"GatewayV1Alpha2TLSRoute": {"name":"tlsecho","namespace":"default"}, "v": 1, "namespace": "default", "name": "tlsecho"}
[ingress-controller] 2024-12-02T10:31:30Z        debug   controllers.TLSRoute    Ensuring status contains Gateway associations   {"GatewayV1Alpha2TLSRoute": {"name":"tlsecho","namespace":"default"}, "v": 1, "namespace": "default", "name": "tlsecho"}
[ingress-controller] 2024-12-02T10:31:30Z        debug   controllers.TLSRoute    TLSRoute not configured, requeueing     {"GatewayV1Alpha2TLSRoute": {"name":"tlsecho","namespace":"default"}, "v": 1, "namespace": "default", "name": "tlsecho"}
[ingress-controller] 2024-12-02T10:31:31Z        debug   controllers.TLSRoute    Processing tlsroute     {"GatewayV1Alpha2TLSRoute": {"name":"tlsecho","namespace":"default"}, "v": 1, "namespace": "default", "name": "tlsecho"}
[ingress-controller] 2024-12-02T10:31:31Z        debug   controllers.TLSRoute    Checking deletion timestamp     {"GatewayV1Alpha2TLSRoute": {"name":"tlsecho","namespace":"default"}, "v": 1, "namespace": "default", "name": "tlsecho"}
[ingress-controller] 2024-12-02T10:31:31Z        debug   controllers.TLSRoute    Retrieving GatewayClass and Gateway for route   {"GatewayV1Alpha2TLSRoute": {"name":"tlsecho","namespace":"default"}, "v": 1, "namespace": "default", "name": "tlsecho"}
[ingress-controller] 2024-12-02T10:31:31Z        debug   controllers.TLSRoute    Listener does not support this route    {"GatewayV1Alpha2TLSRoute": {"name":"tlsecho","namespace":"default"}, "parentRef.gateway": "default/kong", "listener": "http", "v": 1, "reason": "unsupported route kind"}
[ingress-controller] 2024-12-02T10:31:31Z        debug   controllers.TLSRoute    Listener is not ready   {"GatewayV1Alpha2TLSRoute": {"name":"tlsecho","namespace":"default"}, "parentRef.gateway": "default/kong", "listener": "tls", "v": 1, "reason": "listener not programmed yet"}

status is unknown

...
status:
  parents:
  - conditions:
    - lastTransitionTime: "2024-12-02T10:31:30Z"
      message: ""
      observedGeneration: 1
      reason: Accepted
      status: "True"
      type: Accepted
    - lastTransitionTime: "2024-12-02T10:31:30Z"
      message: ""
      observedGeneration: 1
      reason: Unknown
      status: Unknown
      type: Programmed
    controllerName: konghq.com/kic-gateway-controller
    parentRef:
      group: gateway.networking.k8s.io
      kind: Gateway
      name: kong
      namespace: default

UDPRoute

apiVersion: gateway.networking.k8s.io/v1
kind: GatewayClass
metadata:
  name: example-udproute
  annotations:
    konghq.com/gatewayclass-unmanaged: "true"
spec:
  controllerName: konghq.com/kic-gateway-controller
---
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
  name: example-udproute
spec:
  gatewayClassName: example-udproute
  listeners:
    - name: http
      protocol: HTTP
      port: 80
    - name: udp
      protocol: UDP
      port: 9999
---
apiVersion: gateway.networking.k8s.io/v1alpha2
kind: UDPRoute
metadata:
  name: udpecho
spec:
  parentRefs:
    - name: example-udproute
  rules:
    - backendRefs:
        - name: udpecho
          port: 9999
---
  status:
    parents:
    - conditions:
      - lastTransitionTime: "2024-12-02T10:13:37Z"
        message: ""
        observedGeneration: 1
        reason: Accepted
        status: "True"
        type: Accepted
      - lastTransitionTime: "2024-12-02T10:13:37Z"
        message: ""
        observedGeneration: 1
        reason: Unknown
        status: Unknown
        type: Programmed
      controllerName: konghq.com/kic-gateway-controller
      parentRef:
        group: gateway.networking.k8s.io
        kind: Gateway
        name: example-udproute
        namespace: default

logs constantly

[ingress-controller] 2024-12-02T10:36:20Z        debug   controllers.UDPRoute    Processing udproute     {"GatewayV1Alpha2UDPRoute": {"name":"udpecho","namespace":"default"}, "v": 1, "namespace": "default", "name": "udpecho"}
[ingress-controller] 2024-12-02T10:36:20Z        debug   controllers.UDPRoute    Checking deletion timestamp     {"GatewayV1Alpha2UDPRoute": {"name":"udpecho","namespace":"default"}, "v": 1, "namespace": "default", "name": "udpecho"}
[ingress-controller] 2024-12-02T10:36:20Z        debug   controllers.UDPRoute    Retrieving GatewayClass and Gateway for route   {"GatewayV1Alpha2UDPRoute": {"name":"udpecho","namespace":"default"}, "v": 1, "namespace": "default", "name": "udpecho"}
[ingress-controller] 2024-12-02T10:36:20Z        debug   controllers.UDPRoute    Listener does not support this route    {"GatewayV1Alpha2UDPRoute": {"name":"udpecho","namespace":"default"}, "parentRef.gateway": "default/example-udproute", "listener": "http", "v": 1, "reason": "unsupported route kind"}
[ingress-controller] 2024-12-02T10:36:20Z        debug   controllers.UDPRoute    Listener is not ready   {"GatewayV1Alpha2UDPRoute": {"name":"udpecho","namespace":"default"}, "parentRef.gateway": "default/example-udproute", "listener": "udp", "v": 1, "reason": "listener not programmed yet"}
[ingress-controller] 2024-12-02T10:36:20Z        debug   controllers.UDPRoute    Checking if the udproute's gateways are ready   {"GatewayV1Alpha2UDPRoute": {"name":"udpecho","namespace":"default"}, "v": 1, "namespace": "default", "name": "udpecho"}
[ingress-controller] 2024-12-02T10:36:20Z        debug   controllers.UDPRoute    Ensuring status contains Gateway associations   {"GatewayV1Alpha2UDPRoute": {"name":"udpecho","namespace":"default"}, "v": 1, "namespace": "default", "name": "udpecho"}
[ingress-controller] 2024-12-02T10:36:20Z        debug   controllers.UDPRoute    UDPRoute not configured, requeueing     {"GatewayV1Alpha2UDPRoute": {"name":"udpecho","namespace":"default"}, "v": 1, "namespace": "default", "name": "udpecho"}
[ingress-controller] 2024-12-02T10:36:23Z        debug   controllers.KongLicense No KongLicense available        {"v": 1}

and status is

status:
  parents:
  - conditions:
    - lastTransitionTime: "2024-12-02T10:35:39Z"
      message: ""
      observedGeneration: 1
      reason: Accepted
      status: "True"
      type: Accepted
    - lastTransitionTime: "2024-12-02T10:35:39Z"
      message: ""
      observedGeneration: 1
      reason: Unknown
      status: Unknown
      type: Programmed
    controllerName: konghq.com/kic-gateway-controller
    parentRef:
      group: gateway.networking.k8s.io
      kind: Gateway
      name: example-udproute
      namespace: default

Proposed Solution

It works the same way as for HTTPRoute, see #6746

Additional information

No response

Acceptance Criteria

  • proper staus for object is reported
  • informative debug level logs
@programmer04 programmer04 added area/debt area/gateway-api Relating to upstream Kubernetes SIG Networking Gateway API area/maintenance Cleanup, refactoring, and other maintenance improvements that don't change functionality. labels Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/debt area/gateway-api Relating to upstream Kubernetes SIG Networking Gateway API area/maintenance Cleanup, refactoring, and other maintenance improvements that don't change functionality.
Projects
None yet
Development

No branches or pull requests

1 participant