Skip to main content
Tungsten Operator

Using the kubectl plugin

The operator package includes pre-compiled binaries for a kubectl plugin, which simplifies the management of Tungsten Clusters.

The kubectl plugin is installed automatically if you make use of the install.sh script. The steps below are only required if you choose to install the operator manually.

To install the plugin, copy the binary into an executable PATH, for example:

shell> cd /opt/continuent/software/tungsten-operator-8.0.0-27
shell> sudo cp kubectl-tungsten/kubectl-tungsten-$(uname -o | tr '[:upper:]' '[:lower:]')-$(uname -m) /usr/local/bin/kubectl-tungsten
Usage
kubectl tungsten [command] [sub-command] [global-flags]

After installation, the plugin is available by executing either kubectl tungsten or kubectl-tungsten, for example:

shell> kubectl tungsten cluster list

The following commands are available:

OptionDescription
backupManage Backups.
clusterManage Clusters.
completionGenerate the auto-completion script for the specified shell.
expertExpert Commands.
helpShow help for any command.

To access more information about each command, you can use the help, for example:

shell> kubectl tungsten cluster help

backup command

OptionDescription
createCreates new backup of a cluster to external object storage.
listLists available backups.

backup create command

Usage
kubectl tungsten backup create BACKUP_NAME [flags]
OptionDescription
--cluster
Aliases: -c
Name of the Tungsten cluster.
--timeout
Aliases: -t
Timeout in minutes.
Default: 300
--wait
Aliases: -w
Wait for backup to be completed.

Creates a new TungstenBackup to initialize backup for supplied cluster name. Backup process is picked up by the operator and starts immediately.

backup list commands

Usage
kubectl tungsten backup list [flags]

Lists available backups.

OptionDescription
--cluster
Aliases: -c
Name of the Tungsten cluster.

cluster command

OptionDescription
cctrlGet cctrl session in specified cluster.
listList clusters.
proxyProxies primary MySQL instance via connector to local machine.
recoverRecover cluster or specific datasource.
resetReset specific datasource.
switchSwitch cluster to most advanced datasource or specific datasource.
trepctlRun trepctl in specified cluster.

cluster cctrl command

Usage
kubectl tungsten cluster cctrl CLUSTER_NAME [args] [flags]

Get cctrl shell session in specified cluster.

OptionDescription
--dataservice
Aliases: -d
Optional dataservice name. If not given, first physical dataservice will be used.
--stdin
Aliases: -i
Pass stdin to the manager container.
Default: true
--tty
Aliases: -t
Allocate a TTY to stdin.
Default: true

cluster proxy command

Usage
kubectl tungsten cluster proxy CLUSTER_NAME [options] [LOCAL_PORT]

Proxies MySQL primary via Tungsten Connector.

OptionDescription
--addressAddresses to listen on (comma separated). Only accepts IP addresses or localhost as a value. When localhost is supplied, kubectl will try to bind on both 127.0.0.1 and ::1 and will fail if neither of these addresses are available to bind used.
Default: localhost
--dataservice
Aliases: -d
Optional dataservice name. If not given, first physical dataservice will be used.
--pod-running-timeoutThe length of time (eg 5s, 2m, or 3h, higher than zero) to wait until at least one pod is running.
Default: 1m0s

cluster recover command

Usage
kubectl tungsten cluster recover CLUSTER_NAME [datasource] [flags]

Attempts to recover Tungsten cluster. When passed with optional parameter [datasource], attempts to recover only that datasource.

OptionDescription
--dataservice
Aliases: -d
Optional dataservice name. If not given, first physical dataservice will be used.
Default: localhost

cluster reset command

Usage
kubectl tungsten cluster reset CLUSTER_NAME DATASOURCE_NAME [flags]

Resets specific datasource of a Tungsten cluster.

OptionDescription
--backupOptional backup name. If not given, the latest backup will be used.
--timeout
Aliases: -t
Timeout in minutes.
Default: 300
--wait
Aliases: -w
Wait for reset to be completed.

cluster switch command

Usage
kubectl tungsten cluster switch CLUSTER_NAME [datasource] [flags]

Attempts to switch primary instance of Tungsten Cluster. When passed with optional parameter [datasource], attempts to switch to that specific datasource.

OptionDescription
--dataservice
Aliases: -d
Optional dataservice name. If not given, first physical dataservice will be used.

completion command

OptionDescription
bashGenerate the autocompletion script for bash.
fishGenerate the autocompletion script for fish.
powershellGenerate the autocompletion script for powershell.
zshGenerate the autocompletion script for zsh.

expert command

OptionDescription
mysqlExecute MySQL command in specified cluster member.

Global Flags

OptionDescription
--add-dir-headerIf true, adds the file directory to the header of the log messages.
--alsologtostderrLog to standard error as well as files (no effect when --logtostderr=true).
--asUsername to impersonate for the operation. User could be a regular user or a service account in a namespace.
--as-groupGroup to impersonate for the operation, this flag can be repeated to specify multiple groups.
--as-uidUID to impersonate for the operation.
--cache-dirDefault cache directory.
Default: $HOME/.kube/cache
--certificate-authorityPath to a cert file for the certificate authority.
--client-certificatePath to a client certificate file for TLS.
--client-keyPath to a client key file for TLS.
--clusterThe name of the kubeconfig cluster to use.
--contextThe name of the kubeconfig context to use.
--disable-compressionIf true, opt-out of response compression for all requests to the server.
--insecure-skip-tls-verifyIf true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
--kubeconfigPath to the kubeconfig file to use for CLI requests.
--log_backtrace_atWhen logging hits line file:N, emit a stack trace.
Default: 0
--log_dirIf non-empty, write log files in this directory (no effect when --logtostderr=true).
--log_fileIf non-empty, use this log file (no effect when --logtostderr=true).
--log_file_max_sizeDefines the maximum size a log file can grow to (no effect when --logtostderr=true). Unit is megabytes. If the value is 0, the maximum file size is unlimited.
Default: 1800
--logtostderrLog to standard error instead of files.
Default: true
--namespace
Aliases: -n
If present, the namespace scope for this CLI request.
--one_outputIf true, only write logs to their native severity level (vs also writing to each lower severity level. (no effect when --logtostderr=true).
--request-timeoutThe 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
--server
Aliases: -s
The address and port of the Kubernetes API server.
--skip_headersIf true, avoid header prefixes in the log messages.
--skip_log_headersIf true, avoid headers when opening log files (no effect when --logtostderr=true)
--stderrthresholdLogs at or above this threshold go to stderr when writing to files and stderr (no effect when --logtostderr=true or --alsologtostderr=true)
Default: 2
--tls-server-nameServer name to use for server certificate validation. If it is not provided, the hostname used to contact the server is used.
--tokenBearer token for authentication to the API server.
--userThe name of the kubeconfig user to use.
--v
Aliases: -v
Number for the log level verbosity.
--vmodule-moduleSpecComma-separated list of pattern=N settings for file-filtered logging.