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-adminandproxy-adminsubjects. -
Issue the tokens for
clientsubject
Create Kubernetes Secrets for secret key and tokens
-
Create the secret key Secret
-
Create the
broker-admintoken Secret -
Create the
proxy-admintoken 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-admintoken -
Produce messages with client token