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.第2章 OpenShift クラスターの準備
本章では、Red Hat Integration - Camel K および OpenShift Serverless を OpenShift にインストールする方法と、開発環境に必要な Camel K および OpenShift Serverless コマンドラインクライアントツールをインストールする方法について説明します。
2.1. Camel K のインストール
OperatorHub から OpenShift クラスターで Red Hat Integration - Camel K Operator をインストールできます。OperatorHub は OpenShift Container Platform Web コンソールから使用でき、クラスター管理者が Operator を検出およびインストールするためのインターフェイスを提供します。
Camel K Operator のインストール後に、コマンドラインですべての Camel K 機能にアクセスする Camel K CLI ツールをインストールできます。
前提条件
適切なアクセスレベルで OpenShift 4.6 (またはそれ以降の) クラスターにアクセスできること。この場合、プロジェクトの作成および Operator のインストールができること。また、CLI ツールをローカルシステムにインストールできること。
注記You do not need to create a pull secret when installing Camel K from the OpenShift OperatorHub. The Camel K Operator automatically reuses the OpenShift cluster-level authentication to pull the Camel K image from `registry.redhat.io`.
-
コマンドラインで OpenShift クラスターと対話できるように OpenShift CLI ツール (
oc
) をインストールしていること。OpenShift CLI のインストール方法の詳細は、Installing the OpenShift CLI を参照してください。
手順
- OpenShift Container Platform Web コンソールで、クラスター管理者権限を持つアカウントを使用してログインします。
新しい OpenShift プロジェクトを作成します。
- 左側のナビゲーションメニューで、Home > Project > Create Project とクリックします。
-
プロジェクト名 (例:
my-camel-k-project
) を入力し、Create をクリックします。
- 左側のナビゲーションメニューで、Operators > OperatorHub とクリックします。
-
Filter by keyword テキストボックスに
Camel K
を入力し、Red Hat Integration - Camel K Operator カードをクリックします。 - Operator に関する情報を確認し、続いて Install をクリックします。Operator インストールページが開きます。
以下のサブスクリプション設定を選択します。
- Update Channel > latest
次の 2 つのオプションから選択します。
- Installation Mode > A specific namespace on the cluster > my-camel-k-project
- Installation Mode > All namespaces on the cluster (default) > Openshift operator
注記If you do not choose among the above two options, the system by default chooses a global namespace on the cluster then leading to openshift operator.
Approval Strategy > Automatic
注記ご使用の環境で必要な場合は Installation mode > All namespaces on the cluster および Approval Strategy > Manual 設定も使用できます。
- Install をクリックし、Camel K Operator が使用できるようになるまでしばらく待ちます。
Camel K CLI ツールをダウンロードし、インストールします。
- OpenShift Web コンソールの上部にある Help menu (?) から、Command line tools を選択します。
- kamel - Red Hat Integration - Camel K - Command Line Interface セクションまでスクロールダウンします。
- ローカルのオペレーティングシステム (Linux、Mac、Windows) のバイナリーをダウンロードするためのリンクをクリックします。
- CLI を展開してシステムパスにインストールします。
Kamel K CLI にアクセスできることを確認するには、コマンドウィンドウを開き、以下のコマンドを入力します。
kamel --help
このコマンドは、Camel K CLI コマンドに関する情報を表示します。
次のステップ
(オプション) Camel K リソース制限の指定
2.1.1. Camel K リソース制限の指定
Camel K をインストールする場合、Camel K 用の OpenShift Pod には、CPU およびメモリー (RAM) リソースの制限がありません。Camel K のリソース制限を定義する場合は、インストールプロセスで作成された Camel K サブスクリプションリソースを編集する必要があります。
前提条件
- Camel K のインストール で説明されているように、Camel K Operator がインストールされている OpenShift プロジェクトにクラスター管理者としてアクセスできる。
Camel K サブスクリプションに適用するリソース制限を把握している。リソース制限の詳細は、以下のドキュメントを参照してください。
- OpenShift ドキュメントの Setting deployment resources
- Kubernetes ドキュメントの Managing Resources for Containers
手順
- OpenShift Web コンソールにログインします。
- Operators > Installed Operators > Operator Details > Subscription の順に選択します。
Actions > Edit Subscription を選択します。
YAML エディターでサブスクリプションのファイルが開きます。
spec
セクションで、以下の例のようにconfig.resources
セクションを追加し、メモリーと CPU の値を指定します。spec: channel: default config: resources: limits: memory: 512Mi cpu: 500m requests: cpu: 200m memory: 128Mi
- 変更を保存します。
OpenShift はサブスクリプションを更新し、指定したリソース制限を適用します。