Skip to content

Commit

Permalink
fix: add barbican secrets and create not apply
Browse files Browse the repository at this point in the history
`apply` will overwrite the object if the secret changes, this could
result in accidentally changing all cluster secrets.
`create` will exit with an error if the object already exists which is
what we want.
  • Loading branch information
LukeRepko committed Aug 2, 2024
1 parent d7fb4d9 commit 13d51b9
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
30 changes: 30 additions & 0 deletions bin/create-secrets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ octavia_rabbitmq_password=$(generate_password 64)
octavia_db_password=$(generate_password 32)
octavia_admin_password=$(generate_password 32)
octavia_certificates_password=$(generate_password 32)
barbican_rabbitmq_password=$(generate_password 64)
barbican_db_password=$(generate_password 32)
barbican_admin_password=$(generate_password 32)
postgresql_identity_admin_password=$(generate_password 32)
postgresql_db_admin_password=$(generate_password 32)
postgresql_db_exporter_password=$(generate_password 32)
Expand Down Expand Up @@ -432,6 +435,33 @@ data:
---
apiVersion: v1
kind: Secret
metadata:
name: barbican-rabbitmq-password
namespace: openstack
type: Opaque
data:
password: $(echo -n $barbican_rabbitmq_password | base64 -w0)
---
apiVersion: v1
kind: Secret
metadata:
name: barbican-db-password
namespace: openstack
type: Opaque
data:
password: $(echo -n $barbican_db_password | base64 -w0)
---
apiVersion: v1
kind: Secret
metadata:
name: barbican-admin
namespace: openstack
type: Opaque
data:
password: $(echo -n $barbican_admin_password | base64 -w0)
---
apiVersion: v1
kind: Secret
metadata:
name: postgresql-identity-admin
namespace: openstack
Expand Down
4 changes: 2 additions & 2 deletions docs/infrastructure-namespace.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ Then you can create all needed secrets by running the create-secrets.sh command

That will create a kubesecrets.yaml file located in /etc/genestack

You can then apply them to kubernetes with the following command:
You can then apply it to kubernetes with the following command:

``` shell
kubectl apply -f /etc/genestack/kubesecrets.yaml -n openstack
kubectl create -f /etc/genestack/kubesecrets.yaml -n openstack
```

0 comments on commit 13d51b9

Please sign in to comment.