Manage Astra Trident using tridentctl
The Trident installer bundle includes the tridentctl
command-line utility to provide simple access to Astra Trident. Kubernetes users with sufficient privileges can use it to install Astra Trident or manage the namespace that contains the Astra Trident pod.
Commands and global flags
You can run tridentctl help
to get a list of available commands for tridentctl
or append the --help
flag to any command to get a list of options and flags for that specific command.
tridentctl [command] [--optional-flag]
The Astra Trident tridentctl
utility supports the following commands and global flags.
Commands
create
-
Add a resource to Astra Trident.
delete
-
Remove one or more resources from Astra Trident.
get
-
Get one or more resources from Astra Trident.
help
-
Help about any command.
images
-
Print a table of the container images Astra Trident needs.
import
-
Import an existing resource to Astra Trident.
install
-
Install Astra Trident.
logs
-
Print the logs from Astra Trident.
send
-
Send a resource from Astra Trident.
uninstall
-
Uninstall Astra Trident.
update
-
Modify a resource in Astra Trident.
update backend state
-
Temporarily suspend backend operations.
upgrade
-
Upgrade a resource in Astra Trident.
version
-
Print the version of Astra Trident.
Global flags
-d
,--debug
-
Debug output.
-h
,--help
-
Help for
tridentctl
. -k
,--kubeconfig string
-
Specify the
KUBECONFIG
path to run commands locally or from one Kubernetes cluster to another.Alternatively, you can export the KUBECONFIG
variable to point to a specific Kubernetes cluster and issuetridentctl
commands to that cluster. -n
,--namespace string
-
Namespace of Astra Trident deployment.
-o
,--output string
-
Output format. One of json|yaml|name|wide|ps (default).
-s
,--server string
-
Address/port of Astra Trident REST interface.
Trident REST interface can be configured to listen and serve at 127.0.0.1 (for IPv4) or [::1] (for IPv6) only.
Command options and flags
create
Use the create
command to add a resource to Astra Trident.
tridentctl create [option]
- Options
-
backend
: Add a backend to Astra Trident.
delete
Use the delete
command to remove one or more resources from Astra Trident.
tridentctl delete [option]
- Options
-
backend
: Delete one or more storage backends from Astra Trident.
snapshot
: Delete one or more volume snapshots from Astra Trident.
storageclass
: Delete one or more storage classes from Astra Trident.
volume
: Delete one or more storage volumes from Astra Trident.
get
Use the get
command to get one or more resources from Astra Trident.
tridentctl get [option]
- Options
-
backend
: Get one or more storage backends from Astra Trident.
snapshot
: Get one or more snapshots from Astra Trident.
storageclass
: Get one or more storage classes from Astra Trident.
volume
: Get one or more volumes from Astra Trident. - Flags
-
-h
,--help
: Help for volumes.
--parentOfSubordinate string
: Limit query to subordinate source volume.
--subordinateOf string
: Limit query to subordinates of volume.
images
Use images
flags to print a table of the container images Astra Trident needs.
tridentctl images [flags]
- Flags
-
-h
,--help
: Help for images.
-v
,--k8s-version string
: Semantic version of Kubernetes cluster.
import volume
Use the import volume
command to import an existing volume to Astra Trident.
tridentctl import volume <backendName> <volumeName> [flags]
- Aliases
-
volume
,v
- Flags
-
-f
,--filename string
: Path to YAML or JSON PVC file.
-h
,--help
: Help for volume.
--no-manage
: Create PV/PVC only. Don't assume volume lifecycle management.
install
Use the install
flags to install Astra Trident.
tridentctl install [flags]
- Flags
-
--autosupport-image string
: The container image for Autosupport Telemetry (default "netapp/trident autosupport:<current-version>").
--autosupport-proxy string
: The address/port of a proxy for sending Autosupport Telemetry.
--enable-node-prep
: Attempt to install required packages on nodes.
--generate-custom-yaml
: Generate YAML files without installing anything.
-h
,--help
: Help for install.
--http-request-timeout
: Override the HTTP request timeout for Trident controller's REST API (default 1m30s).
--image-registry string
: The address/port of an internal image registry.
--k8s-timeout duration
: The timeout for all Kubernetes operations (default 3m0s).
--kubelet-dir string
: The host location of kubelet's internal state (default "/var/lib/kubelet").
--log-format string
: The Astra Trident logging format (text, json) (default "text").
--pv string
: The name of the legacy PV used by Astra Trident, makes sure this doesn't exist (default "trident").
--pvc string
: The name of the legacy PVC used by Astra Trident, makes sure this doesn't exist (default "trident").
--silence-autosupport
: Don't send autosupport bundles to NetApp automatically (default true).
--silent
: Disable most output during installation.
--trident-image string
: The Astra Trident image to install.
--use-custom-yaml
: Use any existing YAML files that exist in setup directory.
--use-ipv6
: Use IPv6 for Astra Trident's communication.
logs
Use logs
flags to print the logs from Astra Trident.
tridentctl logs [flags]
- Flags
-
-a
,--archive
: Create a support archive with all logs unless otherwise specified.
-h
,--help
: Help for logs.
-l
,--log string
: Astra Trident log to display. One of trident|auto|trident-operator|all (default "auto").
--node string
: The Kubernetes node name from which to gather node pod logs.
-p
,--previous
: Get the logs for the previous container instance if it exists.
--sidecars
: Get the logs for the sidecar containers.
send
Use the send
command to send a resource from Astra Trident.
tridentctl send [option]
- Options
-
autosupport
: Send an Autosupport archive to NetApp.
uninstall
Use uninstall
flags to uninstall Astra Trident.
tridentctl uninstall [flags]
- Flags
-
-h, --help
: Help for uninstall.
--silent
: Disable most output during uninstall.
update
Use the update
command to modify a resource in Astra Trident.
tridentctl update [option]
- Options
-
backend
: Update a backend in Astra Trident.
update backend state
Use the update backend state
command to suspend or resume backend operations.
tridentctl update backend state <backend-name> [flag]
-
If a backend is created using a TridentBackendConfig (tbc), the backend cannot be updated using a
backend.json
file. -
If the
userState
has been set in a tbc, it cannot be modified using thetridentctl update backend state <backend-name> --user-state suspended/normal
command. -
To regain the ability to set the
userState
via tridentctl once it has been set via tbc, theuserState
field must be removed from the tbc. This can be done using thekubectl edit tbc
command. Once theuserState
field is removed, you can use thetridentctl update backend state
command to change theuserState
of a backend. -
Use the
tridentctl update backend state
to change theuserState
. You can also update theuserState
usingTridentBackendConfig
orbackend.json
file; this triggers a complete re-initialization of the backend and can be time-consuming.- Flags
-
-h
,--help
: Help for backend state.
--user-state
: Set tosuspended
to pause backend operations. Set tonormal
to resume backend operations. When set tosuspended
:
-
AddVolume
andImport Volume
are paused. -
CloneVolume
,ResizeVolume
,PublishVolume
,UnPublishVolume
,CreateSnapshot
,GetSnapshot
,RestoreSnapshot
,DeleteSnapshot
,RemoveVolume
,GetVolumeExternal
,ReconcileNodeAccess
remain available.
You can also update the backend state using userState
field in the backend configuration file TridentBackendConfig
or backend.json
.
For more information, refer to Options for managing backends and Perform backend management with kubectl.
Example:
Follow these steps to update the userState
using the backend.json
file:
-
Edit the
backend.json
file to include theuserState
field with its value set to 'suspended'. -
Update the backend using the
tridentctl backend update
command and the path to the updatedbackend.json
file.Example:
tridentctl backend update -f /<path to backend JSON file>/backend.json
{ "version": 1, "storageDriverName": "ontap-nas", "managementLIF": "<redacted>", "svm": "nas-svm", "backendName": "customBackend", "username": "<redacted>", "password": "<redacted>", "userState": "suspended", }
You can edit the tbc after it has been applied using the kubectl edit <tbc-name> -n <namespace>
command.
The following example updates the backend state to suspend using the userState: suspended
option:
apiVersion: trident.netapp.io/v1 kind: TridentBackendConfig metadata: name: backend-ontap-nas spec: version: 1 backendName: customBackend storageDriverName: ontap-nas managementLIF: <redacted> svm: nas-svm userState: suspended credentials: name: backend-tbc-ontap-nas-secret
version
Use version
flags to print the version of tridentctl
and the running Trident service.
tridentctl version [flags]
- Flags
-
--client
: Client version only (no server required).
-h, --help
: Help for version.