第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 log -
kamel delete
前提条件
- Setting up your Camel K development environment
- Java または YAML DSL で記述された Camel インテグレーションが作成済みである必要があります。
手順
以下の例のように、Camel K Operator が OpenShift クラスターで稼働していることを確認します。
oc get podNAME READY STATUS RESTARTS AGE camel-k-operator-86b8d94b4-pk7d6 1/1 Running 0 6m28skamel runコマンドを入力し、OpenShift のクラウドでインテグレーションを実行します。以下に例を示します。kamel run hello.camelk.yamlintegration "hello" createdkamel getコマンドを入力し、インテグレーションの状態を確認します。<<<<<<< HEAD $ kamel get NAME PHASE KIT hello Building Kit myproject/kit-c4ci6mbe9hl5ph5c9sjg ======= kamel getNAME PHASE KIT hello Building Kit kit-bqatqib5t4kse5vukt40 >>>>>>> fusedoc-4502kamel describeコマンドを入力し、インテグレーションに関する詳細情報を出力します。<<<<<<< HEAD $ kamel describe it hello ======= kamel describe integration hello>>>>>>> fusedoc-4502 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.4.0 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 ReplicaSetReadykamel 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 helloIntegration hello deleted
その他のリソース
- ロギングの詳細は、「Managing Camel K integration logging levels」を参照してください。
- デプロイメントのターンアラウンド時間を短縮するには、「Running Camel K integrations in development mode」を参照してください。
- インテグレーションを管理するための開発ツールの詳細は、Red Hat による Apache Camel K の VS Code ツール を参照してください。