Using kubetcl to provision an Astra DBDatabase

The Open Service Broker API provides a standard RESTful interface for provisioning services from a provided catalog, such as Astra DBdatabases.

The Astra Service Broker supports only Kubernetes v1.13 and later.

Prerequisites

Provision your database using kubectl

  1. Create a file called astra.yaml to describe the type of instance you need:

    apiVersion: servicecatalog.k8s.io/v1beta1
    kind: ServiceInstance
    metadata:
      name: <db_name>
      namespace: default
    spec:
      parameters:
        capacity_units: 1
        cloud_provider: <cloud_provider>
        keyspace: <keyspace_name>
        region: <region>
      serviceClassExternalName: astra-database
      servicePlanExternalName: <plan_option>
  2. Apply the astra.yaml file to provision your database:

kubectl apply -f astra.yaml

The time required to provision a database depends on the selected plan. It can take several minutes to provision your database.

Check your instance status

The service catalog handles the provisioning and communication with Astra. After a few minutes, check the instance status:

kubectl get serviceinstances <db_name>

You will see the following results:

NAME    CLASS                                               PLAN                                STATUS   AGE
<db_name>   ServiceClass/26b3fbe6-0c18-5140-8ac6-87d03b5b4148   1c9bb5ac-6609-5af5-a747-ecf1d093cc7f   Ready    3m20s

Try it out

Get your secure connect bundle from the Connect page for your Astra DBdatabase. This is the information you need to configure the driver. You can see this example in the Spring Reactive Pet Clinic sample app.