camel-k icon indicating copy to clipboard operation
camel-k copied to clipboard

Camel-K doesn't create the Ingress resource although it is enabled in the Traits using Pipe or KameletBinding

Open saion-chatterjee opened this issue 1 year ago • 12 comments

What happened?

The following Pipe creates a Service but the ingress is not created although it is enabled directly in the traits spec.

Nginx is annotated as the default ingressClass in the cluster.

Environment: AWS EKS

apiVersion: camel.apache.org/v1
kind: Pipe
metadata:
  name: webhook-ingress-example
spec:
  integration:
    traits:
      ingress:
        host: example.dev.mydomain.com
        auto: True
        enabled: True
      service:
        enabled: True
        type: ClusterIP
  sink:
    ref:
      apiVersion: camel.apache.org/v1
      kind: Kamelet
      name: kafka-not-secured-sink
    properties:
      bootstrapServers: "kafkacluster.example.svc.cluster.local:9092"
      topic: camel-k-test
  source:
    ref:
      apiVersion: camel.apache.org/v1
      kind: Kamelet
      name: webhook-source

Actual Output:

  • Pod is created and healthy
  • Service is created as clusterIP
  • Endpoint is created
  • Ingress is not created

How can we create an Ingress for the webhook-source? Please advice us.

Steps to reproduce

No response

Relevant log output

No response

Camel K version

2.2.0-nightly

saion-chatterjee avatar Jan 10 '24 01:01 saion-chatterjee

you should set auto to false otherwise camel-k would try to determine if the source is an http endpoint, it does not automatically create an ingress for other protocols

lburgazzoli avatar Jan 10 '24 06:01 lburgazzoli

you should set auto to false otherwise camel-k would try to determine if the source is an http endpoint, it does not automatically create an ingress for other protocols

@lburgazzoli Tried this but still Ingress doesn't show up. But I have an interesting finding: The same Pipe CR is able to create an Ingress when tested inside a local Kind cluster. In AWS EKS, this same configuration is silently failing.

I also checked the IntegrationPlatform and both my local and eks have cluster:kubernetes

saion-chatterjee avatar Jan 10 '24 08:01 saion-chatterjee

can you provide the status of the related Integration resource (kubect get -o yaml integration webhook-ingress-example) ?

lburgazzoli avatar Jan 10 '24 08:01 lburgazzoli

can you provide the status of the related Integration resource (kubect get -o yaml integration webhook-ingress-example) ?

@lburgazzoli Here it is. I can see a message: explicitly disabled by the user reason: masterTraitConfiguration. Could this be the issue? How can I enable it again?

Note: I simplified the example by using a log-sink instead of kafka.

status:
  capabilities:
    - platform-http
  conditions:
    - firstTruthyTime: '2024-01-10T09:13:13Z'
      lastTransitionTime: '2024-01-10T09:13:13Z'
      lastUpdateTime: '2024-01-10T09:13:13Z'
      message: default/camel-k
      reason: IntegrationPlatformAvailable
      status: 'True'
      type: IntegrationPlatformAvailable
    - firstTruthyTime: '2024-01-10T09:13:13Z'
      lastTransitionTime: '2024-01-10T09:13:13Z'
      lastUpdateTime: '2024-01-10T09:13:13Z'
      message: >-
        kamelets [log-sink,webhook-source] found in
        (Kubernetes[namespace=default], Empty[]) repositories
      reason: KameletsAvailable
      status: 'True'
      type: KameletsAvailable
    - firstTruthyTime: '2024-01-10T09:13:13Z'
      lastTransitionTime: '2024-01-10T09:13:13Z'
      lastUpdateTime: '2024-01-10T09:13:13Z'
      message: explicitly disabled by the user
      reason: masterTraitConfiguration
      status: 'True'
      type: TraitInfo
    - firstTruthyTime: '2024-01-10T09:13:13Z'
      lastTransitionTime: '2024-01-10T09:13:13Z'
      lastUpdateTime: '2024-01-10T09:13:13Z'
      message: kit-cmf5bii4ev80p5ds6rg0
      reason: IntegrationKitAvailable
      status: 'True'
      type: IntegrationKitAvailable
    - firstTruthyTime: '2024-01-10T09:13:13Z'
      lastTransitionTime: '2024-01-10T09:13:13Z'
      lastUpdateTime: '2024-01-10T09:13:13Z'
      message: deployment name is webhook-ingress-example
      reason: DeploymentAvailable
      status: 'True'
      type: DeploymentAvailable
    - firstTruthyTime: '2024-01-10T09:13:13Z'
      lastTransitionTime: '2024-01-10T09:13:13Z'
      lastUpdateTime: '2024-01-10T09:13:13Z'
      message: webhook-ingress-example(http/80) -> integration(http/8080)
      reason: ServiceAvailable
      status: 'True'
      type: ServiceAvailable
    - firstTruthyTime: '2024-01-10T09:13:16Z'
      lastTransitionTime: '2024-01-10T09:13:16Z'
      lastUpdateTime: '2024-01-10T09:13:16Z'
      message: 1/1 ready replicas
      reason: DeploymentReady
      status: 'True'
      type: Ready
  dependencies:
    - camel:kamelet
    - camel:log
    - camel:platform-http
    - mvn:org.apache.camel.k:camel-k-runtime
    - mvn:org.apache.camel.quarkus:camel-quarkus-platform-http
    - mvn:org.apache.camel.quarkus:camel-quarkus-yaml-dsl
  digest: vWGa1YDRdmmh4Dk1V1wElxzAyIF87K_S_Pi3ySUqArSg
  generatedSources:
    - content: |
        - route:
            from:
              steps:
              - to: kamelet:log-sink/sink
              uri: kamelet:webhook-source/source
            id: binding
      name: camel-k-embedded-flow.yaml
    - contentKey: content
      contentRef: webhook-ingress-example-kamelet-log-sink-template
      from-kamelet: true
      language: yaml
      name: log-sink.yaml
    - contentKey: content
      contentRef: webhook-ingress-example-kamelet-webhook-source-template
      from-kamelet: true
      language: yaml
      name: webhook-source.yaml
  image: >-
    common-camel-k-registry.eventinghub.dev.railigent.com/default/camel-k-kit-cmf5bii4ev80p5ds6rg0@sha256:611bc03f05c8db8bbe29326c89643462d1269e9cade02780139ecb7772cc1d45
  integrationKit:
    name: kit-cmf5bii4ev80p5ds6rg0
    namespace: default
  lastInitTimestamp: '2024-01-10T09:13:13Z'
  observedGeneration: 1
  phase: Running
  platform: camel-k
  profile: auto
  replicas: 1
  runtimeProvider: quarkus
  runtimeVersion: 3.2.0
  selector: camel.apache.org/integration=webhook-ingress-example
  version: 2.2.0-nightly

