channel/

directory
v0.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 9, 2019 License: Apache-2.0

README

Apache Kafka Channels

Kafka channels are those backed by Apache Kafka topics.

Deployment steps

  1. Setup Knative Eventing Install an Apache Kafka cluster, if you have not done so already.

    • For Kubernetes a simple installation is done using the Strimzi Kafka Operator. Its installation guides provide content for Kubernetes and Openshift.

    Note: This KafkaChannel is not limited to Apache Kafka installations on Kubernetes. It is also possible to use an off-cluster Apache Kafka installation.

  2. Now that Apache Kafka is installed, you need to configure the bootstrapServers value in the config-kafka ConfigMap, located inside the config/400-kafka-config.yaml file:

    apiVersion: v1
    kind: ConfigMap
    metadata:
      name: config-kafka
      namespace: knative-eventing
    data:
      # Broker URL. Replace this with the URLs for your kafka cluster,
      # which is in the format of my-cluster-kafka-bootstrap.my-kafka-namespace:9092.
      bootstrapServers: REPLACE_WITH_CLUSTER_URL
    
  3. Apply the Kafka config:

    ko apply -f config
    
  4. Create the KafkaChannel custom objects:

    apiVersion: messaging.knative.dev/v1alpha1
    kind: KafkaChannel
    metadata:
      name: my-kafka-channel
    spec:
      numPartitions: 1
      replicationFactor: 3
    

    You can configure the number of partitions with numPartitions, as well as the replication factor with replicationFactor. If not set, both will default to 1.

Components

The major components are:

  • Kafka Channel Controller
  • Kafka Channel Dispatcher
  • Kafka Webhook
  • Kafka Config Map

The Kafka Channel Controller is located in one Pod:

kubectl get deployment -n knative-eventing kafka-ch-controller

The Kafka Channel Dispatcher receives and distributes all events to the appropriate consumers:

kubectl get deployment -n knative-eventing kafka-ch-dispatcher

The Kafka Webhook is used to validate and set defaults to KafkaChannel custom objects:

kubectl get deployment -n knative-eventing kafka-webhook

The Kafka Config Map is used to configure the bootstrapServers of your Apache Kafka installation:

kubectl get configmap -n knative-eventing config-kafka

Directories

Path Synopsis
cmd
pkg
apis/messaging/v1alpha1
Package v1alpha1 is the v1alpha1 version of the API.
Package v1alpha1 is the v1alpha1 version of the API.
client/clientset/versioned
This package has the automatically generated clientset.
This package has the automatically generated clientset.
client/clientset/versioned/fake
This package has the automatically generated fake clientset.
This package has the automatically generated fake clientset.
client/clientset/versioned/scheme
This package contains the scheme of the automatically generated clientset.
This package contains the scheme of the automatically generated clientset.
client/clientset/versioned/typed/messaging/v1alpha1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
client/clientset/versioned/typed/messaging/v1alpha1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL