Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use HashiCorp Vault for OSH deployment #151

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
87e18cc
Use HashiCorp Vault for MariaDB and Keystone deployment
pratik705 Mar 13, 2024
2ac53fe
Merge branch 'main' into vault-integration
pratik705 Mar 22, 2024
5a4b807
Use HashiCorp Vault for Glance deployment
pratik705 Mar 23, 2024
1e063ca
Merge branch 'main' into vault-integration
pratik705 Mar 24, 2024
f17de43
Use HashiCorp Vault to fetch password required by MariaDB MaxScale
pratik705 Mar 24, 2024
48f89a6
Fix rootPasswordSecretKeyRef to point correct values from Vault
pratik705 Mar 24, 2024
08d9f92
Fix typo in vault/glance-admin and update mariadb-root-password vault…
pratik705 Mar 25, 2024
d5e932e
Use HashiCorp Vault for Heat deployment
pratik705 Mar 25, 2024
7eab299
Add username to the vault for Keystone and Glance Rabbitmq secret
pratik705 Mar 26, 2024
7b19a18
Revert change in the mariadb secret naming convention
pratik705 Mar 26, 2024
3c41fa6
Fix typo is vault secret path
pratik705 Mar 26, 2024
053004b
Use HashiCorp Vault for Cinder deployment
pratik705 Mar 26, 2024
39e129d
Use HashiCorp Vault for Compute Kit deployment
pratik705 Mar 26, 2024
d6e56ef
Use HashiCorp Vault for Horizon deployment
pratik705 Mar 26, 2024
c6f604d
Use HashiCorp Vault for Skyline deployment
pratik705 Mar 27, 2024
58541f7
Use HashiCorp Vault for Octavia deployment
pratik705 Mar 28, 2024
873de97
Use HashiCorp Vault for Gnocchi deployment
pratik705 Mar 28, 2024
c941292
Use HashiCorp Vault for Ceilometer deployment
pratik705 Mar 28, 2024
b74daee
Use HashiCorp Vault for PostgreSQL deployment
pratik705 Mar 28, 2024
bd1139c
Fix mariadb vaultstaticsecret name
pratik705 Mar 28, 2024
35b025f
Add example to create local user in vault
pratik705 Mar 29, 2024
21d109e
Merge branch 'main' into vault-integration
pratik705 Apr 2, 2024
33a6fd0
Update skyline-apiserver-secrets secret
pratik705 Apr 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 76 additions & 17 deletions docs/infrastructure-mariadb.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,5 @@
# Deploy the MariaDB Operator and a Galera Cluster

## Create secret

``` shell
# MariaDB
kubectl --namespace openstack \
create secret generic mariadb \
--type Opaque \
--from-literal=root-password="$(< /dev/urandom tr -dc _A-Za-z0-9 | head -c${1:-32};echo;)" \
--from-literal=password="$(< /dev/urandom tr -dc _A-Za-z0-9 | head -c${1:-32};echo;)"

# MaxScale
kubectl --namespace openstack \
create secret generic maxscale \
--type Opaque \
--from-literal=password="$(< /dev/urandom tr -dc _A-Za-z0-9 | head -c${1:-32};echo;)"
```

## Deploy the mariadb operator

``` shell
Expand All @@ -37,6 +20,82 @@ kubectl --namespace mariadb-system get pods -w

## Deploy the MariaDB Cluster

## Pre-requsites

- Vault should be installed by following the instructions in [vault documentation](https://docs.rackspacecloud.com/vault/)
- User has access to `osh/mariadb/` path in the Vault

## Create secrets in the vault:

### Login to the vault:
cloudnull marked this conversation as resolved.
Show resolved Hide resolved

``` shell
kubectl exec -it vault-0 -n vault -- \
vault login -method userpass username=mariadb
```

### List the existing secrets from `osh/mariadb/`:

``` shell
kubectl exec --stdin=true --tty=true vault-0 -n vault -- \
vault kv list osh/mariadb
```

### Create the secrets

- Mariadb root-password:

``` shell
kubectl exec --stdin=true --tty=true vault-0 -n vault -- \
vault kv put -mount=osh/mariadb mariadb 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 -- \
vault kv put -mount=osh/mariadb maxscale password=$(< /dev/urandom tr -dc _A-Za-z0-9 | head -c${1:-32};echo;)
```

### Validate the secrets

``` shell
kubectl exec --stdin=true --tty=true vault-0 -n vault -- \
vault kv list osh/mariadb
kubectl exec --stdin=true --tty=true vault-0 -n vault -- \
vault kv get -mount=osh/mariadb mariadb
```

## Install mariadb cluster

- Ensure that the `vault-ca-secret` Kubernetes Secret exists in the OpenStack namespace containing the Vault CA certificate:

``` shell
kubectl get secret vault-ca-secret -o yaml -n openstack
```

- If it is absent, create one using the following command:

``` shell
kubectl create secret generic vault-ca-secret \
--from-literal=ca.crt="$(kubectl get secret vault-tls-secret \
-o jsonpath='{.data.ca\.crt}' -n vault | base64 -d -)" -n openstack
```

- Deploy the necessary Vault resources to create Kubernetes secrets required by the mariadb installation:

``` shell
kubectl apply -k /opt/genestack/kustomize/mariadb-cluster/base/vault
```

- Validate whether the required Kubernetes secrets from Vault are populated:

``` shell
kubectl get secrets -n openstack
```

### Deploy mariadb-cluster

``` shell
kubectl --namespace openstack apply -k /opt/genestack/kustomize/mariadb-cluster/base
```
Expand Down
99 changes: 85 additions & 14 deletions docs/infrastructure-postgresql.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,94 @@
# Deploy PostgreSQL

## Create Secrets
## Pre-requsites

- Vault should be installed by following the instructions in [vault documentation](https://docs.rackspacecloud.com/vault/)
- User has access to `osh/postgresql/` path in the Vault

## Create secrets in the vault:

### Login to the vault:

``` shell
kubectl exec -it vault-0 -n vault -- \
vault login -method userpass username=postgresql
```

### List the existing secrets from `osh/postgresql/`:

``` shell
kubectl exec --stdin=true --tty=true vault-0 -n vault -- \
vault kv list osh/postgresql
```

### Create the secrets

- Postgresql-identity-admin:

``` shell
kubectl exec --stdin=true --tty=true vault-0 -n vault -- \
vault kv put -mount=osh/postgresql postgresql-identity-admin password=$(< /dev/urandom tr -dc _A-Za-z0-9 | head -c${1:-32};echo;)
```

- Postgresql-db-admin:

``` shell
kubectl exec --stdin=true --tty=true vault-0 -n vault -- \
vault kv put -mount=osh/postgresql postgresql-db-admin password=$(< /dev/urandom tr -dc _A-Za-z0-9 | head -c${1:-32};echo;)
```

- Postgresql-db-exporter:

``` shell
kubectl exec --stdin=true --tty=true vault-0 -n vault -- \
vault kv put -mount=osh/postgresql postgresql-db-exporter password=$(< /dev/urandom tr -dc _A-Za-z0-9 | head -c${1:-32};echo;)
```

- Postgresql-db-audit:

``` shell
kubectl exec --stdin=true --tty=true vault-0 -n vault -- \
vault kv put -mount=osh/postgresql postgresql-db-audit password=$(< /dev/urandom tr -dc _A-Za-z0-9 | head -c${1:-32};echo;)
```

### Validate the secrets

``` shell
kubectl exec --stdin=true --tty=true vault-0 -n vault -- \
vault kv list osh/postgresql
kubectl exec --stdin=true --tty=true vault-0 -n vault -- \
vault kv get -mount=osh/postgresql postgresql-identity-admin
```

## Install PostgreSQL

- Ensure that the `vault-ca-secret` Kubernetes Secret exists in the OpenStack namespace containing the Vault CA certificate:

``` shell
kubectl get secret vault-ca-secret -o yaml -n openstack
```

- If it is absent, create one using the following command:

``` shell
kubectl create secret generic vault-ca-secret \
--from-literal=ca.crt="$(kubectl get secret vault-tls-secret \
-o jsonpath='{.data.ca\.crt}' -n vault | base64 -d -)" -n openstack
```

- Deploy the necessary Vault resources to create Kubernetes secrets required by the postgresql installation:

``` shell
kubectl apply -k /opt/genestack/kustomize/postgresql/base/vault
```

- Validate whether the required Kubernetes secrets from Vault are populated:

``` shell
kubectl --namespace openstack create secret generic postgresql-identity-admin \
--type Opaque \
--from-literal=password="$(< /dev/urandom tr -dc _A-Za-z0-9 | head -c${1:-32};echo;)"
kubectl --namespace openstack create secret generic postgresql-db-admin \
--type Opaque \
--from-literal=password="$(< /dev/urandom tr -dc _A-Za-z0-9 | head -c${1:-32};echo;)"
kubectl --namespace openstack create secret generic postgresql-db-exporter \
--type Opaque \
--from-literal=password="$(< /dev/urandom tr -dc _A-Za-z0-9 | head -c${1:-32};echo;)"
kubectl --namespace openstack create secret generic postgresql-db-audit \
--type Opaque \
--from-literal=password="$(< /dev/urandom tr -dc _A-Za-z0-9 | head -c${1:-32};echo;)"
kubectl get secrets -n openstack
```

## Run the package deployment
### Deploy PostgreSQL

!!! tip

Expand Down
91 changes: 80 additions & 11 deletions docs/openstack-ceilometer.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,89 @@
# Deploy Ceilometer

## Create Secrets
## Pre-requsites

- Vault should be installed by following the instructions in [vault documentation](https://docs.rackspacecloud.com/vault/)
- User has access to `osh/ceilometer/` path in the Vault

## Create secrets in the vault

### Login to the vault

``` shell
kubectl exec -it vault-0 -n vault -- \
vault login -method userpass username=ceilometer
```

### List the existing secrets from `osh/ceilometer/`:

``` shell
kubectl exec --stdin=true --tty=true vault-0 -n vault -- \
vault kv list osh/ceilometer
```

### Create the secrets

- Ceilometer-keystone-admin-password:

``` shell
kubectl exec --stdin=true --tty=true vault-0 -n vault -- \
vault kv put osh/ceilometer/ceilometer-keystone-admin-password password=$(< /dev/urandom tr -dc _A-Za-z0-9 | head -c${1:-32};echo;)
```

- Ceilometer-keystone-test-password:

``` shell
kubectl exec --stdin=true --tty=true vault-0 -n vault -- \
vault kv put -mount=osh/ceilometer ceilometer-keystone-test-password \
password=$(< /dev/urandom tr -dc _A-Za-z0-9 | head -c${1:-32};echo;)
```

- Ceilometer-rabbitmq-password:

``` shell
kubectl exec --stdin=true --tty=true vault-0 -n vault -- \
vault kv put -mount=osh/ceilometer ceilometer-rabbitmq-password \
password=$(< /dev/urandom tr -dc _A-Za-z0-9 | head -c${1:-32};echo;)
```

### Validate the secrets

``` shell
kubectl exec --stdin=true --tty=true vault-0 -n vault -- \
vault kv list osh/ceilometer
kubectl exec --stdin=true --tty=true vault-0 -n vault -- \
vault kv get -mount=osh/ceilometer ceilometer-keystone-admin-password
```

## Install Ceilometer

- Ensure that the `vault-ca-secret` Kubernetes Secret exists in the OpenStack namespace containing the Vault CA certificate:

```shell
kubectl get secret vault-ca-secret -o yaml -n openstack
```

- If it is absent, create one using the following command:

``` shell
kubectl create secret generic vault-ca-secret \
--from-literal=ca.crt="$(kubectl get secret vault-tls-secret \
-o jsonpath='{.data.ca\.crt}' -n vault | base64 -d -)" -n openstack
```

- Deploy the necessary Vault resources to create Kubernetes secrets required by the Ceilometer installation:

``` shell
kubectl apply -k /opt/genestack/kustomize/ceilometer/base/vault/
```

- Validate whether the required Kubernetes secrets from Vault are populated:

``` shell
kubectl --namespace openstack create secret generic ceilometer-keystone-admin-password \
--type Opaque \
--from-literal=password="$(< /dev/urandom tr -dc _A-Za-z0-9 | head -c${1:-32};echo;)"
kubectl --namespace openstack create secret generic ceilometer-keystone-test-password \
--type Opaque \
--from-literal=password="$(< /dev/urandom tr -dc _A-Za-z0-9 | head -c${1:-32};echo;)"
kubectl --namespace openstack create secret generic ceilometer-rabbitmq-password \
--type Opaque \
--from-literal=password="$(< /dev/urandom tr -dc _A-Za-z0-9 | head -c${1:-32};echo;)"
kubectl get secrets -n openstack
```

## Run the package deployment
### Deploy Ceilometer helm chart

``` shell
cd /opt/genestack/submodules/openstack-helm
Expand Down
Loading
Loading