saion-chatterjee avatar Jan 10 '24 09:01 saion-chatterjee

for what I can see, the exposure trait has not even been taken into account, can you try to re-create the pipe from scratch ? unfortunately I do not have an AWS account to try

lburgazzoli avatar Jan 10 '24 09:01 lburgazzoli

I can see a message: explicitly disabled by the user reason: masterTraitConfiguration. Could this be the issue? How can I enable it again?

This message is unrelated to the ingress resource.

Have you looked at the camel-k-operator pod logs, if it tries to create the ingress object ?

claudio4j avatar Jan 10 '24 10:01 claudio4j

I can see a message: explicitly disabled by the user reason: masterTraitConfiguration. Could this be the issue? How can I enable it again?

This message is unrelated to the ingress resource.

Have you looked at the camel-k-operator pod logs, if it tries to create the ingress object ?

I looked at the pod logs and I don't see it trying to create an ingress object. Actually even the operator logs in the working local cluster don't say anything about creating the ingress object (although it works locally.)

saion-chatterjee avatar Jan 10 '24 13:01 saion-chatterjee

for what I can see, the exposure trait has not even been taken into account, can you try to re-create the pipe from scratch ? unfortunately I do not have an AWS account to try

thanks I will try to recreate my stack from scratch and get back to you with the findings

saion-chatterjee avatar Jan 10 '24 13:01 saion-chatterjee

@lburgazzoli @claudio4j Thanks for your help. The issue is now fixed. We fixed it by updating the profile: from auto to Kubernetes in the IntegrationPlatform spec. For some reason the profile: auto was not able to detect our underlying EKS platform to be Kubernetes based and hence was not creating the Ingress. Do you think it is a bug or an expected behavior?

saion-chatterjee avatar Jan 12 '24 22:01 saion-chatterjee

@saion-chatterjee it smells like a bug. can you help us to understand the root cause ?

lburgazzoli avatar Jan 15 '24 20:01 lburgazzoli

@saion-chatterjee it smells like a bug. can you help us to understand the root cause ?

Sure. Our setup is loft vcluster based.

So we use as host cluster: AWS EKS vcluster: rancher- k3s v1.28.2+k3s1 (6330a5b4)

We installed camel-k inside the vcluster.

In this setup, as mentioned before the profile: auto option is unable to detect the environment as Kubernetes and setup an Ingress. If you need any other info then please let us know.

saion-chatterjee avatar Jan 17 '24 14:01 saion-chatterjee

@saion-chatterjee ah, you are on vcluster ... could you try to test if it does the same if you use i.e. minikube + vcluster ? in such case we should be able to reproduce it.

lburgazzoli avatar Jan 17 '24 14:01 lburgazzoli

Waiting for some feedback before closing this.

squakez avatar Apr 05 '24 11:04 squakez

Closing as waiting for feedback. Please, reopen if still facing any issue.

squakez avatar Apr 08 '24 09:04 squakez