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

Scaling integrations removes Kamelet ConfigMaps #2218

Closed
BramMusters opened this issue Apr 14, 2021 · 2 comments · Fixed by #2224
Closed

Scaling integrations removes Kamelet ConfigMaps #2218

BramMusters opened this issue Apr 14, 2021 · 2 comments · Fixed by #2224
Assignees
Labels
area/kamelets kind/bug Something isn't working

Comments

@BramMusters
Copy link

BramMusters commented Apr 14, 2021

I want to pause and start Integrations by scaling the replicas to 0 and 1. When scaling integrations using kubectl scale, Kamelet ConfigMaps are removed. This breaks the integration.

timed-logger.yaml Integration:

- from:
    uri: "timer:tick?period=15s"
    steps:
      - to: "kamelet:logger?message=hello"

logger Kamelet:

apiVersion: camel.apache.org/v1alpha1
kind: Kamelet
metadata:
  name: logger
  labels:
    camel.apache.org/kamelet.type: "sink"
spec:
  definition:
    title: "Logger"
    description: |-
      Logger
    required:
      - message
    properties:
      message:
        title: Message
        description: Message
        type: string
  flow:
    from:
      uri: "kamelet:source"
      steps:
        - log: "{{message}}"

Steps to reproduce:

  1. kamel run timed-logger.yaml.

ConfigMaps

timed-logger-kamelet-logger-flow 
timed-logger-source-000
timed-logger-application-properties
  1. kubectl scale it timed-logger --replicas 0

ConfigMaps:

timed-logger-source-000
timed-logger-application-properties  

(timed-logger-kamelet-logger-flow is deleted)
Scaling the integration to 2 results in the same behavior, the Kamelet ConfigMap is removed.

  1. kubectl scale it timed-logger --replicas 1
    ConfigMaps:
timed-logger-source-000
timed-logger-application-properties  

Log of the camel-k-operator:

{"level":"info","ts":1618387208.49495,"logger":"camel-k.trait","msg":"Apply trait: init"}
{"level":"info","ts":1618387208.4978032,"logger":"camel-k.trait","msg":"Apply trait: camel"}
{"level":"error","ts":1618387208.5083137,"logger":"controller","msg":"Reconciler error","controller":"integration-controller","name":"timed-logger","namespace":"default","error":"error during trait customization: ConfigMap \"timed-logger-kamelet-logger-flow\" not found",

EDIT: as requested, the application.properties of the integration:
camel.k.sources[0].language=yaml
camel.k.sources[1].location=file:/etc/camel/sources/i-source-001/logger.yaml
camel.k.sources[1].name=logger
camel.k.sources[1].property-names[0]=message
camel.k.sources[1].type=template
camel.k.sources[1].language=yaml
camel.k.sources[0].location=file:/etc/camel/sources/i-source-000/camel-k-embedded-flow.yaml
camel.k.sources[0].name=camel-k-embedded-flow


@astefanutti astefanutti added area/kamelets kind/bug Something isn't working labels Apr 14, 2021
@squakez
Copy link
Contributor

squakez commented Apr 15, 2021

I'm going to have a look at this

@astefanutti
Copy link
Member

@squakez thanks. I suspect the ConfigMap may only be added to the initialisation phase, and when the integration, in running phase, gets updated, the GC trait assumes the ConfigMap is not needed and deletes it. If that assumption is correct, the ConfigMap should also be added to the integration resources in the running phase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kamelets kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants