- StreamNative Cloud
- Use
Work with instances
A Pulsar instance is a group of clusters that acts together as a single unit.
Work with instances through snctl
In this section, we named the organization matrix
for an example.
Create an instance through snctl
To create an instance through snctl, follow these steps.
Define an instance named
neo
by using a manifest file and save the manifest fileinstance-neo.yaml
.This example shows how to create an instance on GCP.
apiVersion: cloud.streamnative.io/v1alpha1 kind: PulsarInstance metadata: namespace: matrix name: neo spec: availabilityMode: zonal poolRef: namespace: streamnative name: shared
This example shows how to create an instance on AWS.
apiVersion: cloud.streamnative.io/v1alpha1 kind: PulsarInstance metadata: namespace: matrix name: neo spec: availabilityMode: zonal poolRef: namespace: streamnative name: shared-aws
The following table lists fields in the manifest file.
Field Description apiVersion Specify the version of Pulsar API server. kind Specify the component to be created. metadata Configure the metadata information about the Pulsar instance.
-namespace: specify the name of the organization.
-name: specify the name of the Pulsar instance.spec Configure the specifications about the Pulsar instance.
-availabilityMode
: specify the availability mode of the Pulsar instance. You can set the parameter tozonal
orregional
. By default, it is set tozonal
.
-poolRef
: an abstract definition of the compute, storage, and networking needed to host Pulsar instances. It is set toshared
for instances hosted on GCP and is set toshared-aws
for instances hosted on AWS.Apply the manifest file to create the instance.
snctl apply -f /path/to/instance-neo.yaml
Check whether the instance is created successfully. This example shows whether the instance is successfully created on AWS.
snctl describe pulsarinstance neo
Output
Name: neo Namespace: matrix Labels: <none> Annotations: <none> API Version: cloud.streamnative.io/v1alpha1 Kind: PulsarInstance Metadata: Creation Timestamp: 2020-08-11T07:37:49Z Finalizers: pulsarinstance.finalizers.cloud.streamnative.io Generation: 1 Resource Version: 367947 Self Link: /apis/cloud.streamnative.io/v1alpha1/namespaces/matrix/pulsarinstances/neo UID: 53f2958d-c7c9-4628-9290-a34e36cdca3b Spec: Availability Mode: zonal poolRef: namespace: streamnative name: shared-aws Status: Auth: oauth2: Audience: urn:sn:pulsar:test:test Issuer URL: https://auth.streamnative.cloud Type: oauth2 Conditions: Last Transition Time: 2020-08-11T07:38:00Z Status: True Type: SubscriptionReady Last Transition Time: 2020-08-11T07:37:51Z Reason: Created Status: True Type: ResourceServerReady Last Transition Time: 2020-08-11T07:37:51Z Reason: Created Status: True Type: ServiceAccountReady Last Transition Time: 2020-08-11T07:38:01Z Reason: AllConditionStatusTrue Status: True Type: Ready Events: <none>
From the outputs, you can see that the
status
andtype
parameters for items underConditions
are set totrue
andready
. This means that the instanceneo
is created successfully.
In addition, you can use the snctl create pulsarinstance PULSAR_INSTANCE_NAME
command to create an instance. For details, see snctl reference.
Check the instance through snctl
You can use the following command to list all created instances.
snctl get pulsarinstance
Output
NAME CREATED AT
instance-test 2020-08-13T14:14:43Z
neo 2020-08-11T07:37:49Z
test-orga-a 2020-08-12T05:32:33Z
From the output of this command, you can see all created instances and the time when these instances were created.
Check instance details through snctl
Before checking details about an instance, you should use the following command to confirm whether the target instance is available.
snctl get pulsarinstance
Then, you can use the following command to check details about a specific instance.
snctl describe pulsarinstance PULSAR_INSTANCE_NAME
The following example checks details about the instance neo
.
snctl describe pulsarinstance neo
Output
Name: neo
Namespace: matrix
Labels: <none>
Annotations: <none>
API Version: cloud.streamnative.io/v1alpha1
Kind: PulsarInstance
Metadata:
Creation Timestamp: 2020-08-11T07:37:49Z
Finalizers:
pulsarinstance.finalizers.cloud.streamnative.io
Generation: 1
Resource Version: 367947
Self Link: /apis/cloud.streamnative.io/v1alpha1/namespaces/matrix/pulsarinstances/neo
UID: 53f2958d-c7c9-4628-9290-a34e36cdca3b
Spec:
Availability Mode: zonal
Status:
Auth:
oauth2:
Audience: urn:sn:pulsar:test:test
Issuer URL: https://auth.streamnative.cloud
Type: oauth2
Conditions:
Last Transition Time: 2020-08-11T07:38:00Z
Status: True
Type: SubscriptionReady
Last Transition Time: 2020-08-11T07:37:51Z
Reason: Created
Status: True
Type: ResourceServerReady
Last Transition Time: 2020-08-11T07:37:51Z
Reason: Created
Status: True
Type: ServiceAccountReady
Last Transition Time: 2020-08-11T07:38:01Z
Reason: AllConditionStatusTrue
Status: True
Type: Ready
Events: <none>
Delete an instance through snctl
You cannot delete an instance if there are resources associated with the instance.
You can use the following command to delete a specific instance based on the instance name.
snctl delete pulsarinstance PULSAR_INSTANCE_NAME
In addition, you can use the following command to delete a instance based on the type and name specified in the manifest file.
snctl delete -f ./instance-neo.yaml
Work with instances through StreamNative Cloud Console
This section describes how to work with instances through the StreamNative Cloud Console.
Create an instance through StreamNative Cloud Console
After creating an organization, you can create one or more instances for the organization.
To create an instance, follow these steps.
Click the organization that you want create an instance for, and then click create instance.
Click CREATE INSTANCE on the Instances page.
Click Deploy Hosted to start the instance creation process.
Configure the instance, as outlined in the following table and then click Continue.
Item Description Instance Name Enter a name for the instance. An instance name can contain any combination of lowercase letters (a-z), numbers (0-9), and hyphens (-). Infrastructure Select an infrastructure pool. The infrastructure pool affects the configuration options for the cluster, network latency for clients accessing the cluster, the geographic location of the nodes in the cluster, and the cost of the running cluster. Currently, Google Cloud and AWS cloud platform are available.
If you subscribed to the StreamNative Cloud service through AWS Marketplace, only AWS cloud provider is available.Availability Zones (AZ) Select a deployment mode.
-Single AZ: deploy the instance on a single Availability Zone (AZ).
- Multi AZ: deploy the instance on a Multi-AZ.In the Create Payment Method box, enter a valid credit card number, and then click Create Payment Method.
Click Continue.
You should continue your setup by creating a cluster. See work with clusters for more information.
Check the instance through StreamNative Cloud Console
To check instances created for an organization, follow these steps.
In the upper-right corner of the StreamNative Cloud Console, click your Profile and select Switch Organization.
Click the name of the organization you want to check and then click List instances to list all the instances available for the organization. You can also view detailed information about the instances, including clusters for the instance, instance status, instance name, cloud provider, availability zone, and instance type.
In addition, you can perform the following operations on this page.
Add more instances: click CREATE INSTANCE and go through steps for creating an instance. For details about how to create an instance, see create instance.
Search an instance: enter the instance name in the Search Instances field and press Enter (only available for existing instances).
Delete an instance: click the ellipsis at the end of the row of the instance that you want to delete, and then click Delete. A dialog box displays asking, Are you sure you want to delete this? Enter the instance name and then click Confirm.
You cannot delete an instance if there are resources associated with the instance.