etcdctl(1)
πΈ 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 alarmsalarm listβ Lists all alarmsauth disableβ Disables authenticationauth enableβ Enables authenticationcheck datascaleβ Check the memory usage of holding data for different workloads on a given server endpoint.check perfβ Check the performance of the etcd clustercompactionβ Compacts the event history in etcdcompletion bashβ Generate the autocompletion script for bashcompletion fishβ Generate the autocompletion script for fishcompletion powershellβ Generate the autocompletion script for powershellcompletion zshβ Generate the autocompletion script for zshdefragβ Defragments the storage of the etcd members with given endpointsdelβ Removes the specified key or range of keys[key, range_end)electβ Observes and participates in leader electionendpoint hashkvβ Prints the KV history hash for each endpoint in--endpointsendpoint healthβ Checks the healthiness of endpoints specified in--endpointsflagendpoint statusβ Prints out the status of endpoints specified in--endpointsflaggetβ Gets the key or a range of keyshelpβ Help about any commandlease grantβ Creates leaseslease keep-aliveβ Keeps leases alive (renew)lease listβ List all active leaseslease revokeβ Revokes leaseslease timetoliveβ Get lease informationlockβ Acquires a named lockmake-mirrorβ Makes a mirror at the destination etcd clustermember addβ Adds a member into the clustermember listβ Lists all members in the clustermember promoteβ Promotes a non-voting member in the clustermember removeβ Removes a member from the clustermember updateβ Updates a member in the clustermigrateβ Migrates keys in a v2 store to a mvcc storemove-leaderβ Transfers leadership to another etcd cluster member.putβ Puts the given key into the storerole addβ Adds a new rolerole deleteβ Deletes a rolerole getβ Gets detailed information of a rolerole grant-permissionβ Grants a key to a rolerole listβ Lists all rolesrole revoke-permissionβ Revokes a key from a rolesnapshot restoreβ Restores an etcd member snapshot to an etcd directorysnapshot saveβ Stores an etcd node backend snapshot to a given filesnapshot statusβ Gets backend snapshot status of a given filetxnβ Txn processes all the requests in one transactionuser addβ Adds a new useruser deleteβ Deletes a useruser getβ Gets detailed information of a useruser grant-roleβ Grants a role to a useruser listβ Lists all usersuser passwdβ Changes password of useruser revoke-roleβ Revokes a role from a userversionβ Prints the version of etcdctlwatchβ 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,--useroption 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 directorycluster-healthβ check the health of the etcd clustermkβ make a new key with a given valuemkdirβ make a new directoryrmβ remove a key or a directoryrmdirβ removes the key if it is an empty directory or a key-value pairgetβ retrieve the value of a keylsβ retrieve a directorysetβ set the value of a keysetdirβ create a new directory or update an existing directory TTLupdateβ update an existing key with a given valueupdatedirβ update an existing directorywatchβ watch a key for changesexec-watchβ watch a key for changes and exec an executablememberβ member add, remove and list subcommandsuserβ user add, grant and revoke subcommandsroleβ role add, grant and revoke subcommandsauthβ overall auth controlshelp,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,extendedorjson) (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β provideusername[: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 π--peersand--endpointare deprecated, use--endpointsinstead, 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
- debian trixie: etcd-client 3.5.16-4
- ubuntu questing: etcd-client 3.5.16-4
- ubuntu resolute: etcd-client 3.5.16-10
- ubuntu stonking: etcd-client 3.5.30-2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms