feat(openbao): lab7 enable TLS and persistent Raft storage
This commit is contained in:
@@ -9,6 +9,23 @@ x-api-resources: &api-resources
|
|||||||
memory: "${API_MEMORY_RESERVATION:-64M}"
|
memory: "${API_MEMORY_RESERVATION:-64M}"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
openbao:
|
||||||
|
image: openbao/openbao:2.5.4
|
||||||
|
command: ["server", "-config=/etc/bao/server.hcl"]
|
||||||
|
restart: unless-stopped
|
||||||
|
environment:
|
||||||
|
BAO_ADDR: https://openbao:8200
|
||||||
|
BAO_CACERT: /tls/ca.crt
|
||||||
|
volumes:
|
||||||
|
- ./infra/openbao/server.hcl:/etc/bao/server.hcl:ro
|
||||||
|
- ./certs/private/openbao/server.crt:/tls/server.crt:ro
|
||||||
|
- ./certs/private/openbao/server.key:/tls/server.key:ro
|
||||||
|
- ./certs/private/ingress/ca.crt:/tls/ca.crt:ro
|
||||||
|
- openbao_data:/openbao/file
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:18200:8200"
|
||||||
|
networks: [internal]
|
||||||
|
|
||||||
postgres:
|
postgres:
|
||||||
image: postgres:16.4-alpine
|
image: postgres:16.4-alpine
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
@@ -587,6 +604,7 @@ secrets:
|
|||||||
file: ./certs/private/minio/reconciler.secret
|
file: ./certs/private/minio/reconciler.secret
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
|
openbao_data:
|
||||||
postgres_socket:
|
postgres_socket:
|
||||||
postgres_data:
|
postgres_data:
|
||||||
redis_data:
|
redis_data:
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
disable_mlock = true
|
||||||
|
api_addr = "https://openbao:8200"
|
||||||
|
cluster_addr = "https://openbao:8201"
|
||||||
|
storage "raft" {
|
||||||
|
path = "/openbao/file"
|
||||||
|
node_id = "lab7"
|
||||||
|
}
|
||||||
|
listener "tcp" {
|
||||||
|
address = "0.0.0.0:8200"
|
||||||
|
tls_cert_file = "/tls/server.crt"
|
||||||
|
tls_key_file = "/tls/server.key"
|
||||||
|
tls_client_ca_file = "/tls/ca.crt"
|
||||||
|
tls_min_version = "tls12"
|
||||||
|
}
|
||||||
Executable
+9
@@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -eu
|
||||||
|
set -- openbao
|
||||||
|
. "$(dirname "$0")/dependency-pki.sh"
|
||||||
|
printf '%s\n' 'subjectAltName=DNS:openbao,DNS:localhost,IP:127.0.0.1' extendedKeyUsage=serverAuth basicConstraints=critical,CA:FALSE > "$tmp/ext"
|
||||||
|
openssl req -new -key "$tmp/server.key" -subj /CN=openbao -out "$tmp/request"
|
||||||
|
openssl x509 -req -days 30 -sha256 -in "$tmp/request" -CA "$ca/ca.crt" -CAkey "$ca/ca.key" -set_serial "0x$(openssl rand -hex 16)" -extfile "$tmp/ext" -out "$tmp/server.crt"
|
||||||
|
rm "$tmp/request" "$tmp/ext"
|
||||||
|
finish
|
||||||
Reference in New Issue
Block a user