Skip to content

Sync Pulsar permissions between clusters

Grant, change and revoke, with a way back.

Terminal recording of kurkik pulsar sync

The recording shows kurkik pulsar sync on the demo sandbox; its data differs from this example.

Shown here: one cluster. Other broker setups are further down.

What you get if you do not ask for the risky part:

$ kurkik pulsar sync a.yaml b --acls --dry-run
Sync a.yaml into b - Apache Pulsar, cluster b (http://pulsar-b:8080)
owns: namespaces shop/orders - the ones its channels live in; permissions, as x-kurkik.pulsar.server.acl declares them
plan: <digest>
Run one sync per cluster at a time: two at once each plan against a state the other is changing.
changes (2)
+ grant persistent://shop/orders/created audit (not set) -> consume
+ grant shop/orders ops (not set) -> functions, sinks, sources
note: Pulsar enforces permissions only on a broker with authorization enabled; one without stores them and checks nothing.
left alone (3)
in use shop/orders billing --force
How this connection signs in does not say which role it is, so billing on shop/orders could be its own access. It is taken away only when destroying what may be in use is accepted.
differs tenant shop adminRoles --overwrite
and 1 difference sync does not act on - servers, messages, undeclared settings; kurkik pulsar diff shows them
applying needs: tenant admin on shop
2 changes - 2 still differ
Apache Pulsar has no rehearsal: the plan above is all of it. Nothing was changed.
exit 2

Nothing changes yet. --dry-run only shows what would happen.

$ kurkik pulsar sync a.yaml b --acls --overwrite --revoke --dry-run
Sync a.yaml into b - Apache Pulsar, cluster b (http://pulsar-b:8080)
owns: namespaces shop/orders - the ones its channels live in; permissions, as x-kurkik.pulsar.server.acl declares them
plan: <digest>
Run one sync per cluster at a time: two at once each plan against a state the other is changing.
changes (3)
+ grant persistent://shop/orders/created audit (not set) -> consume
+ grant shop/orders ops (not set) -> functions, sinks, sources
~ set tenant shop adminRoles platform,shop-admin -> shop-admin
Tenant shop is administered by shop-admin: a role it no longer names loses admin of every namespace in it.
note: Pulsar settles topic policies asynchronously: kurkik reads back for up to 30s before calling a change unconfirmed.
note: Pulsar enforces permissions only on a broker with authorization enabled; one without stores them and checks nothing.
left alone (2)
in use shop/orders billing --force
How this connection signs in does not say which role it is, so billing on shop/orders could be its own access. It is taken away only when destroying what may be in use is accepted.
and 1 difference sync does not act on - servers, messages, undeclared settings; kurkik pulsar diff shows them
applying needs: tenant admin on shop
3 changes - 1 still differs
Apache Pulsar has no rehearsal: the plan above is all of it. Nothing was changed.
exit 2
$ kurkik pulsar sync a.yaml b --acls --overwrite --revoke --yes
Sync a.yaml into b - Apache Pulsar, cluster b (http://pulsar-b:8080)
owns: namespaces shop/orders - the ones its channels live in; permissions, as x-kurkik.pulsar.server.acl declares them
plan: <digest>
Run one sync per cluster at a time: two at once each plan against a state the other is changing.
changes (3)
+ grant persistent://shop/orders/created audit (not set) -> consume
+ grant shop/orders ops (not set) -> functions, sinks, sources
~ set tenant shop adminRoles platform,shop-admin -> shop-admin
Tenant shop is administered by shop-admin: a role it no longer names loses admin of every namespace in it.
note: Pulsar settles topic policies asynchronously: kurkik reads back for up to 30s before calling a change unconfirmed.
note: Pulsar enforces permissions only on a broker with authorization enabled; one without stores them and checks nothing.
left alone (2)
in use shop/orders billing --force
How this connection signs in does not say which role it is, so billing on shop/orders could be its own access. It is taken away only when destroying what may be in use is accepted.
and 1 difference sync does not act on - servers, messages, undeclared settings; kurkik pulsar diff shows them
applying needs: tenant admin on shop
3 changes - 1 still differs
applied
[+] done grant persistent://shop/orders/created audit (not set) -> consume
[+] done grant shop/orders ops (not set) -> functions, sinks, sources
[+] done set tenant shop adminRoles platform,shop-admin -> shop-admin
Applied 3 of 3 changes - 2 left alone
snapshot: ~/.local/state/kurkik/sync/b/b-<time>.snapshot.yaml
rollback: ~/.local/state/kurkik/sync/b/b-<time>.rollback.yaml
undo: kurkik pulsar sync revert ~/.local/state/kurkik/sync/b/b-<time>.snapshot.yaml
exit 2

Written before the first change.

rollback.yaml
system: "Apache Pulsar"
target: "b (http://pulsar-b:8080)"
createdAt: "<time>"
document: "~/.local/state/kurkik/sync/b/b-<time>.snapshot.yaml"
entries:
- forAction: "grant-access:persistent://shop/orders/created:audit"
undo: "REVOKE_GRANTED_ACCESS"
target: "persistent://shop/orders/created"
field: "audit"
note: "sync granted this. Revoking it again cuts off whoever has started to rely\
\ on it."
definition:
actions: "consume"
role: "audit"
- forAction: "grant-access:shop/orders:ops"
undo: "REVOKE_GRANTED_ACCESS"
target: "shop/orders"
field: "ops"
note: "sync granted this. Revoking it again cuts off whoever has started to rely\
\ on it."
definition:
actions: "functions, sinks, sources"
role: "ops"
- forAction: "set-setting:tenant shop:adminRoles"
undo: "SET_SETTING"
target: "tenant shop"
field: "adminRoles"
preState:
value: "platform,shop-admin"
override: true

Download rollback.yaml

$ kurkik pulsar diff a.yaml b --acls
a.yaml vs b
ACLs
+ analytics - b grants analytics consume on topic persistent://shop/orders/paid; a.yaml does not.
~ billing actions - billing on namespace shop/orders: consume on a.yaml, consume,produce on b.
Notes
- Not compared: consumers, schemas, functions, connectors, configuration. Add --consumers --schemas --functions --connectors --configs, or --all, to compare them.
Drift: 1 changed · 1 unmanaged · 0 missing (drift) - 16 matched
exit 2
$ kurkik pulsar sync revert ~/.local/state/kurkik/sync/b/b-<time>.snapshot.yaml b --force --yes
Revert b to b-<time>.snapshot.yaml - Apache Pulsar, cluster b (http://pulsar-b:8080)
owns: what the run being undone changed, as its rollback records it
plan: <digest>
Run one sync per cluster at a time: two at once each plan against a state the other is changing.
changes (3)
~ set tenant shop adminRoles shop-admin -> platform,shop-admin
- revoke shop/orders ops functions, sinks, sources -> (not set) [revokes access]
ops loses what sync granted it on shop/orders; a client that has started relying on it fails.
- revoke persistent://shop/orders/created audit consume -> (not set) [revokes access]
audit loses what sync granted it on persistent://shop/orders/created; a client that has started relying on it fails.
note: Pulsar settles topic policies asynchronously: kurkik reads back for up to 30s before calling a change unconfirmed.
note: Pulsar enforces permissions only on a broker with authorization enabled; one without stores them and checks nothing.
applying needs: tenant admin on shop
3 changes, 2 destroy
applied
[+] done set tenant shop adminRoles shop-admin -> platform,shop-admin
[+] done revoke shop/orders ops functions, sinks, sources -> (not set)
[+] done revoke persistent://shop/orders/created audit consume -> (not set)
Applied 3 of 3 changes
snapshot: ~/.local/state/kurkik/sync/b/b-<time>.snapshot.yaml
rollback: ~/.local/state/kurkik/sync/b/b-<time>.rollback.yaml
undo: kurkik pulsar sync revert ~/.local/state/kurkik/sync/b/b-<time>.snapshot.yaml
exit 0

After the revert, compared with how it was before: Drift: 0 changed · 0 unmanaged · 0 missing (no drift) - 43 matched

source.yaml, 187 lines
asyncapi: 3.0.0
info:
title: a Apache Pulsar API
version: 1.0.0-SNAPSHOT
description: Generated by reading Apache Pulsar of a (http://pulsar-a:8080).
servers:
standalone:
host: pulsar-a:6650
protocol: pulsar
protocolVersion: "4.0"
description: Apache Pulsar cluster standalone.
bindings:
pulsar:
bindingVersion: 0.1.0
tenant: shop
x-kurkik:
pulsar:
server:
cluster: standalone
brokers:
- localhost:8080
schemaRegistryUrl: http://pulsar-a:8080
schemaRegistryVendor: pulsar
namespacePolicies:
public/default:
schema-autoupdate: "on"
shop/orders:
schema-autoupdate: "on"
tenants:
- tenant: public
adminRoles: []
allowedClusters:
- standalone
- tenant: shop
adminRoles:
- shop-admin
allowedClusters:
- standalone
security:
- security: NONE
tls: false
acl:
- role: billing
resourceType: namespace
name: shop/orders
actions:
- consume
- role: checkout
resourceType: namespace
name: shop/orders
actions:
- produce
- role: ops
resourceType: namespace
name: shop/orders
actions:
- functions
- sinks
- sources
- role: audit
resourceType: topic
name: persistent://shop/orders/created
actions:
- consume
consumers: []
producers: []
functions: []
sources: []
sinks: []
brokerConfiguration:
advertisedAddress: localhost
backlogQuotaDefaultLimitGB: "10.0"
bookkeeperClientMinNumRacksPerWriteQuorum: "1"
bookkeeperClientReorderReadSequenceEnabled: "false"
bookkeeperNumberOfChannelsPerBookie: "1"
brokerDeleteInactiveTopicsEnabled: "false"
clusterName: standalone
enablePackagesManagement: "true"
forceDeleteNamespaceAllowed: "true"
functionsWorkerEnablePackageManagement: "true"
isRunningStandalone: "true"
loadBalancerEnabled: "false"
loadManagerClassName: org.apache.pulsar.broker.loadbalance.NoopLoadManager
managedLedgerCacheEvictionFrequency: "100.0"
managedLedgerDefaultAckQuorum: "1"
managedLedgerDefaultEnsembleSize: "1"
managedLedgerDefaultMarkDeleteRateLimit: "0.1"
managedLedgerDefaultWriteQuorum: "1"
metadataStoreUrl: rocksdb:///pulsar/data/metadata
packagesManagementStorageProvider: org.apache.pulsar.packages.management.storage.filesystem.FileSystemPackagesStorageProvider
statusFilePath: /usr/local/apache/htdocs
topicPublisherThrottlingTickTimeMillis: "2"
webSocketServiceEnabled: "true"
clientConfiguration:
serviceUrl: pulsar://pulsar-a:6650
webServiceUrl: http://pulsar-a:8080
producerConfiguration: {}
consumerConfiguration: {}
channels:
persistent-shop-orders-created:
address: persistent://shop/orders/created
bindings:
pulsar:
bindingVersion: 0.1.0
namespace: orders
persistence: persistent
x-kurkik:
pulsar:
channel:
topic: persistent://shop/orders/created
tenant: shop
namespace: orders
persistence: persistent
partitions: 0
geo-replication:
- standalone
topicConfiguration:
partitions: 0
persistence: persistent
replication-clusters:
- standalone
schema-autoupdate: "on"
persistent-shop-orders-paid:
address: persistent://shop/orders/paid
bindings:
pulsar:
bindingVersion: 0.1.0
namespace: orders
persistence: persistent
x-kurkik:
pulsar:
channel:
topic: persistent://shop/orders/paid
tenant: shop
namespace: orders
persistence: persistent
partitions: 2
geo-replication:
- standalone
topicConfiguration:
partitions: 2
persistence: persistent
replication-clusters:
- standalone
schema-autoupdate: "on"
operations:
receive_persistent-shop-orders-created:
action: receive
channel:
$ref: "#/channels/persistent-shop-orders-created"
x-kurkik:
pulsar:
operation:
security:
- audit
- billing
consumerConfiguration: {}
receive_persistent-shop-orders-paid:
action: receive
channel:
$ref: "#/channels/persistent-shop-orders-paid"
x-kurkik:
pulsar:
operation:
security:
- billing
consumerConfiguration: {}
send_persistent-shop-orders-created:
action: send
channel:
$ref: "#/channels/persistent-shop-orders-created"
x-kurkik:
pulsar:
operation:
security:
- checkout
producerConfiguration: {}
send_persistent-shop-orders-paid:
action: send
channel:
$ref: "#/channels/persistent-shop-orders-paid"
x-kurkik:
pulsar:
operation:
security:
- checkout
producerConfiguration: {}

Download source.yaml

target.yaml, 184 lines
asyncapi: 3.0.0
info:
title: b Apache Pulsar API
version: 1.0.0-SNAPSHOT
description: Generated by reading Apache Pulsar of b (http://pulsar-b:8080).
servers:
standalone:
host: pulsar-b:6650
protocol: pulsar
protocolVersion: "4.0"
description: Apache Pulsar cluster standalone.
bindings:
pulsar:
bindingVersion: 0.1.0
tenant: shop
x-kurkik:
pulsar:
server:
cluster: standalone
brokers:
- localhost:8080
schemaRegistryUrl: http://pulsar-b:8080
schemaRegistryVendor: pulsar
namespacePolicies:
public/default:
schema-autoupdate: "on"
shop/orders:
schema-autoupdate: "on"
tenants:
- tenant: public
adminRoles: []
allowedClusters:
- standalone
- tenant: shop
adminRoles:
- platform
- shop-admin
allowedClusters:
- standalone
security:
- security: NONE
tls: false
acl:
- role: billing
resourceType: namespace
name: shop/orders
actions:
- consume
- produce
- role: checkout
resourceType: namespace
name: shop/orders
actions:
- produce
- role: analytics
resourceType: topic
name: persistent://shop/orders/paid
actions:
- consume
consumers: []
producers: []
functions: []
sources: []
sinks: []
brokerConfiguration:
advertisedAddress: localhost
backlogQuotaDefaultLimitGB: "10.0"
bookkeeperClientMinNumRacksPerWriteQuorum: "1"
bookkeeperClientReorderReadSequenceEnabled: "false"
bookkeeperNumberOfChannelsPerBookie: "1"
brokerDeleteInactiveTopicsEnabled: "false"
clusterName: standalone
enablePackagesManagement: "true"
forceDeleteNamespaceAllowed: "true"
functionsWorkerEnablePackageManagement: "true"
isRunningStandalone: "true"
loadBalancerEnabled: "false"
loadManagerClassName: org.apache.pulsar.broker.loadbalance.NoopLoadManager
managedLedgerCacheEvictionFrequency: "100.0"
managedLedgerDefaultAckQuorum: "1"
managedLedgerDefaultEnsembleSize: "1"
managedLedgerDefaultMarkDeleteRateLimit: "0.1"
managedLedgerDefaultWriteQuorum: "1"
metadataStoreUrl: rocksdb:///pulsar/data/metadata
packagesManagementStorageProvider: org.apache.pulsar.packages.management.storage.filesystem.FileSystemPackagesStorageProvider
statusFilePath: /usr/local/apache/htdocs
topicPublisherThrottlingTickTimeMillis: "2"
webSocketServiceEnabled: "true"
clientConfiguration:
serviceUrl: pulsar://pulsar-b:6650
webServiceUrl: http://pulsar-b:8080
producerConfiguration: {}
consumerConfiguration: {}
channels:
persistent-shop-orders-created:
address: persistent://shop/orders/created
bindings:
pulsar:
bindingVersion: 0.1.0
namespace: orders
persistence: persistent
x-kurkik:
pulsar:
channel:
topic: persistent://shop/orders/created
tenant: shop
namespace: orders
persistence: persistent
partitions: 0
geo-replication:
- standalone
topicConfiguration:
partitions: 0
persistence: persistent
replication-clusters:
- standalone
schema-autoupdate: "on"
persistent-shop-orders-paid:
address: persistent://shop/orders/paid
bindings:
pulsar:
bindingVersion: 0.1.0
namespace: orders
persistence: persistent
x-kurkik:
pulsar:
channel:
topic: persistent://shop/orders/paid
tenant: shop
namespace: orders
persistence: persistent
partitions: 2
geo-replication:
- standalone
topicConfiguration:
partitions: 2
persistence: persistent
replication-clusters:
- standalone
schema-autoupdate: "on"
operations:
receive_persistent-shop-orders-created:
action: receive
channel:
$ref: "#/channels/persistent-shop-orders-created"
x-kurkik:
pulsar:
operation:
security:
- billing
consumerConfiguration: {}
receive_persistent-shop-orders-paid:
action: receive
channel:
$ref: "#/channels/persistent-shop-orders-paid"
x-kurkik:
pulsar:
operation:
security:
- analytics
- billing
consumerConfiguration: {}
send_persistent-shop-orders-created:
action: send
channel:
$ref: "#/channels/persistent-shop-orders-created"
x-kurkik:
pulsar:
operation:
security:
- billing
- checkout
producerConfiguration: {}
send_persistent-shop-orders-paid:
action: send
channel:
$ref: "#/channels/persistent-shop-orders-paid"
x-kurkik:
pulsar:
operation:
security:
- billing
- checkout
producerConfiguration: {}

Download target.yaml

How to build this setup yourself

Clusters

Pulsar a

Terminal window
pulsar-admin --admin-url http://pulsar-a:8080 tenants create shop --allowed-clusters standalone --admin-roles shop-admin
pulsar-admin --admin-url http://pulsar-a:8080 namespaces create shop/orders --clusters standalone
pulsar-admin --admin-url http://pulsar-a:8080 topics create persistent://shop/orders/created
pulsar-admin --admin-url http://pulsar-a:8080 topics create-partitioned-topic persistent://shop/orders/paid --partitions 2
pulsar-admin --admin-url http://pulsar-a:8080 namespaces grant-permission shop/orders --role billing --actions consume
pulsar-admin --admin-url http://pulsar-a:8080 namespaces grant-permission shop/orders --role checkout --actions produce
pulsar-admin --admin-url http://pulsar-a:8080 topics grant-permission persistent://shop/orders/created --role audit --actions consume
pulsar-admin --admin-url http://pulsar-a:8080 namespaces grant-permission shop/orders --role ops --actions functions,sources,sinks

Pulsar b

Terminal window
pulsar-admin --admin-url http://pulsar-b:8080 tenants create shop --allowed-clusters standalone --admin-roles shop-admin
pulsar-admin --admin-url http://pulsar-b:8080 namespaces create shop/orders --clusters standalone
pulsar-admin --admin-url http://pulsar-b:8080 topics create persistent://shop/orders/created
pulsar-admin --admin-url http://pulsar-b:8080 topics create-partitioned-topic persistent://shop/orders/paid --partitions 2
pulsar-admin --admin-url http://pulsar-b:8080 namespaces grant-permission shop/orders --role billing --actions consume,produce
pulsar-admin --admin-url http://pulsar-b:8080 namespaces grant-permission shop/orders --role checkout --actions produce
pulsar-admin --admin-url http://pulsar-b:8080 topics grant-permission persistent://shop/orders/paid --role analytics --actions consume
pulsar-admin --admin-url http://pulsar-b:8080 tenants update shop --admin-roles shop-admin,platform --allowed-clusters standalone

Sync

Terminal window
kurkik conn add pulsar a --admin-url http://pulsar-a:8080 --service-url pulsar://pulsar-a:6650 --client 4.0
kurkik conn add pulsar b --admin-url http://pulsar-b:8080 --service-url pulsar://pulsar-b:6650 --client 4.0
kurkik pulsar export a --this-cluster-only --acls --consumers --stdout > a.yaml # source.yaml (and b's, before: target.yaml)
kurkik pulsar sync a.yaml b --acls --dry-run # plan-without.txt
kurkik pulsar sync a.yaml b --acls --overwrite --revoke --dry-run # plan.txt (and -o json: plan.json)
kurkik pulsar sync a.yaml b --acls --overwrite --revoke --yes # apply.txt, and the reverse patch: rollback.yaml
kurkik pulsar diff a.yaml b --acls # after.txt
kurkik pulsar sync revert ~/.local/state/kurkik/sync/b/b-<time>.snapshot.yaml b --force --yes # revert.txt

Same plan.

How to build this setup yourself

Clusters

Pulsar a

Terminal window
pulsar-admin --admin-url http://pulsar-a:8080 tenants create shop --allowed-clusters standalone --admin-roles shop-admin
pulsar-admin --admin-url http://pulsar-a:8080 namespaces create shop/orders --clusters standalone
pulsar-admin --admin-url http://pulsar-a:8080 topics create persistent://shop/orders/created
pulsar-admin --admin-url http://pulsar-a:8080 topics create-partitioned-topic persistent://shop/orders/paid --partitions 2
pulsar-admin --admin-url http://pulsar-a:8080 namespaces grant-permission shop/orders --role billing --actions consume
pulsar-admin --admin-url http://pulsar-a:8080 namespaces grant-permission shop/orders --role checkout --actions produce
pulsar-admin --admin-url http://pulsar-a:8080 topics grant-permission persistent://shop/orders/created --role audit --actions consume
pulsar-admin --admin-url http://pulsar-a:8080 namespaces grant-permission shop/orders --role ops --actions functions,sources,sinks

Pulsar b

Terminal window
pulsar-admin --admin-url http://pulsar-b:8080 tenants create shop --allowed-clusters standalone --admin-roles shop-admin
pulsar-admin --admin-url http://pulsar-b:8080 namespaces create shop/orders --clusters standalone
pulsar-admin --admin-url http://pulsar-b:8080 topics create persistent://shop/orders/created
pulsar-admin --admin-url http://pulsar-b:8080 topics create-partitioned-topic persistent://shop/orders/paid --partitions 2
pulsar-admin --admin-url http://pulsar-b:8080 namespaces grant-permission shop/orders --role billing --actions consume,produce
pulsar-admin --admin-url http://pulsar-b:8080 namespaces grant-permission shop/orders --role checkout --actions produce
pulsar-admin --admin-url http://pulsar-b:8080 topics grant-permission persistent://shop/orders/paid --role analytics --actions consume
pulsar-admin --admin-url http://pulsar-b:8080 tenants update shop --admin-roles shop-admin,platform --allowed-clusters standalone

Sync

Terminal window
kurkik conn add pulsar a --admin-url http://pulsar-a:8080 --service-url pulsar://pulsar-a:6650 --client 4.0
kurkik conn add pulsar b --admin-url http://pulsar-b:8080 --service-url pulsar://pulsar-b:6650 --client 4.0
kurkik pulsar export a --this-cluster-only --acls --consumers --stdout > a.yaml # source.yaml (and b's, before: target.yaml)
kurkik pulsar sync a.yaml b --acls --dry-run # plan-without.txt
kurkik pulsar sync a.yaml b --acls --overwrite --revoke --dry-run # plan.txt (and -o json: plan.json)
kurkik pulsar sync a.yaml b --acls --overwrite --revoke --yes # apply.txt, and the reverse patch: rollback.yaml
kurkik pulsar diff a.yaml b --acls # after.txt
kurkik pulsar sync revert ~/.local/state/kurkik/sync/b/b-<time>.snapshot.yaml b --force --yes # revert.txt

Same plan.

How to build this setup yourself

Clusters

Pulsar a

Terminal window
pulsar-admin --admin-url http://pulsar-a:8080 tenants create shop --allowed-clusters standalone --admin-roles shop-admin
pulsar-admin --admin-url http://pulsar-a:8080 namespaces create shop/orders --clusters standalone
pulsar-admin --admin-url http://pulsar-a:8080 topics create persistent://shop/orders/created
pulsar-admin --admin-url http://pulsar-a:8080 topics create-partitioned-topic persistent://shop/orders/paid --partitions 2
pulsar-admin --admin-url http://pulsar-a:8080 namespaces grant-permission shop/orders --role billing --actions consume
pulsar-admin --admin-url http://pulsar-a:8080 namespaces grant-permission shop/orders --role checkout --actions produce
pulsar-admin --admin-url http://pulsar-a:8080 topics grant-permission persistent://shop/orders/created --role audit --actions consume
pulsar-admin --admin-url http://pulsar-a:8080 namespaces grant-permission shop/orders --role ops --actions functions,sources,sinks

Pulsar b

Terminal window
pulsar-admin --admin-url http://pulsar-b:8080 tenants create shop --allowed-clusters standalone --admin-roles shop-admin
pulsar-admin --admin-url http://pulsar-b:8080 namespaces create shop/orders --clusters standalone
pulsar-admin --admin-url http://pulsar-b:8080 topics create persistent://shop/orders/created
pulsar-admin --admin-url http://pulsar-b:8080 topics create-partitioned-topic persistent://shop/orders/paid --partitions 2
pulsar-admin --admin-url http://pulsar-b:8080 namespaces grant-permission shop/orders --role billing --actions consume,produce
pulsar-admin --admin-url http://pulsar-b:8080 namespaces grant-permission shop/orders --role checkout --actions produce
pulsar-admin --admin-url http://pulsar-b:8080 topics grant-permission persistent://shop/orders/paid --role analytics --actions consume
pulsar-admin --admin-url http://pulsar-b:8080 tenants update shop --admin-roles shop-admin,platform --allowed-clusters standalone

Sync

Terminal window
kurkik conn add pulsar a --admin-url http://pulsar-a:8080 --service-url pulsar://pulsar-a:6650 --client 4.0
kurkik conn add pulsar b --admin-url http://pulsar-b:8080 --service-url pulsar://pulsar-b:6650 --client 4.0
kurkik pulsar export a --this-cluster-only --acls --consumers --stdout > a.yaml # source.yaml (and b's, before: target.yaml)
kurkik pulsar sync a.yaml b --acls --dry-run # plan-without.txt
kurkik pulsar sync a.yaml b --acls --overwrite --revoke --dry-run # plan.txt (and -o json: plan.json)
kurkik pulsar sync a.yaml b --acls --overwrite --revoke --yes # apply.txt, and the reverse patch: rollback.yaml
kurkik pulsar diff a.yaml b --acls # after.txt
kurkik pulsar sync revert ~/.local/state/kurkik/sync/b/b-<time>.snapshot.yaml b --force --yes # revert.txt

All flags: kurkik pulsar sync · more Apache Pulsar sync examples