This section contains the most basic commands for getting a workload running on your cluster.
Create a cluster using the data in cluster.json.
snctl create -f ./cluster.json
Create a cluster based on the JSON passed to stdin.
cat cluster.json | snctl create -f -
Edit the data in cluster.yaml in JSON and then create the resource using the edited data.
snctl create -f cluster.yaml --edit -o json
Create a resource from a file or from stdin.
JSON and YAML formats are accepted.
$ create -f FILENAME
Name | Shorthand | Default | Usage |
---|---|---|---|
allow-missing-template-keys | true | If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats. | |
dry-run | false | If true, only print the object that would be sent, without sending it. | |
edit | false | Edit the API resource before creating. | |
field-manager | snctl-create | Name of the manager used to track field ownership. | |
filename | f | [] | Filename, directory, or URL to files to use to create the resource |
kustomize | k | Process the kustomization directory. This flag can't be used together with -f or -R. | |
output | o | Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file. | |
raw | Raw URI to POST to the server. Use the transport specified by the config file. | ||
record | false | Record current kubectl command in the resource annotation. If set to false, do not record the command. If set to true, record the command. If not set, default to updating the existing annotation value only if one already exists. | |
recursive | R | false | Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory. |
save-config | false | If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future. | |
selector | l | Selector (label query) to filter on, supporting '=', '==', and '!='.(e.g. -l key1=value1,key2=value2). | |
template | Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview]. | ||
validate | true | If true, use a schema to validate the input before sending it | |
windows-line-endings | false | Only relevant if --edit=true. Defaults to the line ending native to your platform. |
Create a Flink cluster associated with a Pulsar instance with the specified node type and location.
snctl create flinkcluster FLINK_CLUSTER_NAME --instance-name INSTANCE_NAME --node-type NODE_TYPE --location LOCATION
Create a Flink cluster.
$ flinkcluster [NAME]
Name | Shorthand | Default | Usage |
---|---|---|---|
allow-missing-template-keys | true | If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats. | |
dry-run | false | If true, only print the object that would be sent, without sending it. | |
field-manager | snctl-create | Name of the manager used to track field ownership. | |
instance-name | The name of the pulsar instance | ||
location | The location to deploy the cluster | ||
node-type | tiny-1 | The node type to use | |
output | o | Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file. | |
replicas | 1 | The number of Flink task managers to deploy | |
template | Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview]. |
Create a Pulsar cluster in a Pulsar instance with the specified node type and location.
snctl create pulsarcluster PULSAR_CLUSTER_NAME --instance-name INSTANCE-NAME --node-type NODE_TYPE --location LOCATION
Create a Pulsar cluster.
$ pulsarcluster [NAME]
Name | Shorthand | Default | Usage |
---|---|---|---|
allow-missing-template-keys | true | If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats. | |
bookie-replicas | 3 | the replicas of the bookkeeper | |
broker-replicas | 2 | the replicas of the broker | |
dry-run | false | If true, only print the object that would be sent, without sending it. | |
field-manager | snctl-create | Name of the manager used to track field ownership. | |
instance-name | The name of the pulsar instance. | ||
location | The location to deploy the cluster. | ||
node-type | the node type | ||
output | o | Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file. | |
template | Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview]. |
Create a zonal Pulsar instance.
snctl create pulsarinstance PULSAR_INSTANCE_NAME
Create a regional Pulsar instance.
snctl create pulsarinstance PULSAR_INSTANCE_NAME --availability-mode regional
Create a free Pulsar instance.
snctl create pulsarinstance PULSAR_INSTANCE_NAME --pool POOL_NAME --instance-plan free
Create a Pulsar instance on a named infrastructure pool.
snctl create pulsarinstance PULSAR_INSTANCE_NAME --pool streamnative/shared-aws
Create a Pulsar instance with the specific name.
$ pulsarinstance [NAME]
Name | Shorthand | Default | Usage |
---|---|---|---|
allow-missing-template-keys | true | If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats. | |
availability-mode | zonal | The availability mode, supporting 'zonal' and 'regional'. By default, it is 'zonal'. | |
dry-run | false | If true, only print the object that would be sent, without sending it. | |
field-manager | snctl-create | Name of the manager used to track field ownership. | |
instance-plan | standard | The plan type of this instance, can be either free or standard. | |
output | o | Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file. | |
pool | The infrastructure pool to use. By default, a pool is selected automatically. | ||
template | Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview]. |
Create a role binding for a service account
snctl create rolebinding ROLE_BINDING_NAME --role admin --serviceaccount SERVICE_ACCOUNT_NAME
Create a role binding for a user or service account.
$ rolebinding [NAME]
Name | Shorthand | Default | Usage |
---|---|---|---|
allow-missing-template-keys | true | If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats. | |
dry-run | false | If true, only print the object that would be sent, without sending it. | |
field-manager | snctl-create | Name of the manager used to track field ownership. | |
output | o | Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file. | |
role | The role bound to the user or service account. | ||
serviceaccount | [] | service account(s) to which the role is bound. | |
template | Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview]. | ||
user | [] | User(s) to which the role is bound. |
Create a service account with the specified name.
snctl create serviceaccount SERVICE_ACCOUNT_NAME
Create a service account with the given file.
snctl create serviceaccount -f serviceaccount.yaml
Create a service account.
$ serviceaccount [NAME]
Name | Shorthand | Default | Usage |
---|---|---|---|
allow-missing-template-keys | true | If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats. | |
dry-run | false | If true, only print the object that would be sent, without sending it. | |
field-manager | snctl-create | Name of the manager used to track field ownership. | |
output | o | Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file. | |
template | Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview]. |
snctl create user USER_NAME --email USER_EMAIL
Create a user resource to register a user as a member of an organization.
$ user [NAME]
Name | Shorthand | Default | Usage |
---|---|---|---|
allow-missing-template-keys | true | If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats. | |
dry-run | false | If true, only print the object that would be sent, without sending it. | |
Email address of the user. | |||
field-manager | snctl-create | Name of the manager used to track field ownership. | |
output | o | Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file. | |
template | Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview]. |
Apply the configuration in pulsarcluster.yaml to a pulsarcluster.
snctl apply -f ./pulsarcluster.yaml
Apply a configuration to a resource by the filename or stdin. The resource name must be specified. This resource will be created if it does not exist yet.
JSON and YAML formats are accepted.
$ apply (-f FILENAME | -k DIRECTORY)
Name | Shorthand | Default | Usage |
---|---|---|---|
filename | f | [] | that contains the configuration to apply |
Print the detailed description of the Pulsar cluster
snctl describe pulsarcluster PULSAR_CLUSTER_NAME
Show details of a specific resource.
$ describe (-f FILENAME | TYPE [NAME_PREFIX | -l label] | TYPE/NAME)
$ auth
Activate a service account by supplying a key file.
snctl auth activate-service-account --key-file serviceaccount.json
Activate a service account by supplying its credentials.
$ activate-service-account
Name | Shorthand | Default | Usage |
---|---|---|---|
key-file | f | Path to the private key file. |
Export a service account to a file.
snctl auth export-service-account SERVICE_ACCOUNT_NAME --key-file serviceaccount.json
Export the service account credentials.
$ export-service-account [NAME]
Name | Shorthand | Default | Usage |
---|---|---|---|
key-file | f | Path to the private key file. | |
no-wait | false | Skip waiting for service account readiness. |
Get the pulsar instance access token with the login user.
snctl auth get-token PULSAR_INSTANCE_NAME --login
Get an access token for a Pulsar instance.
$ get-token [INSTANCE]
Name | Shorthand | Default | Usage |
---|---|---|---|
key-file | f | Path to the private key file | |
login | false | Adopt an interactive login. | |
skip-open | false | The Web browser are not opened automatically. |
Log in to the StreamNative Cloud.
snctl auth login
Log in to the StreamNative Cloud and skip opening the login window.
snctl auth login --skip-open
Authorize the tool to operate on behalf of a user.
$ login
Name | Shorthand | Default | Usage |
---|---|---|---|
no-refresh | false | The refresh tokens cannot be used. | |
skip-open | false | The Web browser are not opened automatically. |
Log out from the current account and clear the activation.
snctl auth logout
$ logout
Display the name of login user or service account.
snctl auth whoami
Display the logged-in user or service account.
$ whoami
$ config
Initialize the StreamNative cloud CLI configuration with default settings.
snctl config init
$ init
Set the default namespace to be used in the CLI commands
snctl config set --namespace streamnative
$ set
Name | Shorthand | Default | Usage |
---|---|---|---|
audience | Set the OAuth 2.0 audience identifier for the StreamNative Cloud API. | ||
cacert | Set the CA certificate for StreamNative Cloud API (PEM, base64). | ||
client-id | Set the OAuth 2.0 client identifier for the StreamNative Cloud CLI. | ||
insecure-skip-tls-verify | true | Indicate whether to skip TLS verification. | |
issuer-endpoint | Set the OAuth 2.0 issuer endpoint. | ||
logs-cluster | Set the default cluster to be used in logs CLI commands. | ||
logs-instance | Set the default instance to be used in logs CLI commands. | ||
logs-service-url | Set the service URL to be used in logs CLI commands. | ||
server | s | Set the service URL for StreamNative Cloud API. |
Delete a Pulsar cluster using the type and name specified in the 'pulsarcluster.yaml' file.
snctl delete -f ./pulsarcluster.yaml
Delete a resource by the resource name. The following example deletes a Pulsar instance.
snctl delete pulsarinstance PULSAR_INSTANCE_NAME
Delete resources by filenames, stdin, resources and names.
$ delete ([-f FILENAME] | [-k DIRECTORY] | TYPE [(NAME | -l label | --all)])
Name | Shorthand | Default | Usage |
---|---|---|---|
all | false | Delete all resources, including uninitialized ones, in the namespace of the specified resource types. | |
all-namespaces | A | false | If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace. |
cascade | true | If true, cascade the deletion of the resources managed by this resource (e.g. Pods created by a ReplicationController). Default true. | |
dry-run | none | Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource. | |
field-selector | Selector (field query) to filter on, supports '=', '==', and '!='.(e.g. --field-selector key1=value1,key2=value2). The server only supports a limited number of field queries per type. | ||
filename | f | [] | containing the resource to delete. |
force | false | If true, immediately remove resources from API and bypass graceful deletion. Note that immediate deletion of some resources may result in inconsistency or data loss and requires confirmation. | |
grace-period | -1 | Period of time in seconds given to the resource to terminate gracefully. Ignored if negative. Set to 1 for immediate shutdown. Can only be set to 0 when --force is true (force deletion). | |
ignore-not-found | false | Treat "resource not found" as a successful delete. Defaults to "true" when --all is specified. | |
kustomize | k | Process a kustomization directory. This flag can't be used together with -f or -R. | |
now | false | If true, resources are signaled for immediate shutdown (same as --grace-period=1). | |
output | o | Output mode. Use "-o name" for shorter output (resource/name). | |
raw | Raw URI to DELETE to the server. Uses the transport specified by the kubeconfig file. | ||
recursive | R | false | Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory. |
selector | l | Selector (label query) to filter on, not including uninitialized ones. | |
timeout | 0s | The length of time to wait before giving up on a delete, zero means determine a timeout from the size of the object | |
wait | true | If true, wait for resources to be gone before returning. This waits for finalizers. |
Get all the created pulsar clusters.
snctl get pulsarcluster
Get all resources of the specified type.
$ get [(-o|--output=)json|yaml|wide|custom-columns=...|custom-columns-file=...|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=...] (TYPE[.VERSION][.GROUP] [NAME | -l label] | TYPE[.VERSION][.GROUP]/NAME ...) [flags]
Name | Shorthand | Default | Usage |
---|---|---|---|
all-namespaces | A | false | If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace. |
allow-missing-template-keys | true | If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats. | |
chunk-size | 500 | Return large lists in chunks rather than all at once. Pass 0 to disable. This flag is beta and may change in the future. | |
field-selector | Selector (field query) to filter on, supports '=', '==', and '!='.(e.g. --field-selector key1=value1,key2=value2). The server only supports a limited number of field queries per type. | ||
filename | f | [] | Filename, directory, or URL to files identifying the resource to get from a server. |
ignore-not-found | false | If the requested object does not exist the command will return exit code 0. | |
kustomize | k | Process the kustomization directory. This flag can't be used together with -f or -R. | |
label-columns | L | [] | Accepts a comma separated list of labels that are going to be presented as columns. Names are case-sensitive. You can also use multiple flag options like -L label1 -L label2... |
no-headers | false | When using the default or custom-column output format, don't print headers (default print headers). | |
output | o | Output format. One of: json|yaml|wide|name|custom-columns=...|custom-columns-file=...|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=... | |
output-watch-events | false | Output watch event objects when --watch or --watch-only is used. Existing objects are output as initial ADDED events. | |
raw | Raw URI to request from the server. Uses the transport specified by the kubeconfig file. | ||
recursive | R | false | Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory. |
selector | l | Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2) | |
server-print | true | If true, have the server return the appropriate table output. Supports extension APIs and CRDs. | |
show-kind | false | If present, list the resource type for the requested object(s). | |
show-labels | false | When printing, show all labels as the last column (default hide labels column) | |
sort-by | If non-empty, sort list types using this field specification. The field specification is expressed as a JSONPath expression (e.g. '{.metadata.name}'). The field in the API resource specified by this JSONPath expression must be an integer or a string. | ||
template | Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview]. | ||
watch | w | false | After listing/getting the requested object, watch for changes. Uninitialized objects are excluded if no object name is provided. |
watch-only | false | Watch for changes to the requested object(s), without listing/getting first. |
List all cloud API resources
snctl api-resource
Get all available API resources in snctl.
$ api-resources
Print the client and server versions for the current context
snctl version
Print the client and server version information.
$ version
Name | Shorthand | Default | Usage |
---|---|---|---|
client | false | Client version (No server version is required). | |
output | o | The output is in 'yaml' file or the 'json' format. | |
short | false | Print the version number only. |
$ x
Add a cluster to the Pulsar client configuration file.
snctl x update-pulsar-config --cluster-name <cluster>
$ update-pulsar-config
Name | Shorthand | Default | Usage |
---|---|---|---|
cluster-name | The name of the pulsar cluster. | ||
context-name | The name of the context to create. | ||
skip-use-context | false | If true, the current context is not changed. |
Display the logs of pulsar cluster
snctl logs \
-o organization \
-i instance \
-c cluster \
-p sink \
-f \
--since 10m \
--name logs \
--pulsar-tenant public \
--pulsar-namespace default \
--previous
Display the logs of pulsar cluster, the parameters service-url, organization, instance, cluster could be set by cmd snctl config set
, for example, set log service-url snctl config set --log-service-url http://localhost:8080
$ logs
Name | Shorthand | Default | Usage |
---|---|---|---|
cluster | c | Cluster Name | |
component | p | function | Name of function/sink/source |
follow | f | false | Continuous get logs without auto exit |
insecure-skip-tls-verify-backend | k | false | Skip verifying the identity. |
instance | i | Instance Name | |
name | Component Name | ||
organization | o | Organization Name | |
previous | false | Browse the log with mode previous | |
pulsar-namespace | Pulsar Namespace | ||
pulsar-tenant | Pulsar Tenant | ||
replica-id | r | -1 | See which replica of which function, sink, source |
service-url | u | Log Service URL | |
since | Since time of logs, numbers end with s|m|h, for example one hour ago: 1h | ||
size | s | 20 | Logs tail size |
timestamp | Start timestamp of logs, for example: 1662430984225 |