https://github.com/juliocesarscheidt/etcd-project
https://github.com/juliocesarscheidt/etcd-project
codefresh docker etcd k8s
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/juliocesarscheidt/etcd-project
- Owner: juliocesarscheidt
- License: mit
- Created: 2020-01-29T03:01:18.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-03-17T02:33:49.000Z (about 2 years ago)
- Last Synced: 2025-03-18T02:44:16.999Z (about 1 year ago)
- Topics: codefresh, docker, etcd, k8s
- Language: JavaScript
- Homepage:
- Size: 716 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# ETCD Project

> This is a simple API project made with Node, Express, using key-value store with ETCD, running in containers with Docker and deploy with K8S
## Instructions
### About ETCD
- ETCD is an open source distributed key-value store that uses Raft Consensus Algorithm, written in Go.
[[GitHub](https://github.com/etcd-io/etcd)]
[[Docs](https://etcd.io/docs/v3.4.0/)]
### Running with Docker
```bash
docker-compose up -d
```
### Running with K8S
```bash
chmod +x deploy.sh && \
bash deploy.sh
```
### Running Etcd appart
```bash
export DATA_DIR="data.etcd"
export CLUSTER_TOKEN="TOKEN"
export CLUSTER_STATE="new"
export CLUSTER_NAME="etcdserver"
export LISTEN_ADDR="http://0.0.0.0:2380"
export CLUSTER="${CLUSTER_NAME}=${LISTEN_ADDR}"
nohup etcd --data-dir=${DATA_DIR} \
--name ${CLUSTER_NAME} \
--initial-cluster ${CLUSTER} \
--initial-cluster-state ${CLUSTER_STATE} \
--initial-cluster-token ${CLUSTER_TOKEN} \
--listen-peer-urls ${LISTEN_ADDR} \
--initial-advertise-peer-urls ${LISTEN_ADDR} \
--listen-client-urls http://0.0.0.0:2379 \
--advertise-client-urls http://0.0.0.0:2379 \
--debug=false \
--auto-tls=false \
--peer-auto-tls=false \
--enable-pprof=false \
--metrics=basic \
--auth-token=simple \
--auto-compaction-retention=6 \
--enable-v2=true \
--force-new-cluster=false
# or, run with a config file in background
export ETCD_CONFIG_FILE=./etcd/etcd.conf.yaml
nohup etcd --config-file ${ETCD_CONFIG_FILE} &
```