snctl
. This overview includes how to install and configure snctl
, covers snctl
syntax, describes the command operations, and provides common examples. For details about each command, including all the supported flags and subcommands, see the snctl reference documentation.
snctl pulsar
subcommands, the flags --namespace
(-n
) were updated to --organization
(-O
) beginning in snctl v1.0.0.api.streamnative.cloud
auth.streamnative.cloud
log.streamnative.cloud
curl
command or use Homebrew to install snctl on Linux.-v
or --version
to specify the version. For example, you can use the following command to download snctl v1.0.0
.
snctl
v0.x.x
to v1.x.x
, please run snctl config init
again to ensure all newly introduced configuration settings are applied to your local configuration file.snctl
.
snctl
, you need to configure snctl
. You can either use the snctl config init
command to initialize snctl with default configurations or you can use the snctl config set
command to update the .snctl/config
snctl configuration file.
.snctl/config
file contains configurations about snctl, including OAuth2 configurations, service URL for the StreamNative Cloud API, and so on. You can use the snctl config set
command to set snctl configurations.
This example sets a target organization as the default organization. Consequently, in this organization, you can perform other operations on StreamNative Cloud resources without specifying the organization name every time.
organization
option, you need to use the organization id, not the descriptive organization name. To find the organization id, see Cloud Organization ID.snctl
commands. You can sign in either as a specific user or as a service account.
snctl
is given a token to impersonate the user.snctl
, you need to set up a subscription to StreamNative Cloud. If you have a legacy cluster, submit a ticket to get assistance with moving your cluster to the updated subscription plan.
snctl create subscription
command is available for snctl
version 0.14.1
and above.snctl
does not support setting up a payment method. You can add a payment method for your organization through StreamNative Cloud Console. For details, see manage billing using StreamNative Cloud Console.snctl create subscription
command to create a subscription.
--offer-type
: the offer type. Two options are available:
private
: the private offer that is made to a specific customer. It is a commitment to a minimum amount of spend over a specified time period.public
: the public offer that anyone may subscribe to through StreamNative or Marketplace channels. It is a Pay-As-You-Go subscription with usage-based pricing.--offer
: the offer name.
SN2_OD_HOSTED_CLOUD
) that snctl
uses by default..snctl/config
file. Therefore, you do not need to use the --organization <organization_name>
flag to specify the target organization every time when executing snctl
commands. For details about how to set snctl configurations, see set snctl configuration.neo
.
This example shows how to create the neo
instance on the AWS cloud platform. To create a Pulsar instance on Google Cloud, set the infrastructure pool name to streamnative/shared
. To create a BYOC instance/cluster, the StreamNative team needs to provision an infrastructure pool in your cloud account before you can use it.
streamnative/shared-aws
.
spec.locations
section of the output.
neo-1
, consisting of 2 brokers, each using 0.5 CU, and 3 bookies, each using 0.5 SU, to be deployed in us-east-1
.
snctl
version 0.15.0
and above.snctl describe pulsarcluster <cluster_name>
command to get details of a Pulsar cluster.
This example gets details of the neo-1
cluster.
status
and type
parameters for items under Conditions
are set to true
and ready
respectively. This means that the neo-1
cluster is created successfully.
v1.0.0
, snctl
introduces the concept of a Service Context. This feature aims to make snctl
a unified tool not only for managing StreamNative Cloud resources (like creating and managing clusters) but also for directly interacting with the data plane of your Pulsar clusters using both the native Pulsar protocol and the Kafka protocol (via KSN or Ursa Engine).
A Service Context is essentially a named configuration profile stored within your snctl
configuration (~/.snctl/config
). It bundles the necessary connection details —- primarily the service URL and authentication information —- required to connect to a specific Pulsar cluster managed by StreamNative Cloud.
Automatic Context Discovery
Typically, you don’t need to manually create contexts for your StreamNative Cloud Pulsar clusters. After successfully logging in using snctl auth login
, snctl
can often automatically detect the Pulsar clusters you have access to within your organization. It makes these clusters available as selectable contexts, usually using the instance name and cluster name as the context.
(Note: For managing contexts related to external, non-StreamNative Cloud clusters, see commands like snctl context add-external-context
, snctl context list-external-context
, etc.)
Switching and Using Contexts
To interact with a specific cluster using snctl pulsar
or snctl kafka
commands, you first need to activate its corresponding context.
snctl context use
command, will likely prompt you to choose from a list of all available Pulsar Instances and Pulsar Clusters, select the target cluster by keyboard, and additional authentication may required if no valid token cached.
snctl pulsar client ...
, snctl pulsar admin ...
, snctl kafka client ...
, and snctl kafka admin ...
commands will automatically use the connection details (service URL, authentication) defined in that active context. You no longer need to specify connection flags repeatedly for these commands.
Running commands by using specific Service Account
While the active context usually derives its authentication from your user login (snctl auth login
), you can override this for individual command executions to run as a specific service account. This is useful for automation or when specific permissions granted to a service account are needed. Another use case is to submit Pulsar Functions, Pulsar IO Connectors, and Kafka Connect connectors in StreamNative Cloud, this will makes the submitted instances running under given permission by the service account.
Crucially, snctl
will verify if your currently logged-in user account has the necessary permissions to impersonate the chosen service account before executing the command.
--as-service-account
flag followed by the service account name. snctl
will use the credentials associated with this service account for the command.
--use-service-account
flag without specifying a name. snctl
will likely prompt you to choose from a list of available service accounts you have access to. This will shows you the details of each Service Account, as well as the status of each Service Account Binding, which is useful on manage Pulsar Functions, Pulsar IO Connectors, and Kafka Connect connectors.
pulsarctl
Configuration:
This Service Context mechanism is internal to snctl
for unifying its own commands. It is distinct from the snctl x update-pulsar-config
command (described later). The update-pulsar-config
command is specifically designed to configure the separate pulsarctl
tool, allowing it to connect to your StreamNative Cloud cluster. The snctl context
commands enable snctl
itself to perform data plane operations directly via its pulsar
and kafka
subcommands.
pulsarctl
CLI tool. To get details about the access and managing Apache Pulsar resources through pulsarctl
, see pulsarctl
command reference.
pulsarctl context get
command to set the context (cluster) in advance.neo-1
cluster to the Pulsar client configuration file.
Input
pulsarctl
CLI tool to interact with the target cluster. For details, see the pulsarctl reference docs. To work with tenants, namespaces, and topics, you can use the StreamNative Cloud Console. snctl does not currently support working with these features.