Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added 'Getting started with etcdctl' page and also modified Quickstart page to link to the newly added page #476

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions content/en/docs/v3.5/Getting-started-with-etcdctl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
title: Getting started with etcdctl
weight: 3250
description: "etcdctl: a command line tool for interacting with the etcd server"
---
Users mostly interact with etcd by putting or getting the value of a key. This page describes how to do that by using etcdctl, a command line tool for interacting with etcd server and also points to various links for more detailed explanations on important/advanced topics. The concepts described here should apply to the gRPC APIs or client library APIs.

The API version used by etcdctl to speak to etcd may be set to version `2` or `3` via the `ETCDCTL_API` environment variable. By default, etcdctl on master (3.4) uses the v3 API and earlier versions (3.3 and earlier) default to the v2 API.

Note that any key that was created using the v2 API will not be able to be queried via the v3 API. A v3 API ```etcdctl get``` of a v2 key will exit with 0 and no key data, this is the expected behaviour.


```bash
export ETCDCTL_API=3
```

+ To get started with installing and setting up an etcd cluster, follow the instructions in **[Install]( ../../../docs/v3.5/install)** page of the documentation.

+ To configure local etcd cluster for testing and development purposes, visit **[Set up a local cluster](../../../docs/v3.5/dev-guide/local_cluster)** for more details.

Once the etcd cluster is set up and running, it might be a good option to know the versions of etcdctl and Server API in order to find the appropriate commands to be used for performing various operations on etcd.

Here is the command to find the versions:

```bash
$ etcdctl version
etcdctl version: 3.1.0-alpha.0+git
API version: 3.1
```
To **write a key** to be stored into the etcd cluster, below is the command to set the value of a key `foo` to `bar`:

```bash
$ etcdctl put foo bar
OK
```

Similarly, to **read the values of keys** from an etcd cluster, here is the command to read the value of the key `foo`:

```bash
$ etcdctl get foo
foo
bar
```

To know more about all the functionalities that etcdctl offers, visit **[Interacting with etcd](../../../docs/v3.5/dev-guide/interacting_v3)** for more details.
2 changes: 2 additions & 0 deletions content/en/docs/v3.5/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,15 @@ Learn about more ways to configure and use etcd from the following pages:
- Explore the gRPC [API][].
- Set up a [multi-machine cluster][clustering].
- Learn how to [configure][] etcd.
- Learn how to get started with [etcdctl][].
- Find [language bindings and tools][integrations].
- Use TLS to [secure an etcd cluster][security].
- [Tune etcd][tuning].

[api]: /docs/{{< param version >}}/learning/api
[clustering]: /docs/{{< param version >}}/op-guide/clustering
[configure]: /docs/{{< param version >}}/op-guide/configuration
[etcdctl]: /docs/{{< param version >}}/getting-started-with-etcdctl
[integrations]: /docs/{{< param version >}}/integrations
[security]: /docs/{{< param version >}}/op-guide/security
[tuning]: /docs/{{< param version >}}/tuning
Expand Down