Manage Astra Data Store resources with kubectl commands

Contributors amgrissino netapp-mwallis netapp-dbagwell

You can manage Astra Data Store resources by using kubectl commands and by using the Kubernetes API extension.

To learn how to deploy a sample app, see Deploy a test application.

For cluster maintenance information, see Manage the cluster.

What you’ll need

List Kubernetes custom API resources for Astra Data Store

You can use kubectl commands inside of Kubernetes to interact with and observe the state of your Astra Data Store cluster.

Each item listed from the api-resources command represents a Kubernetes custom resource definition (CRD) that Astra Data Store uses internally to manage your cluster.

This list is particularly helpful to get short names of each Astra Data Store object to reduce your typing, as shown later.

  1. Display a list of Kubernetes custom API resources for Astra Data Store:

    kubectl api-resources --api-group


    NAME                   SHORTNAMES  APIGROUP            NAMESPACED  KIND
    astradsautosupports    adsas true   AstraDSAutoSupport
    astradscloudsnapshots  adscs true   AstraDSCloudSnapshot
    astradsclusters        adscl true   AstraDSCluster
    astradsexportpolicies  adsep true   AstraDSExportPolicy
    astradsfaileddrives    adsfd true   AstraDSFailedDrive
    astradslicenses        adsli true   AstraDSLicense
    astradsnfsoptions      adsnf true   AstraDSNfsOption
    astradsnodeinfoes      adsni true   AstraDSNodeInfo
    astradsnodemanagements adsnm true   AstraDSNodeManagement
    astradsqospolicies     adsqp true   AstraDSQosPolicy
    astradsversions        adsve true   AstraDSVersion
    astradsvolumefiles     adsvf true   AstraDSVolumeFiles
    astradsvolumes         adsvo true   AstraDSVolume
    astradsvolumesnapshots adsvs true   AstraDSVolumeSnapshot
  2. To get all the current Astra Data Store objects in your Kubernetes cluster, use the kubectl get ads -A command:

    kubectl get ads -A


    NAMESPACE        NAME                                        AGE
    astrads-system   45h
    astrads-system     45h
    astrads-system   45h
    NAMESPACE        NAME                                                   STATUS    VERSION       SERIAL NUMBER   MVIP           AGE
    astrads-system   created   arda-9.11.1   e000000009   46h
    NAMESPACE        NAME                                                  AGE
    astrads-system   46h
    astrads-system   46h
    astrads-system   46h
    astrads-system   46h
    NAMESPACE        NAME                                              AGE
    astrads-system   46h
    NAMESPACE        NAME                                            AGE
    astrads-system     27h
    astrads-system    27h
    astrads-system   4h22m
    NAMESPACE        NAME                                       SIZE   IP               CLUSTER             CREATED
    astrads-system    21Gi   astrads-cluster-9f1  true
    astrads-system   21Gi   astrads-cluster-9f1  true
    NAMESPACE        NAME                                                                                SEQUENCE COMPONENT      EVENT                   TRIGGER   PRIORITY  SIZE   STATE
    astrads-system 9        controlplane   adsclustercreatesuccess k8sEvent  notice    0      uploaded
    astrads-system                  15       controlplane   daily                   periodic  notice    0      uploaded
    astrads-system                  20       controlplane   daily                   periodic  notice    0      uploaded
    astrads-system 10      storage        callhome.dbs.cluster.cannot.sync.blocks   firetapEvent   emergency   0      uploaded
    NAMESPACE        NAME                                  ADSCLUSTER          VALID PRODUCT          EVALUATION ENDDATE    VALIDATED
    astrads-system   astrads-cluster-9f1 true  Astra Data Store true       2022-02-07 2021-12-16T20:43:23Z
  3. Use one of the short names to show the current state of volumes in the cluster:

    kubectl get adsvo -A


    NAMESPACE        NAME       SIZE   IP               CLUSTER                   CREATED
    astrads-system   test234    21Gi   astrads-cluster-9f1c99f   true
    astrads-system   test2345   21Gi   astrads-cluster-9f1c99f   true

Use the help option on the kubectl extension

NetApp provides an astrads extension to the kubectl command that enables you to perform Astra Data Store cluster management tasks such as adding a license, managing nodes, troubleshooting issues and expanding the Astra Data Store cluster. The astrads extension includes an -h option that provides information about how to use the extension and for what tasks.

  1. Show help for all commands in the Astra Data Store kubectl extension:

    kubectl astrads -h


    A kubectl plugin for inspecting your AstraDS deployment
      astrads [command]
    Available Commands:
      asup        Manage AutoSupport
      clusters    Manage clusters
      drives      Manage drives in a cluster
      faileddrive Manage drive replacement in a cluster
      help        Help about any command
      license     Manage license in the astrads cluster
      maintenance Manage maintenance status of a node
      monitoring  Manage Monitoring Output
      nodes       Manage nodes in a cluster
          --as string                      Username to impersonate for the operation
          --as-group stringArray           Group to impersonate for the operation, this flag can be
                                             repeated to specify multiple groups.
          --cache-dir string               Default HTTP cache directory
                                             (default "/u/arda/.kube/http-cache")
          --certificate-authority string   Path to a cert file for the certificate authority
          --client-certificate string      Path to a client certificate file for TLS
          --client-key string              Path to a client key file for TLS
          --cluster string                 The name of the kubeconfig cluster to use
          --context string                 The name of the kubeconfig context to use
      -h, --help                           help for astrads
            --insecure-skip-tls-verify       If true, the server's certificate will not be checked
                                             for validity. This will make your HTTPS connections insecure
            --kubeconfig string              Path to the kubeconfig file to use for CLI requests.
        -n, --namespace string               If present, the namespace scope for this CLI request
            --request-timeout string         The length of time to wait before giving up on a single
                                             server request. Non-zero values should contain a
                                             corresponding time unit (e.g. 1s, 2m, 3h).
                                             A value of zero means don't timeout requests.
                                             (default "0")
        -s, --server string                  The address and port of the Kubernetes API server
            --token string                   Bearer token for authentication to the API server
            --user string                    The name of the kubeconfig user to use
  2. Use astrads [command] --help for more information about a command.

    kubectl astrads asup collect --help


      Collect the autosupport bundle by specifying the component to collect. It will default to manual event.
        astrads asup collect [flags]
        # Control plane collection
          kubectl astrads collect --component controlplane example1
          # Storage collection for single node
          kubectl astrads collect --component storage --nodes node1 example2
          # Storage collection for all nodes
          kubectl astrads collect --component storage --nodes all example3
          # Collect but don't upload to support
          kubectl astrads collect --component controlplane --local example4
          --component storage and --nodes <name> are mutually inclusive.
          --component controlplane and --nodes <name> are mutually exclusive.
          -c, --component string     Specify the component to collect: [storage , controlplane , vasaprovider, all]
          -d, --duration int         Duration is the duration in hours from the startTime for collection
                                       of AutoSupport.
                                       This should be a positive integer
          -e, --event string         Specify the callhome event to trigger. (default "manual")
          -f, --forceUpload          Configure an AutoSupport to upload if it is in the compressed state
                                       and not
                                       uploading because it was created with the 'local' option or if
                                       automatic uploads of AutoSupports is disabled
                                       at the cluster level.
          -h, --help                 help for collect
          -l, --local                Only collect and compress the autosupport bundle. Do not upload
                                       to support.
                                       Use 'download' to copy the collected bundle after it is in
                                       the 'compressed' state
               --nodes string          Specify nodes to collect for storage component. (default "all")
          -t, --startTime string     StartTime is the starting time for collection of AutoSupport.
                                       This should be in the ISO 8601 date time format.
                                       Example format accepted:
                                       2021-01-01T15:20:25Z, 2021-01-01T15:20:25-05:00
          -u, --usermessage string   UserMessage is the additional message to include in the
                                       AutoSupport subject.
                                       (default "Manual event trigger from CLI")