1.2.2.2. Kamelet の設定パラメーターの決定

Kamelet Binding で Kamelet への参照を追加する場合、Kamelet の名前を指定し、Kamelet のパラメーターを設定します。

前提条件

  • 作業用 namespace またはクラスター全体に Camel K Operator がインストールされている。

手順

Kamelet の名前およびパラメーターを決定するには、以下を実行します。

  1. ターミナルウィンドウで、OpenShift クラスターにログインします。
  2. Kamelet の YAML ファイルを開きます。

    oc describe kamelets/<kamelet-name>

    たとえば、ftp-source Kamelet のコードを表示するには、Camel K Operator が現在の namespace にインストールされている場合は、以下のコマンドを使用します。

    oc describe kamelets/ftp-source

    Camel K Operator が cluster-mode でインストールされている場合は、以下のコマンドを使用します。

    oc describe -n openshift-operators kamelets/ftp-source

  3. YAML ファイルで、spec.definition セクション (JSON-schema 形式で記述される) まで下方向にスクロールし、Kamelet のプロパティーの一覧を表示します。セクションの最後の必須フィールドには、Kamelet を参照する際に設定する必要のあるプロパティーが一覧表示されます。

    たとえば、以下のコードは ftp-source Kamelet の spec.definition セクションからの抜粋です。このセクションは、Kamelet のすべての設定プロパティーの詳細を提供します。この Kamelet に必要なプロパティーは、connectionHostconnectionPortusernamepassword、および directoryName です。

    spec:
      definition:
        title: "FTP Source"
        description: |-
          Receive data from an FTP Server.
        required:
          - connectionHost
          - connectionPort
          - username
          - password
          - directoryName
        type: object
        properties:
          connectionHost:
            title: Connection Host
            description: Hostname of the FTP server
            type: string
          connectionPort:
            title: Connection Port
            description: Port of the FTP server
            type: string
            default: 21
          username:
            title: Username
            description: The username to access the FTP server
            type: string
          password:
            title: Password
            description: The password to access the FTP server
            type: string
            format: password
            x-descriptors:
            - urn:alm:descriptor:com.tectonic.ui:password
          directoryName:
            title: Directory Name
            description: The starting directory
            type: string
          passiveMode:
            title: Passive Mode
            description: Sets passive mode connection
            type: boolean
            default: false
            x-descriptors:
            - 'urn:alm:descriptor:com.tectonic.ui:checkbox'
          recursive:
            title: Recursive
            description: If a directory, will look for files in all the sub-directories as well.
            type: boolean
            default: false
            x-descriptors:
            - 'urn:alm:descriptor:com.tectonic.ui:checkbox'
          idempotent:
            title: Idempotency
            description: Skip already processed files.
            type: boolean
            default: true
            x-descriptors:
            - 'urn:alm:descriptor:com.tectonic.ui:checkbox'