Self-hosted Kafka
Integrate self-hosted Kafka with Seldon Core 2.
Last updated
Was this helpful?
Integrate self-hosted Kafka with Seldon Core 2.
Last updated
Was this helpful?
You can run Kafka in the same Kubernetes cluster that hosts the Seldon Core 2. Seldon recommends using the for Kafka installation and maintenance. For more details about configuring Kafka with Seldon Core 2 see the section.
Integrating self-hosted Kafka with Seldon Core 2 includes these steps:
Strimzi provides a Kubernetes Operator to deploy and manage Kafka clusters. First, we need to install the Strimzi Operator in your Kubernetes cluster.
Create a namespace where you want to install Kafka. For example the namespace seldon-mesh
:
Install Strimzi.
Install Strimzi Operator.
This deploys the Strimzi Operator
in the seldon-mesh
namespace. After the Strimzi Operator is running, you can create a Kafka cluster by applying a Kafka custom resource definition.
Create a YAML file to specify the initial configuration.
Note: This configuration sets up a Kafka cluster with version 3.9.0. Ensure that you review the the of Kafka and update the version in the kafka.yaml
file as needed. For more configuration examples, see this .
Use your preferred text editor to create and save the file as kafka.yaml
with the following content:
Apply the Kafka cluster configuration.
Create a YAML file named kafka-nodepool.yaml
to create a nodepool for the kafka cluster.
Apply the Kafka node pool configuration.
Check the status of the Kafka Pods to ensure they are running properly:
You should see multiple Pods for Kafka, and Strimzi operators running.
Error
The Pod that begins with the name seldon-dataflow-engine
does not show the status as Running
.
One of the possible reasons could be that the DNS resolution for the service failed.
Solution
Check the logs of the Pod <seldon-dataflow-engine>
:
In the output check if a message reads:
Verify the name
in the metadata
for the kafka.yaml
and kafka-nodepool.yaml
. It should read seldon
.
Check the name of the Kafka services in the namespace:
Restart the Pod:
When the SeldonRuntime
is installed in a namespace a ConfigMap is created with the
settings for Kafka configuration. Update the ConfigMap
only if you need to customize the configurations.
Verify that the ConfigMap resource named seldon-kafka
that is created in the namespace seldon-mesh
:
You should the ConfigMaps for Kafka, Zookeeper, Strimzi operators, and others.
View the configuration of the the ConfigMap named seldon-kafka
.
You should see an output simialr to this:
To customize the settings you can add and modify the Kafka configuration using Helm, for example to add compression for producers.
Create a YAML file to specify the compression configuration for Seldon Core 2 runtime. For example, create the values-runtime-kafka-compression.yaml
file. Use your preferred text editor to create and save the file with the following content:
Change to the directory that contains the values-runtime-kafka-compression.yaml
file and then install Seldon Core 2 runtime in the namespace seldon-mesh
.
If you are using a shared Kafka cluster with other applications, it is advisable to isolate topic names and consumer group IDs from other cluster users to prevent naming conflicts. This can be achieved by configuring the following two settings:
topicPrefix
: set a prefix for all topics
consumerGroupIdPrefix
: set a prefix for all consumer groups
Here’s an example of how to configure topic name and consumer group ID isolation during a Helm installation for an application named myorg
:
After you integrated Seldon Core 2 with Kafka, you need to that adds an abstraction layer for traffic routing by receiving traffic from outside the Kubernetes platform and load balancing it to Pods running within the Kubernetes cluster.
After you installed Seldon Core 2, and Kafka using Helm, you need to complete .