Set up Astra Data Store components

Contributors netapp-dbagwell amgrissino netapp-mwallis

After you have installed a standalone Astra Data Store and addressed some environmental prerequisites, you’ll install Astra Trident, configure Kubernetes snapshot capabilities, set up the storage backend, and create a default storage class:

Note If you are using Astra Control Center to deploy Astra Data Store, you do not need to follow these steps unless you intend to set up additional monitoring options.

Install Astra Trident

For Astra Data Store, you’ll need to install Astra Trident 21.10.1 or later. You can install Astra Trident using one of the following options:

Install Kubernetes snapshot CRDs and Controller

Kubernetes snapshot CRDs and controller are required to create persistent volume claim (PVC) snapshots. If you do not already have the CRD and controller installed for your environment, run the following commands to install them.

Note The following command examples assume /trident as the directory; however, the directory you use can be any directory that you used to download the YAML files.
What you’ll need
Steps
  1. Apply snapshot.storage.k8s.io_volumesnapshotclasses.yaml:

    kubectl apply -f trident/snapshot.storage.k8s.io_volumesnapshotclasses.yaml

    Response:

    customresourcedefinition.apiextensions.k8s.io/volumesnapshotclasses.snapshot.storage.k8s.io configured
  2. Apply snapshot.storage.k8s.io_volumesnapshotcontents.yaml:

    kubectl apply -f trident/snapshot.storage.k8s.io_volumesnapshotcontents.yaml

    Response:

    customresourcedefinition.apiextensions.k8s.io/volumesnapshotcontents.snapshot.storage.k8s.io configured
  3. Apply snapshot.storage.k8s.io_volumesnapshots.yaml:

    kubectl apply -f trident/snapshot.storage.k8s.io_volumesnapshots.yaml

    Response:

    customresourcedefinition.apiextensions.k8s.io/volumesnapshots.snapshot.storage.k8s.io configured
  4. Apply setup-snapshot-controller.yaml:

    kubectl apply -f trident/setup-snapshot-controller.yaml

    Response:

    deployment.apps/snapshot-controller configured
  5. Apply rbac-snapshot-controller.yaml:

    kubectl apply -f trident/rbac-snapshot-controller.yaml

    Response:

    serviceaccount/snapshot-controller configured
    clusterrole.rbac.authorization.k8s.io/snapshot-controller-runner configured
    clusterrolebinding.rbac.authorization.k8s.io/snapshot-controller-role configured
    role.rbac.authorization.k8s.io/snapshot-controller-leaderelection configured
    rolebinding.rbac.authorization.k8s.io/snapshot-controller-leaderelection configured
  6. Verify that the CRD YAML files are applied:

    kubectl get crd | grep volumesnapshot

    Sample response:

    astradsvolumesnapshots.astrads.netapp.io              2021-08-04T17:48:21Z
    volumesnapshotclasses.snapshot.storage.k8s.io         2021-08-04T22:05:49Z
    volumesnapshotcontents.snapshot.storage.k8s.io        2021-08-04T22:05:59Z
    volumesnapshots.snapshot.storage.k8s.io               2021-08-04T22:06:17Z
  7. Verify that the snapshot controller files are applied:

    kubectl get pods -n kube-system | grep snapshot

    Sample response:

    snapshot-controller-7f58886ff4-cdh78                                    1/1     Running   0          13s
    snapshot-controller-7f58886ff4-tmrd9                                    1/1     Running   0          32s

Set up Astra Data Store as storage backend

Configure storage backend parameters in the ads_backend.json file and create the Astra Data Store storage backend.

