Installing Knative Eventing using YAML files

    Before installing Knative, you must meet the following prerequisites:

    • For prototyping purposes, Knative works on most local deployments of Kubernetes. For example, you can use a local, one-node cluster that has 2 CPUs and 4 GB of memory.

      Tip

      You can install a local distribution of Knative for development use by following the Getting started guide.

    • For production purposes, it is recommended that:

      • If you have only one node in your cluster, you need at least 6 CPUs, 6 GB of memory, and 30 GB of disk storage.
      • If you have multiple nodes in your cluster, for each node you need at least 2 CPUs, 4 GB of memory, and 20 GB of disk storage.
      • You have a cluster that uses Kubernetes v1.18 or newer.
      • You have installed the .
      • Your Kubernetes cluster must have access to the internet, because Kubernetes needs to be able to fetch images. To pull from a private registry, see Deploying images from a private container registry.

    Caution

    The system requirements provided are recommendations only. The requirements for your installation might vary, depending on whether you use optional components, such as a networking layer.

    Install the Eventing component

    To install the Eventing component:

    1. Install the required custom resource definitions (CRDs):

    2. Install the core components of Eventing:

      1. kubectl apply -f https://github.com/knative/eventing/releases/download/v0.24.0/eventing-core.yaml

      Info

      For information about the YAML files in Knative Eventing, see Description Tables for YAML Files.

    Monitor the Knative components until all of the components show a STATUS of Running or Completed:

    1. kubectl get pods --namespace knative-eventing

    Optional: Install a default channel (messaging) layer

    The tabs below expand to show instructions for installing a default channel layer. Follow the procedure for the channel of your choice:

    Apache Kafka Channel

    1. First, Install Apache Kafka for Kubernetes

    2. Then install the Apache Kafka Channel:

      1. curl -L "https://github.com/knative-sandbox/eventing-kafka/releases/download/v0.24.0/channel-consolidated.yaml" \
      2. | sed 's/REPLACE_WITH_CLUSTER_URL/my-cluster-kafka-bootstrap.kafka:9092/' \
      3. | kubectl apply -f -

      Tip

      To learn more, try the .

    Google Cloud Pub/Sub Channel

    1. Install the Google Cloud Pub/Sub channel:

      1. # This installs both the Channel and the GCP Sources.
      2. kubectl apply -f https://github.com/google/knative-gcp/releases/download/v0.24.0/cloud-run-events.yaml

      Tip

    In-Memory (standalone)

    The following command installs an implementation of channel that runs in-memory. This implementation is nice because it is simple and standalone, but it is unsuitable for production use cases.

    1. kubectl apply -f https://github.com/knative/eventing/releases/download/v0.24.0/in-memory-channel.yaml

    NATS Channel

    1. First, Install NATS Streaming for Kubernetes

    2. Then install the NATS Streaming channel:

      1. kubectl apply -f https://github.com/knative-sandbox/eventing-natss/releases/download/v0.24.0/300-natss-channel.yaml

    The tabs below expand to show instructions for installing the broker layer. Follow the procedure for the broker of your choice:

    Apache Kafka Broker

    The following commands install the Apache Kafka broker, and run event routing in a system namespace, knative-eventing, by default.

    1. Install the Kafka controller by entering the following command:

    2. Install the Kafka broker data plane by entering the following command:

      For more information, see the documentation.

      MT-Channel-based

      The following command installs an implementation of broker that utilizes channels and runs event routing components in a System Namespace, providing a smaller and simpler installation.

      1. kubectl apply -f https://github.com/knative/eventing/releases/download/v0.24.0/mt-channel-broker.yaml

      To customize which broker channel implementation is used, update the following ConfigMap to specify which configurations are used for which namespaces:

      1. apiVersion: v1
      2. kind: ConfigMap
      3. metadata:
      4. name: config-br-defaults
      5. namespace: knative-eventing
      6. data:
      7. default-br-config: |
      8. # This is the cluster-wide default broker channel.
      9. clusterDefault:
      10. apiVersion: v1
      11. kind: ConfigMap
      12. name: imc-channel
      13. namespace: knative-eventing
      14. # This allows you to specify different defaults per-namespace,
      15. # in this case the "some-namespace" namespace will use the Kafka
      16. # channel ConfigMap by default (only for example, you will need
      17. # to install kafka also to make use of this).
      18. namespaceDefaults:
      19. some-namespace:
      20. brokerClass: MTChannelBasedBroker
      21. apiVersion: v1
      22. kind: ConfigMap
      23. name: kafka-channel
      24. namespace: knative-eventing

      The referenced imc-channel and kafka-channel example ConfigMaps would look like:

      1. apiVersion: v1
      2. kind: ConfigMap
      3. metadata:
      4. name: imc-channel
      5. namespace: knative-eventing
      6. channelTemplateSpec: |
      7. apiVersion: messaging.knative.dev/v1
      8. ---
      9. apiVersion: v1
      10. kind: ConfigMap
      11. metadata:
      12. name: kafka-channel
      13. namespace: knative-eventing
      14. data:
      15. channelTemplateSpec: |
      16. apiVersion: messaging.knative.dev/v1alpha1
      17. kind: KafkaChannel
      18. spec:
      19. numPartitions: 3
      20. replicationFactor: 1

      Warning

      In order to use the KafkaChannel make sure it is installed on the cluster as discussed above.

      RabbitMQ Broker

      You can install the RabbitMQ broker by following the instructions in the RabbitMQ Knative Eventing Broker README.

      For more information, see the in GitHub.

      Install optional Eventing extensions

      The tabs below expand to show instructions for installing each Eventing extension.

      Apache Kafka Sink

        1. kubectl apply -f https://github.com/knative-sandbox/eventing-kafka-broker/releases/download/v0.24.0/eventing-kafka-controller.yaml
      1. Install the Kafka Sink data plane:

        1. kubectl apply -f https://github.com/knative-sandbox/eventing-kafka-broker/releases/download/v0.24.0/eventing-kafka-sink.yaml

      For more information, see the documentation.

      Sugar Controller

      The following command installs the Eventing Sugar Controller:

      The Knative Eventing Sugar Controller will react to special labels and annotations and produce Eventing resources. For example:

      • When a Namespace is labeled with eventing.knative.dev/injection=enabled, the controller will create a default broker in that namespace.
      • When a Trigger is annotated with eventing.knative.dev/injection=enabled, the controller will create a Broker named by that Trigger in the Trigger’s Namespace.

      The following command enables the default Broker on a namespace (here default):

      1. kubectl label namespace default eventing.knative.dev/injection=enabled

      Github Source

      The following command installs the single-tenant Github source:

      1. kubectl apply -f https://github.com/knative-sandbox/eventing-github/releases/download/v0.24.0/github.yaml

      The single-tenant GitHub source creates one Knative service per GitHub source.

      The following command installs the multi-tenant GitHub source:

      1. kubectl apply -f https://github.com/knative-sandbox/eventing-github/releases/download/v0.24.0/mt-github.yaml

      The multi-tenant GitHub source creates only one Knative service handling all GitHub sources in the cluster. This source does not support logging or tracing configuration yet.

      To learn more, try the Github source sample

      Apache Kafka Source

      The following command installs the Apache Kafka Source:

      1. kubectl apply -f https://github.com/knative-sandbox/eventing-kafka/releases/download/v0.24.0/source.yaml

      To learn more, try the .

      GCP Sources

      The following command installs the GCP Sources:

      1. # This installs both the Sources and the Channel.
      2. kubectl apply -f https://github.com/google/knative-gcp/releases/download/v0.24.0/cloud-run-events.yaml

      To learn more, try the following:

      Apache CouchDB Source

      The following command installs the Apache CouchDB Source:

      1. kubectl apply -f https://github.com/knative-sandbox/eventing-couchdb/releases/download/v0.24.0/couchdb.yaml

      To learn more, read the documentation.

      VMware Sources and Bindings

      To learn more, try the VMware sources and bindings samples.