Azure Event Hub SASL Example

New in Seldon Core 2.5.0

Seldon Core 2 can integrate with Azure Event Hub via Kafka protocol.

Prerequisites

To start you will need to have an Azure Event Hub Namespace. You can create one following Azure quickstart docs. Note that you do not need to create an Event Hub (topics) as Seldon Core 2 will require all the topics it needs automatically.

Create API Keys

To connect to Azure Event Hub provided Kafka API you need to obtain:

  • Kafka Endpoint

  • Connection String

You can obtain both using Azure Portal as documented here.

The Connection String should be in format of

Endpoint=sb://<namespace>.servicebus.windows.net/;SharedAccessKeyName=XXXXXX;SharedAccessKey=XXXXXX

Create Kubernetes Secret

Seldon Core 2 expects password to be in form of K8s secret.

kubectl create secret generic azure-kafka-secret -n seldon-mesh --from-literal password="Endpoint=sb://<namespace>.servicebus.windows.net/;SharedAccessKeyName=XXXXXX;SharedAccessKey=XXXXXX"

Configure Seldon Core 2

Configure Seldon Core 2 by setting following Helm values:

# k8s/samples/values-azure-event-hub-sasl.yaml.tmpl
kafka:
  bootstrap: <namespace>.servicebus.windows.net
  topics:
    replicationFactor: 3
    numPartitions: 4

security:
  kafka:
    protocol: SASL_SSL
    sasl:
      mechanism: "PLAIN"
      client:
        username: $ConnectionString
        secret: azure-kafka-secret
    ssl:
      client:
        secret:
        brokerValidationSecret:

Note you may need to tweak replicationFactor and numPartitions to your cluster configuration. The username should read $ConnectionString and this is not a variable for you to replace.

Troubleshooting

  • First check Azure Event Hub troubleshooting guide.

  • Set the kafka config map debug setting to all. For Helm install you can set kafka.debug=all.

  • Verify that you did not hit quotas for topics or partitions in your Event Hub namespace.

Last updated

Was this helpful?

Revision created

traefik was not migrated correctly