Ce contenu n'est pas disponible dans la langue sélectionnée.
Chapter 5. Managing Camel K integrations
You can manage Red Hat Integration - Camel K integrations using the Camel K command line or using development tools. This chapter explains how to manage Camel K integrations on the command line and provides links to additional resources that explain how to use the VS Code development tools.
5.1. Managing Camel K integrations Copier lienLien copié sur presse-papiers!
Camel K provides different options for managing Camel K integrations on your OpenShift cluster on the command line. This section shows simple examples of using the following commands:
-
kamel get -
kamel describe -
kamel log -
kamel delete
Prerequisites
- Section 3.1, “Setting up your Camel K development environment”
- You must already have a Camel integration written in Java, XML, or YAML DSL
Procedure
Ensure that the Camel K Operator is running on your OpenShift cluster, for example:
oc get pod
oc get podCopy to Clipboard Copied! Toggle word wrap Toggle overflow Returns:
NAME READY STATUS RESTARTS AGE camel-k-operator-86b8d94b4-pk7d6 1/1 Running 0 6m28s
NAME READY STATUS RESTARTS AGE camel-k-operator-86b8d94b4-pk7d6 1/1 Running 0 6m28sCopy to Clipboard Copied! Toggle word wrap Toggle overflow Enter the
kamel runcommand to run your integration in the cloud on OpenShift. For example:kamel run hello.camelk.yaml
kamel run hello.camelk.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Returns:
integration "hello" created
integration "hello" createdCopy to Clipboard Copied! Toggle word wrap Toggle overflow Check the status of the integration:
kamel get
kamel getCopy to Clipboard Copied! Toggle word wrap Toggle overflow Returns:
NAME PHASE KIT hello Building Kit kit-bqatqib5t4kse5vukt40
NAME PHASE KIT hello Building Kit kit-bqatqib5t4kse5vukt40Copy to Clipboard Copied! Toggle word wrap Toggle overflow Enter the
kamel describecommand to print detailed information about the integration:kamel describe integration hello
kamel describe integration helloCopy to Clipboard Copied! Toggle word wrap Toggle overflow Returns:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Enter the
kamel logcommand to print the log tostdout:kamel log hello
kamel log helloCopy to Clipboard Copied! Toggle word wrap Toggle overflow Returns:
... 1] 2020-04-14 16:03:41.205 INFO [Camel (camel-k) thread #1 - timer://yaml] info - Exchange[ExchangePattern: InOnly, BodyType: String, Body: Hello Camel K from yaml] [1] 2020-04-14 16:03:42.205 INFO [Camel (camel-k) thread #1 - timer://yaml] info - Exchange[ExchangePattern: InOnly, BodyType: String, Body: Hello Camel K from yaml] [1] 2020-04-14 16:03:43.204 INFO [Camel (camel-k) thread #1 - timer://yaml] info - Exchange[ExchangePattern: InOnly, BodyType: String, Body: Hello Camel K from yaml] ...
... 1] 2020-04-14 16:03:41.205 INFO [Camel (camel-k) thread #1 - timer://yaml] info - Exchange[ExchangePattern: InOnly, BodyType: String, Body: Hello Camel K from yaml] [1] 2020-04-14 16:03:42.205 INFO [Camel (camel-k) thread #1 - timer://yaml] info - Exchange[ExchangePattern: InOnly, BodyType: String, Body: Hello Camel K from yaml] [1] 2020-04-14 16:03:43.204 INFO [Camel (camel-k) thread #1 - timer://yaml] info - Exchange[ExchangePattern: InOnly, BodyType: String, Body: Hello Camel K from yaml] ...Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Press
Ctrl-Cto terminate logging in the terminal. Enter the
kamel deleteto delete the integration deployed on OpenShift:kamel delete hello
kamel delete helloCopy to Clipboard Copied! Toggle word wrap Toggle overflow Returns:
Integration hello deleted
Integration hello deletedCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Additional resources
- For more details on logging, see Section 5.2, “Managing Camel K integration logging levels”
- For faster deployment turnaround times, see Section 3.6, “Running Camel K integrations in development mode”
- For details of development tools to manage integrations, see VS Code Tooling for Apache Camel K by Red Hat
5.2. Managing Camel K integration logging levels Copier lienLien copié sur presse-papiers!
Camel K uses Apache Log4j 2 as the logging framework for integrations. You can configure the logging levels of various loggers on the command line at runtime by specifying the logging.level prefix as an integration property. For example:
--property logging.level.org.apache.camel=DEBUG
--property logging.level.org.apache.camel=DEBUG
Procedure
Enter the
kamel runcommand and specify the logging level using the--propertyoption. For example:kamel run --property logging.level.org.apache.camel=DEBUG HelloCamelK.java --dev
kamel run --property logging.level.org.apache.camel=DEBUG HelloCamelK.java --devCopy to Clipboard Copied! Toggle word wrap Toggle overflow Returns:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Press
Ctrl-Cto terminate logging in the terminal.
Additional resources
- For more details on the logging framework, see the Apache Log4j 2 documentation
- For details of development tools to view logging, see VS Code Tooling for Apache Camel K by Red Hat