Steps
  1. Create ads_backend.json using a secure terminal:

    vi ads_backend.json
  2. Configure the JSON file:

    Note A sample JSON follows these steps.
    1. Change the "cluster" value to the cluster name for the Astra Data Store cluster.

    2. Change the "namespace" value to the namespace you want to use with volume creation.

    3. Change the "autoExportPolicy" value to true unless you set up an exportpolicy CR instead for this backend.

    4. Populate the "autoExportCIDRs" list with IP addresses you want to grant access. Use 0.0.0.0/0 to allow all.

    5. For the "kubeconfig" value, do the following:

      1. Convert and minimize the .kube/config YAML file to JSON format without spaces:

        Example conversion:

        python3 -c 'import sys, yaml, json; json.dump(yaml.load(sys.stdin), sys.stdout, indent=None)' < ~/.kube/config > kubeconf.json
      2. Encode as base64 and use the base64 output for the "kubeconfig" value:

        Example encoding:

        cat kubeconf.json | base64 | tr -d '\n'
    {
        "version": 1,
        "storageDriverName": "astrads-nas",
        "storagePrefix": "",
        "cluster": "example-1234584",
        "namespace": "astrads-system",
        "autoExportPolicy": true,
        "autoExportCIDRs": ["0.0.0.0/0"],
        "kubeconfig": "<base64_output_of_kubeconf_json>",
        "debugTraceFlags": {"method": true, "api": true},
        "labels": {"cloud": "on-prem", "creator": "trident-dev"},
        "defaults": {
            "qosPolicy": "silver"
        },
        "storage": [
            {
                "labels": {
                    "performance": "extreme"
                },
                "defaults": {
                    "qosPolicy": "gold"
                }
            },
            {
                "labels": {
                    "performance": "premium"
                },
                "defaults": {
                    "qosPolicy": "silver"
                }
            },
            {
                "labels": {
                    "performance": "standard"
                },
                "defaults": {
                    "qosPolicy": "bronze"
                }
            }
        ]
    }
  3. Change to the directory where you downloaded the Trident installer:

    cd <trident-installer or path to folder containing tridentctl>
  4. Create the storage backend:

    ./tridentctl create backend -f ads_backend.json -n trident

    Sample response:

    +------------------+----------------+--------------------------------------+--------+---------+
    |       NAME       | STORAGE DRIVER |                 UUID                 | STATE  | VOLUMES |
    +------------------+----------------+--------------------------------------+--------+---------+
    | example-1234584  | astrads-nas    | 2125fa7a-730e-43c8-873b-6012fcc3b527 | online |       0 |
    +------------------+----------------+--------------------------------------+--------+---------+

Create a default Astra Data Store storage class

Create the Astra Trident default storage class and apply it to the storage backend.

