pulsarctl, enables developers to administer resources in a Pulsar cluster. The tool is open-sourced under Apache License v2.0.
Prerequisties
Before moving on to the subsequent steps, ensure you review the following requirements.Operating systems
Thepulsarctl is compatible with the following operating systems and architectures only:
- macOS with 64-bit Intel chips (Darwin AMD64)
- macOS with Apple chips (Darwin ARM64)
- Windows with 64-bit Intel or AMD chips (Microsoft Windows AMD64)
- Linux with 64-bit Intel or AMD chips (Linux AMD64)
- Linux with 64-bit ARM chips (Linux ARM64)
Network access
When thepulsarctl interacts with a Pulsar cluster, it requires network access to its admin service url (i.e., https://pulsar-cluster-domain-name).
Install pulsarctl
This section describes how to installpulsarctl on Linux, MAC, and Windows Operating System (OS).
- Linux
- Mac
- Windows
-
Use this command to install
pulsarctlon the Linux operation system. -
Check whether
pulsarctlis installed successfully.
Configure pulsarctl
This section describes how to configurepulsarctl.
Configure pulsarctl for a StreamNative Cloud cluster
You can usesnctl to configure a context for pulsarctl to be used in a StreamNative Cloud cluster.
- Initialize
snctlconfiguration. - Sign in to an organization.
- Use
snctl x update-pulsar-config --cluster-nameto add a given cluster as a context topulsarctl. - Verify that the current context has been changed to
<cluster-name>. - After verifying that the cluster has been added to
pulsarctlcontexts, you can usepulsarctlto interact with the target cluster.
Configure pulsarctl for a Pulsar cluster
You can configure pulsarctl for a Pulsar cluster with different authentication mechanisms.- OAuth2
- API Key
- mTLS
You can use the following command to configure pulsarctl for a Pulsar cluster that is configured with OAuth2 authentication.Notes: Please replace the following variables before using the command.
<CONTEXT_NAME>: The name is used for identifying the cluster.<PULSAR_ADMIN_SERVICE_URL>: The admin service url of the cluster to connect.<OAUTH 2.0 ISSUER ENDPOINT>: The OAuth 2.0 issuer endpoint for the client to connect to./path/to/credentials.json: The private key credentials file to use.<AUDIENCE>: The audience to use for OAuth 2.0 authentication.