etcdctl(1)

πŸ“¦
version 3.5.30 Β· 3 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

🌸 etcdctl β€” the manual page, but make it slay 🌸

okay bestie, welcome to the etcdctl(1) page, filed under User Commands ✨ β€” it's a whole command-line client for etcd and honestly it's kind of a lot, so grab a boba and let's get into it πŸ§‹πŸ’–

⚠️ WARNING ⚠️

Not me starting with a warning but it's IMPORTANT. Set the environment variable ETCDCTL_API=3 to use the v3 API, or set ETCDCTL_API=2 to use the v2 API. Pick your fighter πŸ’…


πŸ¦‹ USAGE πŸ¦‹

etcdctl [options] command [command options] [arguments...]

that's the shape of it, periodt ✨


πŸ‘‘ COMMANDS V3 πŸ‘‘

okay so this is the main character section. every command, no skips, we're doing this properly πŸ”₯

  • alarm disarm β€” Disarms all alarms
  • alarm list β€” Lists all alarms
  • auth disable β€” Disables authentication
  • auth enable β€” Enables authentication
  • check datascale β€” Check the memory usage of holding data for different workloads on a given server endpoint.
  • check perf β€” Check the performance of the etcd cluster
  • compaction β€” Compacts the event history in etcd
  • completion bash β€” Generate the autocompletion script for bash
  • completion fish β€” Generate the autocompletion script for fish
  • completion powershell β€” Generate the autocompletion script for powershell
  • completion zsh β€” Generate the autocompletion script for zsh
  • defrag β€” Defragments the storage of the etcd members with given endpoints
  • del β€” Removes the specified key or range of keys [key, range_end)
  • elect β€” Observes and participates in leader election
  • endpoint hashkv β€” Prints the KV history hash for each endpoint in --endpoints
  • endpoint health β€” Checks the healthiness of endpoints specified in --endpoints flag
  • endpoint status β€” Prints out the status of endpoints specified in --endpoints flag
  • get β€” Gets the key or a range of keys
  • help β€” Help about any command
  • lease grant β€” Creates leases
  • lease keep-alive β€” Keeps leases alive (renew)
  • lease list β€” List all active leases
  • lease revoke β€” Revokes leases
  • lease timetolive β€” Get lease information
  • lock β€” Acquires a named lock
  • make-mirror β€” Makes a mirror at the destination etcd cluster
  • member add β€” Adds a member into the cluster
  • member list β€” Lists all members in the cluster
  • member promote β€” Promotes a non-voting member in the cluster
  • member remove β€” Removes a member from the cluster
  • member update β€” Updates a member in the cluster
  • migrate β€” Migrates keys in a v2 store to a mvcc store
  • move-leader β€” Transfers leadership to another etcd cluster member.
  • put β€” Puts the given key into the store
  • role add β€” Adds a new role
  • role delete β€” Deletes a role
  • role get β€” Gets detailed information of a role
  • role grant-permission β€” Grants a key to a role
  • role list β€” Lists all roles
  • role revoke-permission β€” Revokes a key from a role
  • snapshot restore β€” Restores an etcd member snapshot to an etcd directory
  • snapshot save β€” Stores an etcd node backend snapshot to a given file
  • snapshot status β€” Gets backend snapshot status of a given file
  • txn β€” Txn processes all the requests in one transaction
  • user add β€” Adds a new user
  • user delete β€” Deletes a user
  • user get β€” Gets detailed information of a user
  • user grant-role β€” Grants a role to a user
  • user list β€” Lists all users
  • user passwd β€” Changes password of user
  • user revoke-role β€” Revokes a role from a user
  • version β€” Prints the version of etcdctl
  • watch β€” Watches events stream on keys or prefixes

the way that's like fifty commands 😭 but we got through it 🫢


✨ OPTIONS V3 ✨