Steps
  1. Create the trident-csi storage class:

    1. Create ads_sc_example.yaml:

      vi ads_sc_example.yaml

      Example:

      allowVolumeExpansion: true
      apiVersion: storage.k8s.io/v1
      kind: StorageClass
      metadata:
        creationTimestamp: "2022-05-09T18:05:21Z"
        name: ads-silver
        resourceVersion: "3361772"
        uid: lo023456-da4b-51e3-b430-3aa1e3bg111a
      mountOptions:
      - vers=4
      parameters:
        backendType: astrads-nas
        selector: performance=premium
      provisioner: csi.trident.netapp.io
      reclaimPolicy: Delete
      volumeBindingMode: Immediate
    2. Create trident-csi:

      kubectl create -f ads_sc_example.yaml

      Response:

      storageclass.storage.k8s.io/trident-csi created
  2. Verify that the storage class has been added:

    kubectl get storageclass

    Response:

    NAME          PROVISIONER             RECLAIMPOLICY   VOLUMEBINDINGMODE   ALLOWVOLUMEEXPANSION   AGE
    ads-silver    csi.trident.netapp.io   Delete          Immediate           true                   6h29m
  3. Change to the directory where you downloaded the Trident installer:

    cd <trident-installer or path to folder containing tridentctl>
  4. Verify that the Astra Trident backend has been updated with the default storage class parameters:

    ./tridentctl get backend -n trident -o yaml

    Sample response:

    items:
    - backendUUID: 2125fa7a-730e-43c8-873b-6012fcc3b527
      config:
        autoExportCIDRs:
        - 0.0.0.0/0
        autoExportPolicy: true
        backendName: ""
        cluster: example-1234584
        credentials: null
        debug: false
        debugTraceFlags:
          api: true
          method: true
        defaults:
          exportPolicy: default
          qosPolicy: bronze
          size: 1G
          snapshotDir: "false"
          snapshotPolicy: none
        disableDelete: false
        kubeconfig: <ID>
        labels:
          cloud: on-prem
          creator: trident-dev
        limitVolumeSize: ""
        namespace: astrads-system
        nfsMountOptions: ""
        region: ""
        serialNumbers: null
        storage:
        - defaults:
            exportPolicy: ""
            qosPolicy: gold
            size: ""
            snapshotDir: ""
            snapshotPolicy: ""
          labels:
            performance: extreme
          region: ""
          supportedTopologies: null
          zone: ""
        - defaults:
            exportPolicy: ""
            qosPolicy: silver
            size: ""
            snapshotDir: ""
            snapshotPolicy: ""
          labels:
            performance: premium
          region: ""
          supportedTopologies: null
          zone: ""
        - defaults:
            exportPolicy: ""
            qosPolicy: bronze
            size: ""
            snapshotDir: ""
            snapshotPolicy: ""
          labels:
            performance: standard
          region: ""
          supportedTopologies: null
          zone: ""
        storageDriverName: astrads-nas
        storagePrefix: ""
        supportedTopologies: null
        version: 1
        zone: ""
      configRef: ""
      name: example-1234584
      online: true
      protocol: file
      state: online
      storage:
        example-1234584_pool_0:
          name: example-1234584_pool_0
          storageAttributes:
            backendType:
              offer:
              - astrads-nas
            clones:
              offer: true
            encryption:
              offer: false
            labels:
              offer:
                cloud: on-prem
                creator: trident-dev
                performance: extreme
            snapshots:
              offer: true
          storageClasses:
          - trident-csi
          supportedTopologies: null
        example-1234584_pool_1:
          name: example-1234584_pool_1
          storageAttributes:
            backendType:
              offer:
              - astrads-nas
            clones:
              offer: true
            encryption:
              offer: false
            labels:
              offer:
                cloud: on-prem
                creator: trident-dev
                performance: premium
            snapshots:
              offer: true
          storageClasses:
          - trident-csi
          supportedTopologies: null
        example-1234584_pool_2:
          name: example-1234584_pool_2
          storageAttributes:
            backendType:
              offer:
              - astrads-nas
            clones:
              offer: true
            encryption:
              offer: false
            labels:
              offer:
                cloud: on-prem
                creator: trident-dev
                performance: standard
            snapshots:
              offer: true
          storageClasses:
          - ads-silver
          supportedTopologies: null
      volumes: []

Configure Astra Data Store monitoring

(Optional) You can configure Astra Data Store for monitoring by another telemetry service. This procedure is recommended if you are not using Astra Control Center for Astra Data Store monitoring or if you want to extend monitoring to additional endpoints.

You can install the monitoring operator if your Astra Data Store instance is a standalone deployment, uses Cloud Insights to monitor telemetry, or streams logs to a third-party endpoint such as Elastic.

Note For Astra Control Center deployments, the monitoring operator is automatically configured. You can skip the first two commands of the following procedure.
What you’ll need

Before setting up monitoring, you will need an active Astra data store cluster in the astrads-system namespace.

Steps
  1. Run this install command:

    kubectl apply -f ./manifests/monitoring_operator.yaml
  2. Configure Astra Data Store for monitoring:

    kubectl astrads monitoring -n netapp-monitoring -r [YOUR REGISTRY] setup
  3. Configure Astra Data Store to stream EMS logs to an Elastic endpoint:

    kubectl astrads monitoring es --port <portname> --host <hostname>