99- [ Installation Process] ( #installation-process )
1010- [ Deployment Commands Reference] ( #deployment-commands-reference )
1111- [ Monitoring Checks After Installation] ( #monitoring-checks-after-installation )
12- - [ Configuration Options] (#confi# Sync PostgreSQL password from K8s secret to secrets.yaml
13- ./bin/sync-k8s-secret-to-wire-secrets.sh \
14- wire-postgresql-external-secret \
15- password \
16- values/wire-server/secrets.yaml \
17- .brig.secrets.pgPassword \
18- .galley.secrets.pgPassword \
19- .spar.secrets.pgPassword \
20- .gundeck.secrets.pgPasswordon-options)
12+ - [ Configuration Options] ( #configuration-options )
2113- [ Node Recovery Operations] ( #node-recovery-operations )
2214- [ How It Confirms a Reliable System] ( #how-it-confirms-a-reliable-system )
2315- [ Kubernetes Integration] ( #kubernetes-integration )
@@ -784,65 +776,36 @@ The [`postgresql-wire-setup.yml`](../ansible/postgresql-playbooks/postgresql-wir
7847764. ✅ **Creates/updates PostgreSQL user** with the password
7857775. ✅ **Stores credentials** in Kubernetes for wire-server to use
786778
779+ If the `wire-postgresql-external-secret` is deleted, re-run the Ansible playbook `(ansible-playbook -i ansible/inventory/offline/hosts.ini ansible/postgresql-deploy.yml)` to recreate it and update the PostgreSQL user password. Then re-sync the password into `values/wire-server/secrets.yaml` as described in [Using Password in Wire-Server Configuration](#using-password-in-wire-server-configuration).
787780
788- # ## 📋 Running the Setup Playbook
789-
790- ` ` ` bash
791- # Run the wire-server database setup
792- ansible-playbook ansible/postgresql-playbooks/postgresql-wire-setup.yml \
793- -i ansible/inventory/offline/99-static
794- ` ` `
795781
796782# ## 🔧 Using Password in Wire-Server Configuration
797783
798- The deployment pipeline automatically manages PostgreSQL password synchronization between the Kubernetes secret and wire-server configuration.
799-
800- # ### **Automated Password Synchronization (CI/CD Pipeline)**
801-
802- The CI/CD pipeline ([bin/offline-deploy.sh](../bin/offline-deploy.sh)) automatically handles password synchronization :
784+ Keep the Wire server password in sync with the Kubernetes secret. Choose one of the following :
803785
804- 1. **PostgreSQL Setup** : ` postgresql-wire-setup.yml` creates/retrieves the K8s secret `wire-postgresql-external-secret`
805- 2. **Password Sync** : ` sync-k8s-secret-to-wire-secrets.sh` updates `values/wire-server/secrets.yaml` with the actual password
806- 3. **Helm Deployment** : ` offline-helm.sh` deploys wire-server using the updated `secrets.yaml` file
786+ # ### Automatic (preferred)
787+ - Orchestrated by the pipeline ([bin/offline-deploy.sh](../bin/offline-deploy.sh)) :
788+ 1. `postgresql-wire-setup.yml` ensures the K8s secret `wire-postgresql-external-secret` exists.
789+ 2. [`bin/sync-k8s-secret-to-wire-secrets.sh`](../bin/sync-k8s-secret-to-wire-secrets.sh) writes the password into `values/wire-server/secrets.yaml`.
790+ 3. `offline-helm.sh` deploys using the updated values file.
807791
808- **Key Script:**
809- - [`bin/sync-k8s-secret-to-wire-secrets.sh`](../bin/sync-k8s-secret-to-wire-secrets.sh) - Generic script to synchronize any K8s secret to YAML files
810-
811- **Benefits:**
812- - ✅ No manual password management required
813- - ✅ Passwords are automatically generated (32-char random string)
814- - ✅ Source of truth is the Kubernetes secret
815- - ✅ Automatic backup before password updates
816- - ✅ Generic design supports any secret/YAML combination
817-
818- # ### **Manual Password Synchronization**
819-
820- For manual deployments or troubleshooting, use the generic sync script within the docker container of the adminhost :
792+ # ### Manual sync
793+ Use the generic sync script to copy the password from the K8s secret into your values file :
821794
822795` ` ` bash
823- For manual deployments or troubleshooting, use the generic sync script:
824-
825- ` ` ` bash
826- d bash
827796# Sync PostgreSQL password from K8s secret to secrets.yaml
828797./bin/sync-k8s-secret-to-wire-secrets.sh \
829798 wire-postgresql-external-secret \
830799 password \
831800 values/wire-server/secrets.yaml \
832801 .brig.secrets.pgPassword \
833- .galley.secrets.pgPassword
802+ .galley.secrets.pgPassword \
803+ .spar.secrets.pgPassword \
804+ .gundeck.secrets.pgPassword
834805` ` `
835806
836- This script:
837- - Retrieves password from ` wire-postgresql-external-secret `
838- - Updates multiple YAML paths in one command
839- - Creates a backup at ` secrets.yaml.bak `
840- - Verifies all updates succeeded
841- - Works with any Kubernetes secret and YAML file
842-
843- #### ** Alternative: Manual Password Override**
844-
845- For quick deployments or testing, override passwords during helm installation:
807+ # ### Helm override (optional)
808+ Skip editing files and pass the password at install/upgrade time :
846809
847810` ` ` bash
848811# Retrieve password from Kubernetes secret
@@ -859,22 +822,13 @@ helm upgrade --install wire-server ./charts/wire-server \
859822 --set galley.secrets.pgPassword="${PG_PASSWORD}"
860823` ` `
861824
862- ** Note:** For CI/CD deployments, the ` sync-k8s-secret-to-wire-secrets.sh ` script handles password synchronization automatically.
863-
864- #### ** Password Verification**
865-
866- Verify password synchronization across all components:
825+ # ### Verify
826+ Confirm the secret and values are consistent and components can connect :
867827
868828` ` ` bash
869- # Run the validation script
870829./bin/sync-k8s-secret-to-wire-server-values.sh
871830` ` `
872831
873- This checks:
874- - K8s secret ` wire-postgresql-external-secret ` exists and contains valid password
875- - Brig and Galley secrets in Kubernetes match the PostgreSQL password
876- - All components can connect to PostgreSQL
877-
878832---
879833
880834**🔐 Important Notes:**
0 commit comments