Red Hat Camel K is deprecated
Red Hat Camel K is deprecated and the End of Life date for this product is June 30, 2025. For help migrating to the current go-to solution, Red Hat build of Apache Camel, see the Migration Guide.第1章 Camel K インテグレーションの管理
Camel K コマンドラインまたは開発ツールを使用して、Red Hat Integration - Camel K インテグレーションを管理できます。本章では、コマンドラインで Camel K インテグレーションを管理する方法を説明し、VS Code 開発ツールの使用方法を説明する追加のリソースへのリンクを提供します。
1.1. Camel K インテグレーションの管理
コマンドラインで OpenShift クラスターの Camel K インテグレーションを管理するためのさまざまなオプションがあります。ここでは、以下のコマンドを使用する簡単な例を紹介します。
-
kamel get
-
kamel describe
-
kamel ログ
-
kamel delete
前提条件
- Camel K 開発環境の設定
- Java または YAML DSL で記述された Camel インテグレーションが作成済みである必要があります。
手順
以下の例のように、Camel K Operator が OpenShift クラスターで稼働していることを確認します。
oc get pod
NAME READY STATUS RESTARTS AGE camel-k-operator-86b8d94b4-pk7d6 1/1 Running 0 6m28s
kamel run
コマンドを入力し、OpenShift のクラウドでインテグレーションを実行します。以下に例を示します。kamel run hello.camelk.yaml
integration "hello" created
kamel get
コマンドを入力し、インテグレーションの状態を確認します。kamel get
NAME PHASE KIT hello Building Kit kit-bqatqib5t4kse5vukt40
kamel describe
コマンドを入力し、インテグレーションに関する詳細情報を出力します。kamel describe integration hello
Name: hello Namespace: myproject Creation Timestamp: Fri, 13 Aug 2021 16:23:21 +0200 Phase: Building Kit Runtime Version: 1.7.1.fuse-800025-redhat-00001 Kit: myproject/kit-c4ci6mbe9hl5ph5c9sjg Image: Version: 1.6.6 Dependencies: camel:core camel:log camel:timer mvn:org.apache.camel.k:camel-k-runtime mvn:org.apache.camel.quarkus:camel-quarkus-yaml-dsl Sources: Name Language Compression Ref Ref Key camel-k-embedded-flow.yaml yaml false Conditions: Type Status Reason Message IntegrationPlatformAvailable True IntegrationPlatformAvailable myproject/camel-k IntegrationKitAvailable True IntegrationKitAvailable kit-c4ci6mbe9hl5ph5c9sjg CronJobAvailable False CronJobNotAvailableReason different controller strategy used (deployment) DeploymentAvailable True DeploymentAvailable deployment name is hello KnativeServiceAvailable False KnativeServiceNotAvailable different controller strategy used (deployment) Ready True ReplicaSetReady
kamel log
コマンドを入力して、ログをstdout
に出力します。kamel log hello
... [1] 2021-08-13 14:37:15,860 INFO [info] (Camel (camel-1) thread #0 - timer://yaml) Exchange[ExchangePattern: InOnly, BodyType: String, Body: Hello Camel K from yaml] ...
-
Ctrl-C
キーを押して、ターミナルでログインを終了します。 kamel delete
を入力して、OpenShift にデプロイされたインテグレーションを削除します。kamel delete hello
Integration hello deleted
関連情報
- ロギングの詳細は、Managing Camel K integration logging levels を参照してください。
- デプロイメントのターンアラウンド時間を短縮するには、Running Camel K integrations in development mode を参照してください。
- インテグレーションを管理するための開発ツールの詳細は、Red Hat による Apache Camel K の VS Code ツール を参照してください。