### Install Trident with tridentctl Source: https://context7.com/netapp/trident/llms.txt Directly installs Trident into a Kubernetes cluster using the tridentctl CLI. This method bypasses the need for the Trident Operator. Ensure the installer bundle is downloaded and extracted first. ```bash # Download and extract the Trident installer bundle wget https://github.com/NetApp/trident/releases/download/v26.06.0/trident-installer-26.06.0.tar.gz tar -xf trident-installer-26.06.0.tar.gz cd trident-installer # Install Trident into the 'trident' namespace ./tridentctl install \ --namespace trident \ --trident-image docker.io/netapp/trident:26.06.0 \ --log-format json \ --k8s-timeout 3m0s \ --node-prep iscsi,nfs # Uninstall Trident (keep CRDs by default) ./tridentctl uninstall --namespace trident # Check installation status ./tridentctl version -n trident # +----------------+----------------+ # | SERVER VERSION | CLIENT VERSION | # +----------------+----------------+ # | 26.06.0 | 26.06.0 | # +----------------+----------------+ ``` -------------------------------- ### Confirm Plugin Availability Source: https://github.com/netapp/trident/blob/master/contrib/docker/plugin/README.md List all available Docker plugins to confirm that the Trident plugin has been successfully installed and is available. ```bash docker plugin ls ``` -------------------------------- ### Install Trident Operator with Helm Source: https://context7.com/netapp/trident/llms.txt Installs the Trident Operator using Helm, which then manages the Trident deployment via the TridentOrchestrator CR. Ensure the NetApp Helm repo is added and updated before running. ```bash # Add the NetApp Helm repo and install the operator into the trident namespace helm repo add netapp-trident https://netapp.github.io/trident-helm-chart helm repo update helm install trident-operator netapp-trident/trident-operator \ --namespace trident \ --create-namespace \ --set tridentImage=docker.io/netapp/trident:26.06.0 \ --set imagePullPolicy=IfNotPresent \ --set cloudProvider=AWS \ --set cloudIdentity="eks.amazonaws.com/role-arn: arn:aws:iam::123456789012:role/my-role" \ --set tridentDebug=false \ --set tridentLogLevel=info \ --set enableConcurrency=false \ --set kubeletDir=/var/lib/kubelet # Verify the operator and Trident pods are running kubectl get pods -n trident # NAME READY STATUS RESTARTS # trident-controller-xxxxxxxxx-xxxxx 6/6 Running 0 # trident-node-linux-xxxxx 2/2 Running 0 # trident-operator-xxxxxxxxx-xxxxx 1/1 Running 0 ``` -------------------------------- ### Install Trident Operator with Helm Source: https://context7.com/netapp/trident/llms.txt Install the Trident operator using Helm, specifying key overrides for Trident image, operator image, log level, log format, and other configuration parameters. ```bash # Install with key overrides helm install trident-operator netapp-trident/trident-operator \ --namespace trident \ --create-namespace \ --set tridentImage=docker.io/netapp/trident:26.06.0 \ --set operatorImage=docker.io/netapp/trident-operator:26.06.0 \ --set tridentLogLevel=debug \ --set tridentLogFormat=json \ --set tridentDebug=false \ --set tridentEnableForceDetach=false \ --set tridentSilenceAutosupport=false \ --set kubeletDir=/var/lib/kubelet \ --set windows=false \ --set cloudProvider=GCP \ --set enableConcurrency=false \ --set httpsMetrics=false \ --set iscsiSelfHealingInterval=5m0s \ --set iscsiSelfHealingWaitTime=7m0s \ --set k8sAPIQPS=100 \ --set fsGroupPolicy=File \ --set 'nodePrep[0]=iscsi' \ --set 'nodePrep[1]=nfs' \ --set 'imagePullSecrets[0]=my-registry-secret' ``` -------------------------------- ### Trident REST API: Volume and Snapshot Management Source: https://context7.com/netapp/trident/llms.txt Manages volumes and snapshots via the Trident REST API. Supports listing, getting details, creating, and deleting volumes and snapshots. ```bash TRIDENT_API="http://127.0.0.1:8000/trident/v1" # List all volumes curl -s "${TRIDENT_API}/volume" | jq . # {"volumes":["pvc-abc123","pvc-def456"]} # Get volume details curl -s "${TRIDENT_API}/volume/pvc-abc123" | jq . # {"volume":{"name":"pvc-abc123","size":"1073741824","protocol":"file",...}} # List all snapshots curl -s "${TRIDENT_API}/snapshot" | jq . # {"snapshots":["pvc-abc123/snap-1"]} # Create a snapshot curl -s -X POST "${TRIDENT_API}/snapshot" \ -H "Content-Type: application/json" \ -d '{"volume":"pvc-abc123","name":"snap-manual"}' | jq . # {"snapshot":"pvc-abc123/snap-manual"} # Get a specific snapshot curl -s "${TRIDENT_API}/snapshot/pvc-abc123/snap-manual" | jq . # Delete a snapshot curl -s -X DELETE "${TRIDENT_API}/snapshot/pvc-abc123/snap-manual" | jq . # {} # Delete a volume curl -s -X DELETE "${TRIDENT_API}/volume/pvc-abc123" | jq . # {} ``` -------------------------------- ### Create Custom ONTAP Role using Python Script Source: https://github.com/netapp/trident/blob/master/contrib/ontap/trident_role/Readme.md This Python script automates the creation of custom ONTAP roles. Install dependencies using requirements.txt and run the script with connection details and API type. Options for role name and Vserver name are available. ```bash pip install -r requirements.txt python role-creator.py -i -u -p --zapi/--rest ``` -------------------------------- ### Build All Images and Binaries for All Supported Platforms Source: https://github.com/netapp/trident/blob/master/BUILD.md Builds all images and binaries for all supported platforms. Requires `docker buildx` and a target registry. The `BUILDX_OUTPUT=push` option pushes the images to the registry. ```shell PLATFORMS=all \ REGISTRY=$PRIVATE_REGISTRY \ BUILD_CLI='docker buildx' \ BUILDX_OUTPUT=push \ make all ``` -------------------------------- ### Build Trident Binary Source: https://github.com/netapp/trident/blob/master/contrib/docker/plugin/README.md Compile the Trident binary from the source code. Ensure the GOPATH is set correctly and the trident repository is checked out into `$GOPATH/src/github.com/netapp/`. ```bash go build -v ``` -------------------------------- ### Build Trident Plugin Filesystem Source: https://github.com/netapp/trident/blob/master/contrib/docker/plugin/README.md Execute the make command to build the Trident plugin filesystem. This command should be run from the plugin directory. ```bash make ``` -------------------------------- ### Navigate to Plugin Directory Source: https://github.com/netapp/trident/blob/master/contrib/docker/plugin/README.md Change the current directory to the plugin directory to prepare for building the plugin filesystem. ```bash cd contrib/docker/plugin ``` -------------------------------- ### Create ONTAP SAN Backend Source: https://context7.com/netapp/trident/llms.txt Command to create an ONTAP SAN backend using a JSON configuration file. ```bash tridentctl create backend -f backend-ontap-san-chap.json -n trident ``` -------------------------------- ### Upgrade Trident Operator with Helm Source: https://context7.com/netapp/trident/llms.txt Upgrade an existing Trident operator installation using Helm, typically by updating the Trident image. ```bash # Upgrade an existing installation helm upgrade trident-operator netapp-trident/trident-operator \ --namespace trident \ --set tridentImage=docker.io/netapp/trident:26.06.0 ``` -------------------------------- ### Volume Cloning Source: https://context7.com/netapp/trident/llms.txt Trident supports cloning an existing PVC by referencing it as a dataSource in a new PVC. This example demonstrates how to create a clone and verify its status. ```APIDOC ## Volume Cloning Trident supports cloning an existing PVC by referencing it as a `dataSource` in a new PVC. ```yaml apiVersion: v1 kind: PersistentVolumeClaim metadata: name: basic-clone spec: accessModes: - ReadWriteOnce storageClassName: basic resources: requests: storage: 1Gi dataSource: kind: PersistentVolumeClaim name: basic ``` ```bash # Verify the clone is bound kubectl get pvc basic-clone # NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE # basic-clone Bound pvc-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx 1Gi RWO basic 10s ``` ``` -------------------------------- ### Build tridentctl Natively Source: https://github.com/netapp/trident/blob/master/BUILD.md Builds the `tridentctl` binary natively using the Go compiler. Optionally includes linker flags obtained from `make linker_flags`. ```go # with optional linker flags, note the quotes around make go build -o tridentctl -ldflags "$(make linker_flags)" ./cli ``` ```go # without linker flags go build -o tridentctl ./cli ``` -------------------------------- ### Build Trident Orchestrator Natively Source: https://github.com/netapp/trident/blob/master/BUILD.md Builds the Trident orchestrator binary natively using the Go compiler. Optionally includes linker flags obtained from `make linker_flags`. ```go # with optional linker flags go build -o trident -ldflags "$(make linker_flags)" . ``` ```go # without linker flags go build -o trident . ``` -------------------------------- ### Rebuild Target Without Dependencies Source: https://github.com/netapp/trident/blob/master/BUILD.md Demonstrates how to rebuild a specific target (e.g., `manifest`) without its dependencies by creating empty files for the dependencies. This forces `make` to skip those steps. ```shell # rebuild manifest without images or binaries touch binaries images make manifest ``` -------------------------------- ### Trident REST API: Backend Management Source: https://context7.com/netapp/trident/llms.txt Manages storage backends using the Trident REST API. Supports listing, getting, adding, updating state (suspend/online), and deleting backends. ```bash TRIDENT_API="http://127.0.0.1:8000/trident/v1" # List all backends curl -s "${TRIDENT_API}/backend" | jq . # {"backends":["nas-backend-prod","san-backend-chap"]} # Get a specific backend curl -s "${TRIDENT_API}/backend/nas-backend-prod" | jq . # {"backend":{"name":"nas-backend-prod","backendUUID":"...","state":"online",...}} # Add a new backend (POST with JSON config body) curl -s -X POST "${TRIDENT_API}/backend" \ -H "Content-Type: application/json" \ -d @backend-ontap-nas.json | jq . # {"backend":"nas-backend-prod"} # Update backend state (suspend/online) curl -s -X POST "${TRIDENT_API}/backend/nas-backend-prod/state" \ -H "Content-Type: application/json" \ -d '{"state":"suspended","userBackendState":""}' | jq . # {"backend":"nas-backend-prod"} # Delete a backend curl -s -X DELETE "${TRIDENT_API}/backend/nas-backend-prod" | jq . # {} ``` -------------------------------- ### Get Trident Server Version via REST API Source: https://context7.com/netapp/trident/llms.txt Retrieves the current Trident server version using the HTTP REST API. The API is exposed on port 8000 for HTTP and 8443 for HTTPS. ```bash # GET /trident/v1/version curl -s http://127.0.0.1:8000/trident/v1/version | jq . # { # "version": "26.06.0", # "goVersion": "go1.23.4", # "acpVersion": "26.06.0" # } ``` -------------------------------- ### Build Dependencies for Single-Platform Development Source: https://github.com/netapp/trident/blob/master/BUILD.md Use this command to build all dependencies for single-platform development. It supports different Docker CLI configurations and local Go builds. ```shell # using docker or docker-compatible cli with docker alias make ``` ```shell # non-docker cli not aliased to docker DOCKER_CLI=nerdctl BUILD_CLI=nerdctl make ``` ```shell # using local go command GO_SHELL= make ``` -------------------------------- ### Create and Verify ONTAP NAS Backend Source: https://context7.com/netapp/trident/llms.txt Commands to create an ONTAP NAS backend from a JSON configuration file and verify its addition to Trident. ```bash # Create the backend from a JSON config file tridentctl create backend -f backend-ontap-nas.json -n trident # Verify the backend was added tridentctl get backend -n trident # +-------------------+----------------+--------------------------------------+--------+------------+---------+ # | NAME | STORAGE DRIVER | UUID | STATE | USER-STATE | VOLUMES | # +-------------------+----------------+--------------------------------------+--------+------------+---------+ # | nas-backend-prod | ontap-nas | f5c2f0ff-xxxx-xxxx-xxxx-xxxxxxxxxxxx | online | normal | 0 | # +-------------------+----------------+--------------------------------------+--------+------------+---------+ ``` -------------------------------- ### Manage Trident Backends using tridentctl Source: https://context7.com/netapp/trident/llms.txt Perform backend operations such as creation, listing, retrieval, and deletion using the tridentctl CLI. Use '-n trident' for the namespace. ```bash # Create a backend from a JSON file tridentctl create backend -f backend-ontap-nas.json -n trident ``` ```bash # List all backends (table format, default) tridentctl get backend -n trident ``` ```bash # Get a specific backend in JSON format tridentctl get backend nas-backend-prod -o json -n trident ``` ```bash # Get backend in YAML format tridentctl get backend nas-backend-prod -o yaml -n trident ``` ```bash # Delete a specific backend tridentctl delete backend nas-backend-prod -n trident ``` ```bash # Delete all backends tridentctl delete backend --all -n trident ``` ```bash # Update a backend (re-apply config) tridentctl create backend -f backend-ontap-nas-updated.json -n trident ``` -------------------------------- ### Configure ONTAP NAS Backend Source: https://context7.com/netapp/trident/llms.txt Use this JSON configuration to provision NFS volumes on ONTAP SVMs. Credentials can be provided inline. ```json { "version": 1, "storageDriverName": "ontap-nas", "backendName": "nas-backend-prod", "managementLIF": "10.0.0.1", "dataLIF": "10.0.0.2", "svm": "trident_svm", "username": "cluster-admin", "password": "password", "limitAggregateUsage": "80%", "limitVolumeSize": "50Gi", "nfsMountOptions": "nfsvers=4", "defaults": { "spaceReserve": "volume", "exportPolicy": "myk8scluster", "snapshotPolicy": "default", "snapshotReserve": "10" } } ``` -------------------------------- ### Package and Push Trident Plugin Source: https://github.com/netapp/trident/blob/master/contrib/docker/plugin/README.md Run the develop plugin script to package the plugin files and push them to a local Docker registry. This script will stop and restart your Docker instance. ```bash ./devPlugin ``` -------------------------------- ### Manage Autogrow Policies using tridentctl Source: https://context7.com/netapp/trident/llms.txt Use the tridentctl CLI to list and retrieve autogrow policies. Specify the namespace with '-n trident'. ```bash tridentctl get autogrowpolicy -n trident tridentctl get autogrowpolicy my-autogrow-policy -n trident ``` -------------------------------- ### Gold StorageClass for SSD and Thin Provisioning Source: https://context7.com/netapp/trident/llms.txt Selects ontap-nas backends with SSD media and thin provisioning. Snapshots are enabled. ```yaml # Gold StorageClass — selects ontap-nas backends with SSD media and thin provisioning apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: ontap-gold provisioner: csi.trident.netapp.io parameters: backendType: "ontap-nas" media: "ssd" provisioningType: "thin" snapshots: "true" ``` -------------------------------- ### SolidFire Backend Configuration Source: https://context7.com/netapp/trident/llms.txt Configure the solidfire-san driver for provisioning iSCSI volumes on NetApp SolidFire/HCI. QoS tiers are defined per storage type. ```json { "version": 1, "storageDriverName": "solidfire-san", "Endpoint": "https://user:password@10.0.0.1/json-rpc/8.0", "SVIP": "10.0.0.1:3260", "TenantName": "trident", "Types": [ {"Type": "Bronze", "Qos": {"minIOPS": 1000, "maxIOPS": 2000, "burstIOPS": 4000}}, {"Type": "Silver", "Qos": {"minIOPS": 4000, "maxIOPS": 6000, "burstIOPS": 8000}}, {"Type": "Gold", "Qos": {"minIOPS": 6000, "maxIOPS": 8000, "burstIOPS": 10000}} ] } ``` -------------------------------- ### Manage Trident Storage Classes and Volume Publications using tridentctl Source: https://context7.com/netapp/trident/llms.txt List and retrieve storage classes, and list volume publications (which volumes are published to which nodes) using the tridentctl CLI. Use '-n trident' for the namespace. ```bash # List all storage classes known to Trident tridentctl get storageclass -n trident ``` ```bash # Get a specific storage class tridentctl get storageclass ontap-gold -o json -n trident ``` ```bash # List all volume publications (which volumes are published to which nodes) tridentctl get publication -n trident ``` ```bash # List publications for a specific volume tridentctl get volume pvc-abc123 -n trident kubectl get pv $(kubectl get pvc pvc-abc123 -o jsonpath='{.spec.volumeName}') -o json ``` -------------------------------- ### tridentctl - Backend Operations Source: https://context7.com/netapp/trident/llms.txt Manage Trident storage backends using the tridentctl CLI, including creation, listing, and deletion. ```APIDOC ## tridentctl create backend ### Description Creates a new storage backend using a configuration file. ### Usage tridentctl create backend -f [-n ] ### Parameters - **-f** (string) - Required - Path to the JSON configuration file for the backend. - **-n** (string) - Optional - The Kubernetes namespace where Trident is deployed. ``` ```APIDOC ## tridentctl get backend ### Description Lists storage backends. Supports different output formats. ### Usage tridentctl get backend [-n ] [-o ] ### Parameters - **-n** (string) - Optional - The Kubernetes namespace where Trident is deployed. - **-o** (string) - Optional - Output format (e.g., "json", "yaml", "table"). Defaults to table. ### Example (Specific Backend) tridentctl get backend [-o ] [-n ] ``` ```APIDOC ## tridentctl delete backend ### Description Deletes one or more storage backends. ### Usage - Delete a specific backend: tridentctl delete backend [-n ] - Delete all backends: tridentctl delete backend --all [-n ] ``` ```APIDOC ## tridentctl update backend ### Description Updates an existing storage backend by re-applying its configuration. This is typically done using the `create backend` command with an updated configuration file. ### Usage tridentctl create backend -f [-n ] ``` -------------------------------- ### Create VolumeSnapshotClass, Take Snapshot, Restore PVC Source: https://context7.com/netapp/trident/llms.txt Defines a VolumeSnapshotClass, takes a snapshot of a PVC, and restores a new PVC from that snapshot. Ensure the VolumeSnapshotClass references the Trident driver. ```yaml # Create a VolumeSnapshotClass apiVersion: snapshot.storage.k8s.io/v1 kind: VolumeSnapshotClass metadata: name: trident-snapshotclass driver: csi.trident.netapp.io deletionPolicy: Delete --- # Take a snapshot of an existing PVC apiVersion: snapshot.storage.k8s.io/v1 kind: VolumeSnapshot metadata: name: basic-snap spec: volumeSnapshotClassName: trident-snapshotclass source: persistentVolumeClaimName: basic --- # Restore a PVC from a snapshot apiVersion: v1 kind: PersistentVolumeClaim metadata: name: basic-pvc-from-snap spec: accessModes: - ReadWriteOnce storageClassName: basic-csi resources: requests: storage: 1Gi dataSource: name: basic-snap kind: VolumeSnapshot apiGroup: snapshot.storage.k8s.io ``` -------------------------------- ### Configure ONTAP SAN Backend with CHAP Authentication Source: https://context7.com/netapp/trident/llms.txt This JSON configuration sets up an ONTAP SAN backend for iSCSI or FCP LUN-backed block volumes, enabling CHAP authentication for secure iSCSI connections. ```json { "version": 1, "storageDriverName": "ontap-san", "managementLIF": "10.0.0.1", "dataLIF": "10.0.0.2", "svm": "trident_svm", "backendName": "san-backend-chap", "useCHAP": true, "chapInitiatorSecret": "cl9qxIm36DKyawxy", "chapTargetInitiatorSecret": "rqxigXgkesIpwxyz", "chapTargetUsername": "iJF4heBRT0TCwxyz", "chapUsername": "uh2aNCLSd6cNwxyz", "username": "cluster-admin", "password": "password", "storagePrefix": "trident", "igroupName": "custom", "defaults": { "spaceReserve": "volume", "spaceAllocation": "false", "snapshotPolicy": "default", "snapshotReserve": "10" } } ``` -------------------------------- ### Build Trident Operator Image Source: https://github.com/netapp/trident/blob/master/BUILD.md Builds the Trident operator image for Linux amd64. Requires `docker buildx` and a target registry. The `BUILDX_OUTPUT=push` option pushes the images to the registry. ```shell PLATFORMS='linux/amd64' \ REGISTRY=$PRIVATE_REGISTRY \ BUILD_CLI='docker buildx' \ BUILDX_OUTPUT=push \ make operator_images ``` -------------------------------- ### Build Specific Platforms with Operator Source: https://github.com/netapp/trident/blob/master/BUILD.md Builds specified platforms (e.g., Linux amd64 and Windows LTSC2022) including the operator. Requires `docker buildx` and a target registry. The `BUILDX_OUTPUT=push` option pushes the images to the registry. ```shell PLATFORMS='linux/amd64 windows/amd64/ltsc2022' \ REGISTRY=$PRIVATE_REGISTRY \ BUILD_CLI='docker buildx' \ BUILDX_OUTPUT=push \ make all ``` -------------------------------- ### Azure NetApp Files Backend Configuration Source: https://context7.com/netapp/trident/llms.txt Configure the azure-netapp-files driver for provisioning NFS/SMB volumes on Azure NetApp Files. Supports Ultra, Premium, and Standard service tiers. ```json { "version": 1, "storageDriverName": "azure-netapp-files", "subscriptionID": "12abc678-4774-fake-a1b2-a7abcde39312", "tenantID": "a7abcde3-edc1-fake-b111-a7abcde356cf", "clientID": "abcde356-bf8e-fake-c111-abcde35613aa", "clientSecret": "rR0rUmWXfNioN1KhtHisiSAnoTherboGuskey6pU", "nfsMountOptions": "nfsvers=3", "labels": {"cloud": "azure"}, "location": "eastus", "storage": [ { "labels": {"performance": "gold"}, "serviceLevel": "Ultra" }, { "labels": {"performance": "silver"}, "serviceLevel": "Premium" }, { "labels": {"performance": "bronze"}, "serviceLevel": "Standard" } ] } ``` -------------------------------- ### Build Trident Operator Natively Source: https://github.com/netapp/trident/blob/master/BUILD.md Builds the Trident operator binary natively using the Go compiler. Optionally includes linker flags obtained from `make operator_linker_flags`. ```go # with optional linker flags go build -o trident-operator -ldflags "$(make operator_linker_flags)" ./operator ``` ```go # without linker flags go build -o trident-operator ./operator ``` -------------------------------- ### tridentctl - Snapshot Operations Source: https://context7.com/netapp/trident/llms.txt Manage volume snapshots using the tridentctl CLI, including creating, listing, and deleting snapshots. ```APIDOC ## tridentctl get snapshot ### Description Lists volume snapshots. Can filter by volume or group. ### Usage - List all snapshots: tridentctl get snapshot [-n ] - List snapshots for a specific volume: tridentctl get snapshot --volume [-n ] - List snapshots by group: tridentctl get snapshot --group [-n ] - Get a specific snapshot (using volume/snapshot naming): tridentctl get snapshot / [-n ] ``` ```APIDOC ## tridentctl delete snapshot ### Description Deletes a specific volume snapshot. ### Usage tridentctl delete snapshot / [-n ] ### Parameters - **volume-name** (string) - Required - The name of the volume the snapshot belongs to. - **snapshot-name** (string) - Required - The name of the snapshot to delete. - **-n** (string) - Optional - The Kubernetes namespace where Trident is deployed. ``` -------------------------------- ### Import Volume via tridentctl Source: https://context7.com/netapp/trident/llms.txt Imports an existing storage volume into Trident's management. Use --no-manage to prevent Trident from controlling the volume lifecycle and --no-rename to preserve the original volume name. ```yaml # pvc-import.yaml — describes the desired PVC kind: PersistentVolumeClaim apiVersion: v1 metadata: name: basicimport namespace: trident spec: accessModes: - ReadWriteOnce storageClassName: basic ``` ```bash # Import the existing ONTAP volume 'my-existing-vol' from backend 'nas-backend-prod' tridentctl import volume nas-backend-prod my-existing-vol \ -f pvc-import.yaml \ -n trident # Import without Trident lifecycle management (Trident won't delete the volume on PVC deletion) tridentctl import volume nas-backend-prod my-existing-vol \ -f pvc-import.yaml \ --no-manage \ -n trident # Import and keep original volume name (don't rename to Trident's naming convention) tridentctl import volume nas-backend-prod my-existing-vol \ -f pvc-import.yaml \ --no-rename \ -n trident ``` -------------------------------- ### Volume Snapshots Source: https://context7.com/netapp/trident/llms.txt Trident supports CSI Volume Snapshots. A VolumeSnapshotClass must reference the Trident driver before snapshots can be taken. This section shows how to create a VolumeSnapshotClass, take a snapshot of a PVC, and restore a PVC from a snapshot. ```APIDOC ## Volume Snapshots Trident supports CSI Volume Snapshots. A `VolumeSnapshotClass` must reference the Trident driver before snapshots can be taken. ```yaml # Create a VolumeSnapshotClass apiVersion: snapshot.storage.k8s.io/v1 kind: VolumeSnapshotClass metadata: name: trident-snapshotclass driver: csi.trident.netapp.io deletionPolicy: Delete --- # Take a snapshot of an existing PVC apiVersion: snapshot.storage.k8s.io/v1 kind: VolumeSnapshot metadata: name: basic-snap spec: volumeSnapshotClassName: trident-snapshotclass source: persistentVolumeClaimName: basic --- # Restore a PVC from a snapshot apiVersion: v1 kind: PersistentVolumeClaim metadata: name: basic-pvc-from-snap spec: accessModes: - ReadWriteOnce storageClassName: basic-csi resources: requests: storage: 1Gi dataSource: name: basic-snap kind: VolumeSnapshot apiGroup: snapshot.storage.k8s.io ``` ``` -------------------------------- ### REST API - Logging Configuration Source: https://context7.com/netapp/trident/llms.txt Configure Trident's logging level and active workflows at runtime via the REST API. ```APIDOC ## GET /logging/level ### Description Retrieves the current log level of the Trident controller. ### Method GET ### Endpoint /logging/level ### Response #### Success Response (200) - **level** (string) - The current log level (e.g., "info", "debug"). ### Response Example { "level": "info" } ``` ```APIDOC ## POST /logging/level/{level} ### Description Sets the log level for the Trident controller. ### Method POST ### Endpoint /logging/level/{level} ### Parameters #### Path Parameters - **level** (string) - Required - The desired log level (e.g., "debug"). ### Response #### Success Response (200) - **level** (string) - The newly set log level. ### Response Example { "level": "debug" } ``` ```APIDOC ## GET /logging/workflows ### Description Lists the available log workflows that can be traced. ### Method GET ### Endpoint /logging/workflows ### Response Example (Response content not specified in source, but expected to be a list of workflows) ``` ```APIDOC ## POST /logging/workflows ### Description Sets the active log workflows to trace specific operations. ### Method POST ### Endpoint /logging/workflows ### Parameters #### Request Body - **workflows** (array of strings) - Required - A list of workflow names to activate for tracing. ### Request Example { "workflows": ["backend_create", "volume_create"] } ### Response Example (Response content not specified in source, but expected to confirm the updated workflows) ``` ```APIDOC ## POST /logging/layers ### Description Sets the active log layers to control the verbosity of logging output. ### Method POST ### Endpoint /logging/layers ### Parameters #### Request Body - **layers** (array of strings) - Required - A list of layer names to activate (e.g., "core", "rest_frontend"). ### Request Example { "layers": ["core", "rest_frontend"] } ### Response Example (Response content not specified in source, but expected to confirm the updated layers) ``` -------------------------------- ### Build Linux amd64 Without Operator Source: https://github.com/netapp/trident/blob/master/BUILD.md Builds the Linux amd64 platform without the operator. Requires `docker buildx` and a target registry. The `BUILDX_OUTPUT=push` option pushes the images to the registry. ```shell PLATFORMS='linux/amd64' \ REGISTRY=$PRIVATE_REGISTRY \ BUILD_CLI='docker buildx' \ BUILDX_OUTPUT=push \ make ``` -------------------------------- ### Retrieve Trident Logs and Diagnostics using tridentctl Source: https://context7.com/netapp/trident/llms.txt Use the `tridentctl logs` command to retrieve logs from Trident pods, specify components or nodes, view previous logs, or create a support archive. Use '-n trident' for the namespace. ```bash # Display Trident controller logs (auto-detects running components) tridentctl logs -n trident ``` ```bash # Display logs from the Trident Operator tridentctl logs -l trident-operator -n trident ``` ```bash # Display logs from node pods for a specific node tridentctl logs --node k8s-node-01 -n trident ``` ```bash # Get logs for all components (trident, acp, operator) tridentctl logs -l all -n trident ``` ```bash # Show previous container instance logs (useful after a crash) tridentctl logs -p -n trident ``` ```bash # Create a support archive zip of all logs tridentctl logs -a -n trident # Creating support archive... # Archive: support-2025-06-01T12-00-00-UTC.zip ``` -------------------------------- ### Manage Trident Snapshots using tridentctl Source: https://context7.com/netapp/trident/llms.txt Perform snapshot operations including listing, retrieving by volume or group, and deletion using the tridentctl CLI. Use '-n trident' for the namespace. ```bash # List all snapshots tridentctl get snapshot -n trident ``` ```bash # List snapshots for a specific volume tridentctl get snapshot --volume pvc-abc123 -n trident ``` ```bash # List snapshots by group tridentctl get snapshot --group my-group-snapshot -n trident ``` ```bash # Get a specific snapshot using volume/snapshot naming tridentctl get snapshot pvc-abc123/snap-manual -n trident ``` ```bash # Delete a snapshot tridentctl delete snapshot pvc-abc123/snap-manual -n trident ``` -------------------------------- ### Apply and Check Autogrow Policy Source: https://context7.com/netapp/trident/llms.txt Apply the Autogrow Policy using kubectl and check its status via tridentctl. ```bash # Apply the autogrow policy kubectl apply -f autogrow-policy.yaml # Check policy status via tridentctl tridentctl get autogrowpolicy my-autogrow-policy -n trident -o json ``` -------------------------------- ### tridentctl - Logs and Diagnostics Source: https://context7.com/netapp/trident/llms.txt Retrieve logs from Trident components and create support archives using the tridentctl logs command. ```APIDOC ## tridentctl logs ### Description Retrieves logs from Trident pods. Supports filtering by component, node, and retrieving previous logs or creating a support archive. ### Usage - Display controller logs: tridentctl logs [-n ] - Display logs for specific components (e.g., trident, trident-operator): tridentctl logs -l [-n ] - Display logs for a specific node: tridentctl logs --node [-n ] - Show previous container instance logs: tridentctl logs -p [-n ] - Create a support archive zip of all logs: tridentctl logs -a [-n ] ```