Skip to content

Instantly share code, notes, and snippets.

@yogendra
Created May 22, 2024 15:34
Show Gist options
  • Save yogendra/cc10b0f3b3918f3490b7fd672dc57c36 to your computer and use it in GitHub Desktop.
Save yogendra/cc10b0f3b3918f3490b7fd672dc57c36 to your computer and use it in GitHub Desktop.
Yugabyte ♥️ Vault
services:
yugabyted-0:
container_name: yugabyted-0
hostname: yugabyted-0
image: yugabytedb/yugabyte:2.20.3.1-b2
environment:
YSQL_PASSWORD: yugabyte
PGPASSWORD: yugabyte
PGSSLMODE: prefer
command:
- sh
- -c
- |
/home/yugabyte/bin/yugabyted start --fault_tolerance=zone --daemon=false --advertise_address=yugabyted-0 --ysql_enable_auth=true
restart: unless-stopped
cap_add:
- NET_ADMIN
ports:
- "7000:7000"
- "7100:7100"
- "9000:9000"
- "5433:5433"
- "15433:15433"
healthcheck:
test: ["CMD", "/home/yugabyte/postgres/bin/pg_isready", "-h", "yugabyted-0"]
interval: 10s
timeout: 5s
retries: 10
vault:
container_name: vault
hostname: vault
image: hashicorp/vault:latest
environment:
VAULT_DEV_ROOT_TOKEN_ID: testtoken
VAULT_TOKEN: testtoken
VAULT_LOG_LEVEL: debug
VAULT_ADDR: http://vault:8200
ports:
- 8200:8200
# privileged: true
healthcheck:
test: wget -qO- http://vault:8200/v1/sys/health &> /dev/null
interval: 10s
timeout: 5s
retries: 10
shell:
hostname: shell
container_name: shell
image: yugabytedb/yugabyte:2.20.3.1-b2
depends_on:
vault:
condition: service_healthy
yugabyted-0:
condition: service_healthy
environment:
VAULT_TOKEN: testtoken
VAULT_ADDR: http://vault:8200
PGSSLMODE: prefer
PGHOST: yugabyted-0
PGDATABASE: yugabyte
PGUSER: yugabyte
PGPASSWORD: yugabyte
command:
- sh
- -c
- |
ysqlsh -f share/northwind_ddl.sql
ysqlsh -f share/northwind_data.sql
yum install -qqy yum-utils
yum-config-manager -qqy --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
yum -qqy install vault ncurses
setcap -r /usr/bin/vault
echo "Sleeping forever"
tail -f /dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment