kanaiyathacker1980 commented on issue #6215:
URL: https://github.com/apache/camel-k/issues/6215#issuecomment-3139821567

   Thanks for sharing the detailed Integration YAML and the context. Let me 
help you understand and troubleshoot a few things around your scenario:
   
   1. About your current Integration spec with Camel K and KEDA
   Your current Integration YAML does not include KEDA traits, and from what 
you mention, KEDA traits in Camel K are now deprecated.
   
   Camel K used to support KEDA traits for autoscaling integrations based on 
external event sources.
   
   But recently, the KEDA trait support in Camel K was deprecated (and may be 
removed in future versions).
   
   That means the old way of enabling KEDA via spec.traits.keda.enabled: true 
and related options might no longer work.
   
   If KEDA is enabled externally in the cluster and you add your own 
ScaledObject for your integration pods, KEDA can still scale, but Camel K won't 
manage that trait directly anymore.
   
   2. Why are your pods terminating immediately after KEDA scales them?
   Pods immediately terminating after scaling usually happens if:
   
   The pod fails its readiness or liveness probes.
   
   The pod encounters runtime errors on startup and crashes.
   
   The Integration controller or Camel K runtime detects an issue and deletes 
the pod.
   
   The integration is not stable in its deployment or has misconfigurations.
   
   Given you deleted and recreated the cluster and the problem disappeared 
temporarily, it could mean:
   
   Some leftover stale resource or config caused issues.
   
   Your integration runtime environment (like credentials, configmaps) was 
missing or misconfigured.
   
   The KEDA ScaledObject configuration was incomplete or pointing to the wrong 
resource.
   
   3. Can Camel K Integration work with KEDA?
   Yes, but now you need to manage KEDA outside Camel K by:
   
   Deploying a KEDA ScaledObject resource yourself targeting the 
Deployment/ReplicaSet that Camel K creates for your integration.
   
   Configuring KEDA to watch the correct SQS queue or event source.
   
   Not rely on the deprecated Camel K KEDA trait but manage scaling via KEDA 
CRDs directly.
   
   4. What can you do to fix/improve your setup?
   Remove KEDA trait from your Integration YAML since it is deprecated.
   
   Manually create a KEDA ScaledObject that points to the Deployment your Camel 
K integration creates (sqs-to-knative).
   
   Ensure the ScaledObject is configured with the correct trigger (e.g., AWS 
SQS trigger) and references the right deployment.
   
   Make sure your integration deployment is healthy and pods can stay running 
without crashing.
   
   Check pod logs if pods terminate immediately to see errors.
   
   Double-check your secrets/configmaps are mounted properly.
   
   5. Example of a manual KEDA ScaledObject for SQS
   yaml
   Copy
   Edit
   apiVersion: keda.sh/v1alpha1
   kind: ScaledObject
   metadata:
     name: sqs-scaledobject
     namespace: default
   spec:
     scaleTargetRef:
       name: sqs-to-knative  # Deployment created by your integration
     minReplicaCount: 1
     maxReplicaCount: 10
     triggers:
     - type: aws-sqs-queue
       metadata:
         queueURL: https://sqs.us-east-2.amazonaws.com/your-account/kan-sqs
         queueLength: "5"
         awsRegion: us-east-2
       authenticationRef:
         name: keda-aws-credentials
   ---
   apiVersion: v1
   kind: Secret
   metadata:
     name: keda-aws-credentials
     namespace: default
   type: Opaque
   stringData:
     AWS_ACCESS_KEY_ID: "<your-access-key>"
     AWS_SECRET_ACCESS_KEY: "<your-secret-key>"
   You will need to create that secret and scaledobject manually, and do not 
enable KEDA traits on Camel K integration anymore.
   
   6. How to troubleshoot pod termination?
   Run kubectl logs <pod-name> for terminated pods to see logs.
   
   Check pod events: kubectl describe pod <pod-name>
   
   Ensure the integration itself (Camel routes) works without errors.
   
   Confirm all configmaps and secrets are properly mounted.
   
   Verify no conflicting resources.
   
   Summary
   KEDA trait is deprecated in Camel K. Don't use it inside Integration spec.
   
   Manage KEDA scaling outside Camel K with a ScaledObject resource.
   
   Pods terminating immediately after scaling usually means pod startup failure 
or misconfiguration.
   
   Check pod logs and events to find root cause.
   
   Ensure integration runs fine without KEDA first, then add KEDA manually.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to