ceph source Ceph Source

Provided by: "Apache Software Foundation"

Support Level for this Kamelet is: "Stable"

Receive data from an Ceph Bucket, managed by a Object Storage Gateway.

Configuration Options

The following table summarizes the configuration options available for the ceph-source Kamelet:

Property Name Description Type Default Example

accessKey

Access Key

Required The access key.

string

bucketName

Bucket Name

Required The Ceph Bucket name.

string

cephUrl

Ceph Url Address

Required Set the Ceph Object Storage Address Url.

string

http://ceph-storage-address.com

secretKey

Secret Key

Required The secret key.

string

zoneGroup

Bucket Zone Group

Required The bucket zone group.

string

autoCreateBucket

Autocreate Bucket

Specifies to automatically create the bucket.

boolean

false

delay

Delay

The number of milliseconds before the next poll of the selected bucket.

integer

500

deleteAfterRead

Auto-delete Objects

Specifies to delete objects after consuming them.

boolean

true

ignoreBody

Ignore Body

If true, the Object body is ignored. Setting this to true overrides any behavior defined by the includeBody option. If false, the object is put in the body.

boolean

false

includeBody

Include Body

If true, the exchange is consumed and put into the body and closed. If false, the Object stream is put raw into the body and the headers are set with the object metadata.

boolean

true

prefix

Prefix

The bucket prefix to consider while searching.

string

folder/

Dependencies

At runtime, the ceph-source Kamelet relies upon the presence of the following dependencies:

  • camel:aws2-s3

  • camel:kamelet

Camel JBang usage

Prerequisites

  • You’ve installed JBang.

  • You have executed the following command:

jbang app install camel@apache/camel

Supposing you have a file named route.yaml with this content:

- route:
    from:
      uri: "kamelet:timer-source"
      parameters:
        period: 10000
        message: 'test'
      steps:
        - to:
            uri: "kamelet:log-sink"

You can now run it directly through the following command

camel run route.yaml

Camel K Environment Usage

This section describes how you can use the ceph-source.

Knative source

You can use the ceph-source Kamelet as a Knative source by binding it to a Knative object.

ceph-source-pipe.yaml
apiVersion: camel.apache.org/v1
kind: Pipe
metadata:
  name: ceph-source-pipe
spec:
  source:
    ref:
      kind: Kamelet
      apiVersion: camel.apache.org/v1
      name: ceph-source
    properties:
      accessKey: The Access Key
      bucketName: The Bucket Name
      cephUrl: http://ceph-storage-address.com
      secretKey: The Secret Key
      zoneGroup: The Bucket Zone Group
  sink:
    ref:
      kind: Channel
      apiVersion: messaging.knative.dev/v1
      name: mychannel

Prerequisite

You have Camel K installed on the cluster.

Procedure for using the cluster CLI

  1. Save the ceph-source-pipe.yaml file to your local drive, and then edit it as needed for your configuration.

  2. Run the source by using the following command:

    kubectl apply -f ceph-source-pipe.yaml

Procedure for using the Kamel CLI

Configure and run the source by using the following command:

kamel bind channel:mychannel -p "source.accessKey=The Access Key" -p "source.bucketName=The Bucket Name" -p "source.cephUrl=\http://ceph-storage-address.com" -p "source.secretKey=The Secret Key" -p "source.zoneGroup=The Bucket Zone Group" ceph-source

This command creates the Kamelet Pipe in the current namespace on the cluster.

Kafka source

You can use the ceph-source Kamelet as a Kafka source by binding it to a Kafka topic.

ceph-source-pipe.yaml
apiVersion: camel.apache.org/v1
kind: Pipe
metadata:
  name: ceph-source-pipe
spec:
  source:
    ref:
      kind: Kamelet
      apiVersion: camel.apache.org/v1
      name: ceph-source
    properties:
      accessKey: The Access Key
      bucketName: The Bucket Name
      cephUrl: http://ceph-storage-address.com
      secretKey: The Secret Key
      zoneGroup: The Bucket Zone Group
  sink:
    ref:
      kind: KafkaTopic
      apiVersion: kafka.strimzi.io/v1beta1
      name: my-topic

Prerequisites

  • You’ve installed Strimzi.

  • You’ve created a topic named my-topic in the current namespace.

  • You have Camel K installed on the cluster.

Procedure for using the cluster CLI

  1. Save the ceph-source-pipe.yaml file to your local drive, and then edit it as needed for your configuration.

  2. Run the source by using the following command:

    kubectl apply -f ceph-source-pipe.yaml

Procedure for using the Kamel CLI

Configure and run the source by using the following command:

kamel bind kafka.strimzi.io/v1beta1:KafkaTopic:my-topic -p "source.accessKey=The Access Key" -p "source.bucketName=The Bucket Name" -p "source.cephUrl=\http://ceph-storage-address.com" -p "source.secretKey=The Secret Key" -p "source.zoneGroup=The Bucket Zone Group" ceph-source

This command creates the Kamelet Pipe in the current namespace on the cluster.