source/

directory
v0.18.4 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2020 License: Apache-2.0

README

Apache Kafka - Source

The Apache Kafka Event source enables Knative Eventing integration with Apache Kafka. When a message is produced to Apache Kafka, the Apache Kafka Event Source will consume the produced message and post that message to the corresponding event sink.

Deployment steps

  1. Setup Knative Eventing

  2. If not done already, install an Apache Kafka cluster!

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

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

  3. Now that Apache Kafka is installed, apply the KafkaSource config:

    ko apply -f config/
    
  4. Create the KafkaSource custom objects, by configuring the required consumerGroup, bootstrapServers and topics values on the CR file of your source. Below is an example:

    apiVersion: sources.knative.dev/v1alpha1
    kind: KafkaSource
    metadata:
      name: kafka-source
    spec:
      consumerGroup: knative-group
      # 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
      topics:
        - knative-demo-topic
      sink:
        ref:
          apiVersion: serving.knative.dev/v1alpha1
          kind: Service
          name: event-display
    

Example

A more detailed example of the KafkaSource can be found in the Knative documentation.

Directories

Path Synopsis
cmd
Package config is a placeholder that allows us to pull in config files via go mod vendor.
Package config is a placeholder that allows us to pull in config files via go mod vendor.
pkg
apis/bindings
Package bindings contains bindings API versions
Package bindings contains bindings API versions
apis/bindings/v1alpha1
Package v1alpha1 contains API Schema definitions for the sources v1alpha1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:defaulter-gen=TypeMeta +groupName=bindings.knative.dev Package v1alpha1 contains API Schema definitions for the sources v1alpha1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:defaulter-gen=TypeMeta +groupName=sources.knative.dev
Package v1alpha1 contains API Schema definitions for the sources v1alpha1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:defaulter-gen=TypeMeta +groupName=bindings.knative.dev Package v1alpha1 contains API Schema definitions for the sources v1alpha1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:defaulter-gen=TypeMeta +groupName=sources.knative.dev
apis/bindings/v1beta1
Package v1beta1 contains API Schema definitions for the sources v1beta1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:defaulter-gen=TypeMeta +groupName=bindings.knative.dev Package v1beta1 contains API Schema definitions for the sources v1beta1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:defaulter-gen=TypeMeta +groupName=sources.knative.dev
Package v1beta1 contains API Schema definitions for the sources v1beta1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:defaulter-gen=TypeMeta +groupName=bindings.knative.dev Package v1beta1 contains API Schema definitions for the sources v1beta1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:defaulter-gen=TypeMeta +groupName=sources.knative.dev
apis/sources
Package sources contains sources API versions
Package sources contains sources API versions
apis/sources/v1alpha1
Package v1alpha1 contains API Schema definitions for the sources v1alpha1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:defaulter-gen=TypeMeta +groupName=sources.knative.dev Package v1alpha1 contains API Schema definitions for the sources v1alpha1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:defaulter-gen=TypeMeta +groupName=sources.knative.dev
Package v1alpha1 contains API Schema definitions for the sources v1alpha1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:defaulter-gen=TypeMeta +groupName=sources.knative.dev Package v1alpha1 contains API Schema definitions for the sources v1alpha1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:defaulter-gen=TypeMeta +groupName=sources.knative.dev
apis/sources/v1beta1
Package v1beta1 contains API Schema definitions for the sources v1beta1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:defaulter-gen=TypeMeta +groupName=sources.knative.dev Package v1beta1 contains API Schema definitions for the sources v1beta1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:defaulter-gen=TypeMeta +groupName=sources.knative.dev
Package v1beta1 contains API Schema definitions for the sources v1beta1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:defaulter-gen=TypeMeta +groupName=sources.knative.dev Package v1beta1 contains API Schema definitions for the sources v1beta1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:defaulter-gen=TypeMeta +groupName=sources.knative.dev
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/bindings/v1alpha1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
client/clientset/versioned/typed/bindings/v1alpha1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
client/clientset/versioned/typed/bindings/v1beta1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
client/clientset/versioned/typed/bindings/v1beta1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
client/clientset/versioned/typed/sources/v1alpha1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
client/clientset/versioned/typed/sources/v1alpha1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
client/clientset/versioned/typed/sources/v1beta1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
client/clientset/versioned/typed/sources/v1beta1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
reconciler/source
Package source implements the KafkaSource controller.
Package source implements the KafkaSource controller.

Jump to

Keyboard shortcuts

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