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

Add Mount trait example #3166

Merged
merged 1 commit into from
Apr 28, 2022
Merged

Add Mount trait example #3166

merged 1 commit into from
Apr 28, 2022

Conversation

haanhvu
Copy link
Contributor

@haanhvu haanhvu commented Apr 3, 2022

fixes #3140

Release Note

NONE

Copy link
Contributor

@squakez squakez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have that scenario covered as suggested in the related issue https://github.com/apache/camel-k/tree/main/examples/volumes. I think we need to go beyond the simple timer to log example. One suggestion I can do is to provide some realistic situation. In the volume example, you can see I've created a producer Integration writing and a consumer Integration reading to/from a shared Volume.
You may think on some alternative situation, for example, showing how to log the camel k to an external volume (see https://stackoverflow.com/a/70063203/10974363 for details how to specify log file path). Then you can show how you can scrape that log from another integration.
It's just an idea. I guess the final goal of these activities is to get a bit of knowledge on the platform.

@haanhvu haanhvu force-pushed the issue3140 branch 2 times, most recently from 7e81d12 to 89ca59c Compare April 12, 2022 04:33
@haanhvu haanhvu requested a review from squakez April 12, 2022 04:37
@haanhvu
Copy link
Contributor Author

haanhvu commented Apr 12, 2022

You may think on some alternative situation, for example, showing how to log the camel k to an external volume (see https://stackoverflow.com/a/70063203/10974363 for details how to specify log file path). Then you can show how you can scrape that log from another integration. It's just an idea. I guess the final goal of these activities is to get a bit of knowledge on the platform.

@squakez I took your idea. Can you review please?

@haanhvu haanhvu force-pushed the issue3140 branch 2 times, most recently from ba77e4c to 825212a Compare April 12, 2022 06:44
@squakez
Copy link
Contributor

squakez commented Apr 12, 2022

I think we still need something. Let me provide here a sort of script the user could run, and you will be able to provide the related Integrations:

kamel run Producer.java --volume my-pv-claim:/tmp/log -p quarkus.log.file.path=/tmp/log/trace.log -p quarkus.log.file.enable=true

kamel run Consumer.java --volume my-pv-claim:/tmp/log

The Producer could be a timer to log Integration. You can provide some incremental counter, ie, simple language ${exchangeProperty.CamelTimerCounter}. Ideally the consumer should process the file in order to do something (ie, filtering for some number), so you can have a basic example with a few useful things in it.

@haanhvu haanhvu force-pushed the issue3140 branch 2 times, most recently from 78d5595 to c73c9e1 Compare April 14, 2022 15:03
@haanhvu
Copy link
Contributor Author

haanhvu commented Apr 14, 2022

I think we still need something. Let me provide here a sort of script the user could run, and you will be able to provide the related Integrations:

kamel run Producer.java --volume my-pv-claim:/tmp/log -p quarkus.log.file.path=/tmp/log/trace.log -p quarkus.log.file.enable=true

kamel run Consumer.java --volume my-pv-claim:/tmp/log

The Producer could be a timer to log Integration. You can provide some incremental counter, ie, simple language ${exchangeProperty.CamelTimerCounter}. Ideally the consumer should process the file in order to do something (ie, filtering for some number), so you can have a basic example with a few useful things in it.

@squakez I did this. Please review.

Copy link
Contributor

@squakez squakez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work, thanks! Just remove the references of the Pod creation which are superfluous.

Requirement: Persistent Volume already created.

Create the Pod and the Persistent Volume Claim:
`kubectl apply -f pod-example.yaml`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need any live Pod for the PVC to be usable. You can just remove this line.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done!

@@ -0,0 +1,11 @@
apiVersion: v1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This yaml is not needed, you can remove it.

@haanhvu
Copy link
Contributor Author

haanhvu commented Apr 28, 2022

@squakez can this be merged now?

@squakez squakez merged commit edaf8af into apache:main Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mount trait usage example
4 participants