every flag, every default, exactly as written, iykyk πŸ’œ

  • --cacert="" β€” verify certificates of TLS-enabled secure servers using this CA bundle
  • --cert="" β€” identify secure client using this TLS certificate file
  • --command-timeout=5s β€” timeout for short running command (excluding dial timeout)
  • --debug[=false] β€” enable client-side debug logging
  • --dial-timeout=2s β€” dial timeout for client connections
  • -d, --discovery-srv="" β€” domain name to query for SRV records describing cluster endpoints
  • --discovery-srv-name="" β€” service name to query when using DNS discovery
  • --endpoints=[127.0.0.1:2379] β€” gRPC endpoints
  • -h, --help[=false] β€” help for etcdctl
  • --hex[=false] β€” print byte strings as hex encoded strings
  • --insecure-discovery[=true] β€” accept insecure SRV records describing cluster endpoints
  • --insecure-skip-tls-verify[=false] β€” skip server certificate verification (CAUTION: this option should be enabled only for testing purposes)
  • --insecure-transport[=true] β€” disable transport security for client connections
  • --keepalive-time=2s β€” keepalive time for client connections
  • --keepalive-timeout=6s β€” keepalive timeout for client connections
  • --key="" β€” identify secure client using this TLS key file
  • --password="" β€” password for authentication (if this option is used, --user option shouldn't include password)
  • --user="" β€” username[:password] for authentication (prompt if password is not supplied)
  • -w, --write-out="simple" β€” set the output format (fields, json, protobuf, simple, table)
bestie, real talk: --insecure-skip-tls-verify says it should be enabled only for testing purposes. do NOT ship that to prod, i'm begging πŸ™ˆ

🌈 COMMANDS V2 🌈

throwback section, the v2 era, still valid if you set that env var πŸ’«

  • backup β€” backup an etcd directory
  • cluster-health β€” check the health of the etcd cluster
  • mk β€” make a new key with a given value
  • mkdir β€” make a new directory
  • rm β€” remove a key or a directory
  • rmdir β€” removes the key if it is an empty directory or a key-value pair
  • get β€” retrieve the value of a key
  • ls β€” retrieve a directory
  • set β€” set the value of a key
  • setdir β€” create a new directory or update an existing directory TTL
  • update β€” update an existing key with a given value
  • updatedir β€” update an existing directory
  • watch β€” watch a key for changes
  • exec-watch β€” watch a key for changes and exec an executable
  • member β€” member add, remove and list subcommands
  • user β€” user add, grant and revoke subcommands
  • role β€” role add, grant and revoke subcommands
  • auth β€” overall auth controls
  • help, h β€” Shows a list of commands or help for one command

πŸŽ€ OPTIONS V2 πŸŽ€

the old guard, same deal, nothing skipped πŸ’–

  • --debug β€” output cURL commands which can be used to reproduce the request
  • --no-sync β€” don't synchronize cluster information before sending request
  • --output simple, -o simple β€” output response in the given format (simple, extended or json) (default: "simple")
  • --discovery-srv value, -D value β€” domain name to query for SRV records describing cluster endpoints
  • --insecure-discovery β€” accept insecure SRV records describing cluster endpoints
  • --peers value, -C value β€” DEPRECATED β€” "--endpoints" should be used instead
  • --endpoint value β€” DEPRECATED β€” "--endpoints" should be used instead
  • --endpoints value β€” a comma-delimited list of machine addresses in the cluster (default: "http://127.0.0.1:2379,http://127.0.0.1:4001")
  • --cert-file value β€” identify HTTPS client using this SSL certificate file
  • --key-file value β€” identify HTTPS client using this SSL key file
  • --ca-file value β€” verify certificates of HTTPS-enabled servers using this CA bundle
  • --username value, -u value β€” provide username[:password] and prompt if password is not supplied.
  • --timeout value β€” connection timeout per request (default: 2s)
  • --total-timeout value β€” timeout for the command execution (except watch) (default: 5s)
  • --help, -h β€” show help
  • --version, -v β€” print the version
not the deprecated flags just vibing there πŸ’€ --peers and --endpoint are deprecated, use --endpoints instead, fr fr.

🫢 SEE ALSO 🫢

  • ectd(1)

(yes it's spelled that way in the source, i'm not touching it, it's iconic in its own way πŸ˜­πŸ‘‘)


and that's the whole page!! you ate that. go forth and etcdctl responsibly ✨

signing off with all the love: this was etcdctl from version 3.4.23, dated January 2022 πŸ’–πŸ¦‹ no cap, you're gonna do great πŸŽ€

πŸ“¦ where this page comes from