Skip to content

Commit

Permalink
Use HashiCorp Vault to fetch password required by MariaDB MaxScale
Browse files Browse the repository at this point in the history
  • Loading branch information
pratik705 committed Mar 24, 2024
1 parent 1e063ca commit f17de43
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/infrastructure-mariadb.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ kubectl exec --stdin=true --tty=true vault-0 -n vault -- \
kubectl exec --stdin=true --tty=true vault-0 -n vault -- \
vault kv put -mount=osh/mariadb mariadb-root-password root-password=$(< /dev/urandom tr -dc _A-Za-z0-9 | head -c${1:-32};echo;)
```

- MaxScale password:
``` shell
kubectl exec --stdin=true --tty=true vault-0 -n vault -- \
Expand Down
1 change: 1 addition & 0 deletions kustomize/mariadb-cluster/base/vault/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ resources:
- vaultauth.yaml
- vaultconnection.yaml
- mariadb-root-password.yaml
- mariadb-maxscale.yaml
24 changes: 24 additions & 0 deletions kustomize/mariadb-cluster/base/vault/mariadb-maxscale.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: secrets.hashicorp.com/v1beta1
kind: VaultStaticSecret
metadata:
name: maxscale
namespace: openstack
spec:
type: kv-v2

# mount path
mount: 'osh/mariadb'

# path of the secret
path: maxscale

# dest k8s secret
destination:
name: maxscale
create: true

# static secret refresh interval
refreshAfter: 30s

# Name of the CRD to authenticate to Vault
vaultAuthRef: vault-auth

0 comments on commit f17de43

Please sign in to comment.