Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
New in Seldon Core 2.5.0
Seldon Core 2 can integrate with Amazon managed Apache Kafka (MSK). You can control access to your Amazon MSK clusters using sign-in credentials that are stored and secured using AWS Secrets Manager. Storing user credentials in Secrets Manager reduces the overhead of cluster authentication such as auditing, updating, and rotating credentials. Secrets Manager also lets you share user credentials across clusters.
Configuration of the AWS MSK instance itself is out of scope for this example. Please follow the official AWS documentation on how to enable SASL and public access to the Kafka cluster (if required).
To setup SASL/SCRAM in an Amazon MSK cluster, please follow the guide from Amazon's Official documentation.
Do not forget to also copy the bootstrap.servers
which we will use it in our configuration later below for Seldon.
Seldon Core 2 expects password to be in form of K8s secret.
Configure Seldon Core 2 by setting following Helm values:
Note you may need to tweak replicationFactor
and numPartitions
to your cluster configuration.
Please check Amazon MSK Troubleshooting documentation.
Set the kafka config map debug setting to all
. For Helm install you can set kafka.debug=all
.
The Ansible installation of a Seldon Core and associated ecosystem is meant for dev/testing purposes. For production use cases follow .
Provided Ansible playbooks and roles depends on Ansible Collection for performing kubectl
and helm
operations. Check Ansible [documentation] for further information.
To install Ansible and required collections
We have tested provided instructions on Python 3.8 - 3.11 with following version of Python libraries
and kubernetes.core
collection in version 2.4.0
.
Once installed you can use the following Playbooks that you will find in folder of Seldon Core 2 repository.
You also need to have installed CLI.
This will create a Kind cluster and install ecosystem dependencies (kafka, prometheus, opentelemetry, jager) as well as all the seldon-specific components. The seldon components are installed using helm-charts from the current git checkout (../k8s/helm-charts/
).
Internally this runs, in order, the following playbooks (described in more detail in the sections below):
kind-cluster.yaml
setup-ecosystem.yaml
setup-seldon.yaml
You may pass any of the additonal variables which are configurable for those playbooks to seldon-all
. See the Customizing Ansible Instalation section for details.
For example:
Running the playbooks individually, as described in the sections below, will give you more control over what gets run and when (for example, if you want to install into an existing k8s cluster).
It is recommended to first install Seldon Core 2 inside Kind cluster. This allow to test and trial the installation in isolated environment that is easy to remove.
Seldon runs by default in seldon-mesh
namespace and a Jaeger pod and and OpenTelemetry collector are installed in the chosen namespace. Run the following:
The most common change will be to install in another namespace with:
Run the following from the ansible/
folder:
If you have changed the namespace you wish to use you will need to run with:
The ecosystem setup can be parametrized by providing extra Ansible variables, e.g. using -e
flag to ansible-playbook
command.
For example run the following from the ansible/
folder:
will only install Kafka when setting up the ecosystem.
By default, the container images used in the install are the ones defined by the helm charts (referring to images publicly available on dockerhub).
If you need to customize the images (i.e pull from private registry, pull given tag), create a custom images config file following the example in playbooks/vars/set-custom-images.yaml
and run with:
If, instead of pulling images from an external repository you want to build certain components locally, please read README.dev.md
Private registries
When using private registries, access needs to be authenticated (typically, via a service account key), and the k8s cluster will need to have access to a secret holding this key to be able to pull images.
The setup-seldon.yaml
playbook will create the required k8s secrets inside the cluster if it is provided with an auth file in dockerconfigjson
format. You provide the path to this file by cusomizing the custom_image_pull_secrets.dockerconfigjson
variable and define the secret name via custom_image_pull_secrets.name
in the custom images config file (the one passed to the playbook via -e @file
).
By default, docker creates the dockerconfigjson
auth file in ~/.docker/config.json
after passing the service-account key to docker login
.
The docker login
command would look like this (key in json format):
or, for keys in base64 format:
Saving helm-chart customisations
Because the additional custom images config file (starting from the playbooks/vars/set-custom-images.yaml
example) overrides values in the helm-charts available in the repo, there's also a playbook option of saving those overrides as a separate values file, which could be used if deploying manually via helm.
This is controlled via two variables:
You can either pass those within the custom images config file or directly when running the playbook. For example, for just saving the helm-chart overrides (without installing seldon components), you would run:
Please note that when deploying outside ansible via helm using this saved overrides file, and using private registries, you will have to manually create the service-account key secret with the same name as the one defined in your custom image config file under custom_image_pull_secrets.name
.
To fully remove the Ansible installation delete the created Kind cluster
This will stop and delete the Kind
cluster freeing all of the resources taken by the dev/trial installation. You may want to also remove cache resources used for the installation with
We provide several Helm charts.
seldon-core-v2-crds
: cluster wide install of custom resources.
seldon-core-v2-setup
: installation of the manager to manage resources in the namespace or clusterwide. This also installs default SeldonConfig and ServerConfig resources which allow Runtimes and Servers to be installed easily on demand.
seldon-core-v2-runtime
: this installs a SeldonRuntime custom resource which creates the core components in a namespace.
seldon-core-v2-servers
: this installs Server custom resources which provide example core servers to load models.
seldon-core-v2-certs
: a default set of certificates for TLS.
The Helm charts can be found within the k8s/helm-charts
folder and they are published
Assuming you have installed any ecosystem components: Jaeger, Prometheus, Kafka as discussed you can follow the following steps.
Note that for Kafka follow the steps discussed
This will install the operator namespaced so it will only control resources in the provided namespace. To allow cluster wide usage add the --set controller.clusterwide=true
, e.g.
Cluster wide operations will require ClusterRoles to be created so when deploying be aware your user will require the required permissions. With cluster wide operations you can create SeldonRuntimes
in any namespace.
This will install the core components in your desired namespace.
To install some MLServer and Triton servers you can either create Server resources yourself or for initial testing you can use our example Helm chart seldon-core-v2-servers:
By default this will install 1 MLServer and 1 Triton in the desired namespace. This namespace should be the same namespace you installed a Seldon Core Runtime.
Remove any models, pipelines that are running.
Remove the runtime:
Remove the core components:
Remove the CRDs
Seldon will run with .
At present we support mTLS authentication to MSK which can be run from a Kubernetes cluster inside or outside Amazon. If running outside your MSK cluster must have a public endpoint.
If you running your Kubernetes cluster outside AWS you will need to create a .
You will need to setup Kafka ACLs for your user where the username is the CommonName of the certificate of the client and allow full topic access. For example, to add a user with CN=myname to have full operations using the kafka-acls script with :
You will also need to allow the connecting user to be able to perform admin tasks on the cluster so we can create topics on demand.
You will need to allow group access also.
Create a secret for the client certificate you created. If you followed the you will need to export your private key from the JKS keystore. The certificate and chain will be provided in PEM format when you get the certificate signed. You can use these to create a secret with:
tls.key : PEM formatted private key
tls.crt : PEM formatted certificate
ca.crt : Certificate chain
To extract certificates from truststore do:
Add ca.crt to a secret.
We provide a template you can extend in k8s/samples/values-aws-msk-kafka-mtls.yaml.tmpl
:
Copy this and modify by adding your broker endpoints.
Set the kafka config map debug setting to "all". For Helm install you can set kafka.debug=all
.
If you see an error from the producer in the Pipeline gateway complaining about not enough insync replicas then the replication factor Seldon is using is less than the cluster setting for min.insync.replicas
which for a default AWS MSK cluster defaults to 2. Ensure this is equal to that of the cluster. This value can be set in the Helm chart with kafka.topics.replicationFactor
.
Ensure that the version of the Kubernetes cluster is v1.27 or later. Seldon Core 2 supports Kubernetes versions 1.27, 1.28, 1.29, 1.30, and 1.31. You can create a cluster on your local computer for testing with .
Install the ecosystem components using .
To install Seldon Core 2 from the , you can choose one of the following methods:
(recommended for production systems)
(recommended for testing, development, or trial)
The Kubernetes operator that is installed runs in namespaced mode so any resources you create need to be in the same namespace as you installed into.
Seldon recommends installing Seldon Core 2 using Helm or Ansible. If you prefer to use Kustomize, you can base your configuration on the raw YAML files you generate in the k8s/yaml folder. Alternatively, you can follow the steps in the k8s/Makefile, which demonstrates how to build the YAML files from the Kustomize bases.
Seldon can be run with secure control plane and data plane operations. There are three areas of concern:
The various communication points between services are shown in the diagram below:
TLS control plane activation is switched on and off via the environment variable: CONTROL_PLANE_SECURITY_PROTOCOL
whose values can be PLAINTEXT
or SSL
.
Certificates will be loaded and used for the control plane gRPC services. The secrets or folders will be watched for updates (on certificate renewal) and automatically loaded again.
When installing seldon-core-v2-setup
you can set the secret names for your certificates. If using cert-manager example discussed below this would be as follows:
Kafka secure activation is switched on and off via the environment variable: KAFKA_SECURITY_PROTOCOL
whose values can be PLAINTEXT
, SSL
or SASL_SSL
.
Examples are shown below:
TLS Data plane activation is switched on and off via the environment variable: ENVOY_SECURITY_PROTOCOL
whose values can be PLAINTEXT
or SSL
.
When activated this ensures TLS is used to communicate to Envoy via the xDS server as well as using the SDS service to send cretificates to envoy to use for upstream and downstream networking. Downstream is the external access to Seldon and upstream is the path from Envoy to the model servers or pipeline gateway.
When installing seldon-core-v2-setup
you can set data plane operations to TLS as below. This assumes the secrets installed by the helm chart at the end of this section.
The above uses default secret names defined for the certificates installed. You can change the names of the required certificate secrets as shown in a longer configuration below (again using the default names for illustration).
For this we use the following updated Helm values (k8s/samples/values-tls-dataplane-example.yaml
):
We use Envoy internally to direct traffic and in Envoy's terminology upstream
is for internal model servers called from Envoy while the downstream server is the entrypoint server running in Envoy to receive grpc and REST calls. The above settings ensure mTLS for internal "upstream" traffic while provides a standard SSL non-mTLS entrpoint.
To use the above with the seldon CLI you would need a custom config file as follow:
We skip SSL Verify as these are internal self-signed certificates. For production use you would change this to the correct DNS name you are exposing the Seldon entrypoint.
You can install Certificates into the desired namespace, here we use seldon-mesh
as an example.
New in Seldon Core 2.5.0
Seldon Core 2 can integrate with Confluent Cloud managed Kafka. In this example we use SASL security mechanism.
In your Confluent Cloud environment create new API keys. The easiest way to obtain all required information is to head to Clients
-> New client
(choose e.g. Go) and generate new Kafka cluster API key from there.
This will generate for you:
Key
(we use it as username
)
Secret
(we use it as password
)
Do not forget to also copy the bootstrap.servers
from the example config.
See Confluent Cloud in case of issues.
Seldon Core 2 expects password to be in form of K8s secret
Configure Seldon Core 2 by setting following Helm values:
You may need to tweak replicationFactor
and numPartitions
to your cluster configuration.
Set the kafka config map debug setting to all
. For Helm install you can set kafka.debug=all
.
New in Seldon Core 2.5.0
Seldon Core 2 can integrate with Azure Event Hub via Kafka protocol.
You will need at least Standard
tier for your Event Hub Namespace as Basic
tier does not support Kafka protocol.
Seldon Core 2 creates 2 Kafka topics for each pipeline and model plus one global topic for errors. This means that total number of topics will be 2 x (#models + #pipelines) + 1
which will likely exceed the limit of Standard
tier in Azure Event Hub. You can find more information on quotas, like the number of partitions per Event Hub, .
To start you will need to have an Azure Event Hub Namespace. You can create one following Azure quickstart . Note that you do not need to create an Event Hub (topics) as Seldon Core 2 will require all the topics it needs automatically.
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 .
You should get the Connection String for a namespace level as we will need to dynamically create new topics.
The Connection String should be in format of
Seldon Core 2 expects password to be in form of K8s secret.
Configure Seldon Core 2 by setting following Helm values:
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.
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.
If you have installed Strimzi we have an example Helm chart to create a Kafka cluster for seldon and an associated user in kafka/strimzi
folder. Ensure the tls
is enabled with:
The Ansible setup-ecosystem
playbook will also install Strimzi and include a mTLS endpoint. See .
Create a Kafka User seldon
in the namespace seldon was installed. This assumes Strimzi Kafka cluster is installed in the same namespace or is running with cluster wide permissions. Our Ansible scripts to setup the ecosystem will also create this user if tls is active.
If you don't have this user you can install it with in your desired namespace (here seldon-mesh
):
Install seldon with the Strimzi certificate secrets using a custom values file. This sets the secret created by Strimzi for the user created above (seldon
) and targets the server certificate authority secret from the name of the cluster created on install of the Kafka cluster (seldon-cluster-ca-cert
).
Configure Seldon Core 2 by setting following Helm values:
You can now go ahead and install a SeldonRuntime in your desired install namespace (here seldon-mesh
), e.g.
New in Seldon Core 2.7.0
Seldon Core 2 can integrate with Confluent Cloud managed Kafka. In this example we use .
In your Confluent Cloud Console go to and register your Identity Provider.
See Confluent Cloud for further details.
In your Confluent Cloud Console go to and add new identity pool to your newly registered Identity Provider.
See Confluent Cloud for further details.
Seldon Core 2 expects oauth credentials to be in form of K8s secret
You will need following information from Confluent Cloud:
Cluster ID: Cluster Overview
→ Cluster Settings
→ General
→ Identification
Identity Pool ID: Accounts & access
→ Identity providers
→ <specific provider details>
Client ID, client secret and token endpoint url should come from identity provider, e.g. Keycloak or Azure AD.
Configure Seldon Core 2 by setting following Helm values:
Note you may need to tweak replicationFactor
and numPartitions
to your cluster configuration.
Set the kafka config map debug setting to all
. For Helm install you can set kafka.debug=all
.
If you simply want to install into a fresh local k8s cluster, the seldon-all
playbook allows you to do so with a single command:
If you used Ansible to install Seldon Core 2 and its ecosystem into K8s cluster other than Kind you need to manually remove all the components. Notes on how to remove Seldon Core 2 Helm installation itself you can find .
You can install into any namespace. For illustration we will use seldon-mesh
. This will install the core manager which will handle the key used by Seldon including the SeldonRuntime and Server resources.
Create a secret for the broker certificate. If following the you will need to export the trusstore of Amazon into PEM format and save as ca.crt.
First .
example
example
example
example
example
example
example
The installer/cluster controller for Seldon needs to provide the certificates. As part of Seldon we provide an example set of certificate issuers and certificates using .
First check Confluent Cloud .
First check Azure Event Hub .
First check Confluent Cloud .
seldon_mesh_namespace
string
seldon-mesh
namespace to install Seldon Core 2
seldon_kafka_namespace
string
seldon-mesh
namespace to install Kafka Cluster for Seldon Core 2
full_install
bool
yes
enables full ecosystem installation
install_kafka
bool
{{ full_install }}
installs Strimzi Kafka Operator
install_prometheus
bool
{{ full_install }}
installs Prometheus Operator
install_grafana
bool
{{ full_install }}
installs Grafana Operator
install_certmanager
bool
{{ full_install }}
installs Cert Manager
install_jaeger
bool
{{ full_install }}
installs Jaeger
install_opentelemetry
bool
{{ full_install }}
installs OpenTelemetry
configure_kafka
bool
{{ install_kafka }}
configures Kafka Cluster for Seldon Core 2
configure_prometheus
bool
{{ install_prometheus }}
configure Prometheus using Seldon Core 2 specific resources
configure_jaeger
bool
{{ install_jaeger }}
configure Jaeger using Seldon Core 2 specific resources
configure_opentelemetry
bool
{{ install_opentelemetry }}
configure OpenTelemetry using Seldon Core 2 specific resources
seldon_kafka_namespace
string
seldon-mesh
namespace to install Kafka
seldon_mesh_namespace
string
seldon-mesh
namespace to install Seldon
seldon_crds_namespace
string
default
namespace to install Seldon CRDs
full_install
bool
yes
enables full ecosystem installation
install_crds
bool
{{ full_install }}
installs Seldon CRDs
install_components
bool
{{ full_install }}
install Seldon components
install_servers
bool
{{ full_install }}
install Seldon servers
save_helm_components_overrides
bool
false
enable saving helm values overrides
save_helm_components_overrides_file
string
~/seldon_helm_comp_values.yaml
path/filename for saving overrides
Kafka
Required for inference Pipeline usage.
Prometheus
(Optional) Exposes metrics.
Grafana
(Optional) UI for metrics.
OpenTelemetry
(Optional) Exposes tracing.
Jaeger
(Optional) UI for traces.
3.8
6.7.0
6.0.1
26.1.0
3.9
7.2.0
6.0.1
26.1.0
3.10
7.2.0
6.0.1
26.1.0
3.11
7.2.0
6.0.1
26.1.0
Create a Strimzi Kafka cluster with SASL_SSL enabled. This can be done with our Ansible scripts by running the following from the ansible/
folder:
The referenced SASL/SCRAM YAML file looks like the below:
This will use the Strimzi Helm chart provided in Seldon Core 2. This will call the Strimzi cluster Helm chart provided by the project with overrides for the cluster authentication type and will also create a user seldon
with password credentials in a Kubernetes Secret.
Install Seldon Core 2 with SASL settings using a custom values file. This sets the secret created by Strimzi for the user created above (seldon
) and targets the server certificate authority secret from the name of the cluster created on install of the Kafka cluster (seldon-cluster-ca-cert
).
Configure Seldon Core 2 by setting following Helm values:
Kubernetes secrets and mounted files can be used to provide the certificates in PEM format. These are controlled by environment variables for server or client depending on the component:
CONTROL_PLANE_SECURITY_PROTOCOL
SSL or PLAINTEXT
For a server (scheduler):
CONTROL_PLANE_SERVER_TLS_SECRET_NAME
(optional) the name of the namespaced secret which holds the certificates
CONTROL_PLANE_CLIENT_TLS_SECRET_NAME
(optional) the name of the namespaced secret which holds the validation ca roots to verify the client certificate
CONTROL_PLANE_SERVER_TLS_KEY_LOCATION
the path to the TLS private key
CONTROL_PLANE_SERVER_TLS_CRT_LOCATION
the path to the TLS certificate
CONTROL_PLANE_SERVER_TLS_CA_LOCATION
the path to the TLS CA chain for the server
CONTROL_PLANE_CLIENT_TLS_CA_LOCATION
the path to the TLS CA chain for the client for mTLS verification
For a client (agent, modelgateway, hodometer, CRD controller):
CONTROL_PLANE_CLIENT_TLS_SECRET_NAME
(optional) the name of the namespaced secret which holds the certificates
CONTROL_PLANE_SERVER_TLS_SECRET_NAME
(optional) the name of the namespaced secret which holds the validation ca roots to verify the server certificate
CONTROL_PLANE_CLIENT_TLS_KEY_LOCATION
the path to the TLS private key
CONTROL_PLANE_CLIENT_TLS_CRT_LOCATION
the path to the TLS certificate
CONTROL_PLANE_CLIENT_TLS_CA_LOCATION
the path to the TLS CA chain for the client
CONTROL_PLANE_SERVER_TLS_CA_LOCATION
the path to the TLS CA chain for the server for mTLS verification
KAFKA_SECURITY_PROTOCOL
PLAINTXT, SSL, or SASL_SSL
KAFKA_CLIENT_TLS_SECRET_NAME
(optional) the name of the namespaced secret which holds the Kafka client certificate
KAFKA_CLIENT_SERVER_TLS_KEY_LOCATION
the path to the TLS private key
KAFKA_CLIENT_SERVER_TLS_CRT_LOCATION
the path to the TLS certificate
KAFKA_CLIENT_SERVER_TLS_CA_LOCATION
the path to the CA chain for the client
KAFKA_BROKER_TLS_SECRET_NAME
(optional) the name of the namespaced secret which holds the validation ca roots for the kafka broker
KAFKA_BROKER_TLS_CA_LOCATION
The path to the broker validatiob CA chain
KAFKA_CLIENT_SASL_USERNAME
SASL username
KAFKA_CLIENT_SASL_SECRET_NAME
the name of the namespaced secret which holds the SASL password
KAFKA_CLIENT_SASL_PASSWORD_LOCATION
the path to the file containing the SASL password
Envoy xDS server will use the control plane server and client certificates defined above.
Downstream server
ENVOY_DOWNSTREAM_SERVER_TLS_SECRET_NAME
(optional) the name of the namespaced secret which holds the certificates
ENVOY_DOWNSTREAM_CLIENT_TLS_SECRET_NAME
(optional) the name of the namespaced secret which holds the validation ca roots to verify the client certificate
ENVOY_DOWNSTREAM_SERVER_TLS_KEY_LOCATION
the path to the TLS private key
ENVOY_DOWNSTREAM_SERVER_TLS_CRT_LOCATION
the path to the TLS certificate
ENVOY_DOWNSTREAM_SERVER_TLS_CA_LOCATION
the path to the TLS CA chain for the server
ENVOY_DOWNSTREAM_CLIENT_TLS_CA_LOCATION
the path to the TLS CA chain for the client for mTLS verification
Downstream client
ENVOY_DOWNSTREAM_CLIENT_TLS_SECRET_NAME
(optional) the name of the namespaced secret which holds the certificates
ENVOY_DOWNSTREAM_SERVER_TLS_SECRET_NAME
(optional) the name of the namespaced secret which holds the validation ca roots to verify the server certificate
ENVOY_DOWNSTREAM_CLIENT_TLS_KEY_LOCATION
the path to the TLS private key
ENVOY_DOWNSTREAM_CLIENT_TLS_CRT_LOCATION
the path to the TLS certificate
ENVOY_DOWNSTREAM_CLIENT_TLS_CA_LOCATION
the path to the TLS CA chain for the server
ENVOY_DOWNSTREAM_SERVER_TLS_CA_LOCATION
the path to the TLS CA chain for the server for mTLS verification
Upstream server
ENVOY_UPSTREAM_SERVER_TLS_SECRET_NAME
(optional) the name of the namespaced secret which holds the certificates
ENVOY_UPSTREAM_CLIENT_TLS_SECRET_NAME
(optional) the name of the namespaced secret which holds the validation ca roots to verify the client certificate
ENVOY_UPSTREAM_SERVER_TLS_KEY_LOCATION
the path to the TLS private key
ENVOY_UPSTREAM_SERVER_TLS_CRT_LOCATION
the path to the TLS certificate
ENVOY_UPSTREAM_SERVER_TLS_CA_LOCATION
the path to the TLS CA chain for the server
ENVOY_UPSTREAM_CLIENT_TLS_CA_LOCATION
the path to the TLS CA chain for the client for mTLS verification
Upstream client
ENVOY_UPSTREAM_CLIENT_TLS_SECRET_NAME
(optional) the name of the namespaced secret which holds the certificates
ENVOY_UPSTREAM_SERVER_TLS_SECRET_NAME
(optional) the name of the namespaced secret which holds the validation ca roots to verify the server certificate
ENVOY_UPSTREAM_CLIENT_TLS_KEY_LOCATION
the path to the TLS private key
ENVOY_UPSTREAM_CLIENT_TLS_CRT_LOCATION
the path to the TLS certificate
ENVOY_UPSTREAM_CLIENT_TLS_CA_LOCATION
the path to the TLS CA chain for the server
ENVOY_UPSTREAM_SERVER_TLS_CA_LOCATION
the path to the TLS CA chain for the server for mTLS verificatio