forked from kubernetes/website
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request kubernetes#6 from lucperkins/lperkins/getting-star…
…ted-guide [WIP] Add download/build doc
- Loading branch information
Showing
23 changed files
with
284 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
document.addEventListener("DOMContentLoaded", function(e) { | ||
anchors.options = { | ||
icon: '#' | ||
} | ||
|
||
anchors.add('.docs-content h2, .docs-content h3'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,150 @@ | ||
--- | ||
title: Download and build etcd | ||
description: Run etcd locally on [Linux](#linux), [macOS](#macos), and [Docker](#docker) using [static binaries](#binary). Or build [from source](#source). | ||
--- | ||
|
||
There are two main ways to install etcd and etcdctl: | ||
|
||
* From [static binaries](#binary) | ||
* By building [from source](#source) | ||
|
||
{{< info >}} | ||
The instructions in this document are for the latest version of etcd, version **{{< latest >}}**. | ||
{{< /info >}} | ||
|
||
{{< requirement title="System requirements" >}} | ||
The etcd performance benchmarks run etcd on: | ||
|
||
* 8 vCPU | ||
* 16GB RAM | ||
* 50GB SSD [Google Compute Engine](https://cloud.google.com/compute/) (GCE) | ||
* 50GB SSD [Google Compute Engine](https://cloud.google.com/compute/) (GCE) instances | ||
|
||
Any relatively modern machine with low latency storage and a few gigabytes of memory, however, should suffice for most use cases. Applications with large v2 data stores will require more memory than a large v3 data store since data is kept in anonymous memory instead of memory mapped from a file. For running etcd on a cloud provider, we suggest at least a medium instance on AWS or a [standard-1](https://cloud.google.com/compute/docs/machine-types#standard_machine_types) instance on GCE. | ||
{{< /requirement >}} | ||
|
||
## Installing from a pre-built binary {#binary} | ||
|
||
The easiest way to install etcd is by fetching one of the binaries available for [Linux](#linux), [macOS](#macos), and [Docker](#docker). All binaries are available via both Google Cloud Storage and [GitHub Releases](https://github.com/etcd-io/etcd/releases/download). | ||
|
||
### Linux | ||
|
||
The following will install two executables, `etcd` and `etcdctl`, in a temporary directory at `/tmp/etcd-download-test`: | ||
|
||
```bash | ||
ETCD_VER=v{{< latest >}} | ||
|
||
# choose either URL | ||
GOOGLE_URL=https://storage.googleapis.com/etcd | ||
GITHUB_URL=https://github.com/etcd-io/etcd/releases/download | ||
ROOT_URL=${GOOGLE_URL} # or set to GITHUB_URL | ||
DOWNLOAD_URL=${ROOT_URL}/${ETCD_VER}/etcd-${ETCD_VER}-linux-amd64.tar.gz | ||
|
||
rm -f /tmp/etcd-${ETCD_VER}-linux-amd64.tar.gz | ||
rm -rf /tmp/etcd-download-test && mkdir -p /tmp/etcd-download-test | ||
|
||
curl -L ${DOWNLOAD_URL} -o /tmp/etcd-${ETCD_VER}-linux-amd64.tar.gz | ||
tar xzvf /tmp/etcd-${ETCD_VER}-linux-amd64.tar.gz -C /tmp/etcd-download-test --strip-components=1 | ||
rm -f /tmp/etcd-${ETCD_VER}-linux-amd64.tar.gz | ||
|
||
# Add the temporary dir to your path | ||
PATH=/tmp/etcd-download-test:${PATH} | ||
|
||
etcd --version | ||
# should return "etcd Version: {{< latest >}}" | ||
|
||
ETCDCTL_API=3 etcdctl version | ||
# should return "etcd Version: {{< latest >}}" | ||
``` | ||
|
||
### macOS | ||
|
||
The following will install two executables, `etcd` and `etcdctl`, in a temporary directory at `/tmp/etcd-download-test`: | ||
|
||
```bash | ||
ETCD_VER=v{{< latest >}} | ||
|
||
# choose either URL | ||
GOOGLE_URL=https://storage.googleapis.com/etcd | ||
GITHUB_URL=https://github.com/etcd-io/etcd/releases/download | ||
ROOT_URL=${GOOGLE_URL} # or set to GITHUB_URL | ||
DOWNLOAD_URL=${ROOT_URL}/${ETCD_VER}/etcd-${ETCD_VER}-darwin-amd64.zip | ||
|
||
rm -f /tmp/etcd-${ETCD_VER}-darwin-amd64.zip | ||
rm -rf /tmp/etcd-download-test && mkdir -p /tmp/etcd-download-test | ||
|
||
curl -L ${DOWNLOAD_URL} -o /tmp/etcd-${ETCD_VER}-darwin-amd64.zip | ||
unzip /tmp/etcd-${ETCD_VER}-darwin-amd64.zip -d /tmp && rm -f /tmp/etcd-${ETCD_VER}-darwin-amd64.zip | ||
mv /tmp/etcd-${ETCD_VER}-darwin-amd64/* /tmp/etcd-download-test && rm -rf mv /tmp/etcd-${ETCD_VER}-darwin-amd64 | ||
|
||
# Add the temporary dir to your path | ||
PATH=/tmp/etcd-download-test:${PATH} | ||
|
||
etcd --version | ||
# should return "etcd Version: {{< latest >}}" | ||
|
||
ETCDCTL_API=3 etcdctl version | ||
# should return "etcd Version: {{< latest >}}" | ||
``` | ||
|
||
### Docker | ||
|
||
[Docker](https://docker.com) images for etcd are hosted in [Google Container Registry](https://gcr.io), under the [etcd-development/etcd](https://gcr.io/etcd-development/etcd) project. | ||
|
||
The image for the latest version of etcd is `gcr.io/etcd-development/etcd:v{{< latest >}}`. | ||
|
||
To run the locally (applying the name `etcd` to the image): | ||
|
||
```bash | ||
docker run --name etcd \ | ||
gcr.io/etcd-development/etcd:{{< latest >}} | ||
``` | ||
|
||
Here are some example commands to execute against the running container: | ||
|
||
```bash | ||
docker exec etcd /bin/sh -c "/usr/local/bin/etcd --version" | ||
docker exec etcd /bin/sh -c "ETCDCTL_API=3 /usr/local/bin/etcdctl version" | ||
docker exec etcd /bin/sh -c "ETCDCTL_API=3 /usr/local/bin/etcdctl endpoint health" | ||
docker exec etcd /bin/sh -c "ETCDCTL_API=3 /usr/local/bin/etcdctl put foo bar" | ||
docker exec etcd /bin/sh -c "ETCDCTL_API=3 /usr/local/bin/etcdctl get foo" | ||
``` | ||
|
||
To kill the running container: | ||
|
||
```bash | ||
docker kill etcd | ||
``` | ||
|
||
## Building etcd from source {#source} | ||
|
||
In addition to installing etcd from [static binaries](#binary), you can also build etcd from source using the [etcd-io/etcd](https://github.com/etcd-io/etcd) repository on [GitHub](https://github.com). | ||
|
||
{{< requirement title="Install Go first" >}} | ||
In order to install etcd from source, you'll need to install [Go](https://golang.org) version **1.8 or above**. | ||
{{< /requirement >}} | ||
|
||
### Outside of `GOPATH` | ||
|
||
```bash | ||
git clone https://github.com/etcd-io/etcd.git | ||
cd etcd | ||
./build | ||
|
||
# run the resulting executable | ||
./bin/etcd | ||
``` | ||
|
||
### Using `go get` | ||
|
||
If you have `GOPATH` set: | ||
|
||
```bash | ||
echo $GOPATH | ||
|
||
go get github.com/etcd-io/etcd/cmd/etcd | ||
|
||
# run the resulting executable | ||
$GOPATH/bin/etcd | ||
``` | ||
|
||
## |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,5 +12,7 @@ | |
<body class="page"> | ||
{{ block "main" . }} | ||
{{ end }} | ||
|
||
{{ partial "javascript.html" . }} | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<section class="section"> | ||
<div class="content"> | ||
<div class="content docs-content"> | ||
{{ .Content }} | ||
</div> | ||
</section> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
<section class="hero is-primary"> | ||
<div class="hero-body"> | ||
<p class="title is-size-1 is-size-2-mobile has-text-weight-light"> | ||
<p class="title is-size-1 is-size-2-mobile has-text-weight-light{{ if .Params.description }} is-spaced{{ end }}"> | ||
{{ .Title }} | ||
</p> | ||
{{ with .Params.description }} | ||
<p class="subtitle is-size-4 is-size-5-mobile"> | ||
{{ . | markdownify }} | ||
</p> | ||
{{ end }} | ||
</div> | ||
</section> |
Oops, something went wrong.