Before you begin
Create JWT secret key and tokens
We can use thepulsarctl
to create the secret key and issue jwt tokens.
-
Create a secret key
-
Issue the tokens for
broker-admin
andproxy-admin
subjects. -
Issue the tokens for
client
subject
Create Kubernetes Secrets for secret key and tokens
-
Create the secret key Secret
-
Create the
broker-admin
token Secret -
Create the
proxy-admin
token Secret
Enable JWT authentication for Pulsar cluster
To enable JWT authentication on the Pulsar cluster, we need to add configurations onPulsarBroker
ojbect:
- [1]
custom
: add Pulsar configurations for authentication and authorization. - [2]
secretRefs
: mount the Secret resources. - [3]
pod.vars
: use environment variables to render Pulsar configurations
PulsarProxy
ojbect, we need to add configurations:
Clients connect to Pulsar with JWT token
-
Create authorization for the client subject with
broker-admin
token -
Produce messages with client token