File tree Expand file tree Collapse file tree 5 files changed +21
-13
lines changed
Expand file tree Collapse file tree 5 files changed +21
-13
lines changed Original file line number Diff line number Diff line change @@ -87,11 +87,21 @@ Or copy a backup file from it...
8787When you're done, use kubectl to delete the Pod.
8888
8989## Recovery (of a database)
90+ You can run the ` site-recovery.yaml ` playbook to recover data. What you need to do
91+ depends on your specific situation but typically you'll need to set suitable
92+ kubernetes and AWS/S3 variables: -
9093
9194 export K8S_AUTH_HOST=https://????
9295 export K8S_AUTH_API_KEY=????
9396 export K8S_AUTH_VERIFY_SSL=false
9497
98+ export AWS_ACCESS_KEY_ID=????
99+ export AWS_SECRET_ACCESS_KEY=????
100+
101+ And then run the playbook with your chosen parameters: -
102+
103+ ansible-playbook -e @parameters.yaml site-recovery.yaml
104+
95105## Testing
96106To test this repository (Normally done via GitHib Actions)
97107we essentially employ yaml and ansible lint code. From a suitable
Original file line number Diff line number Diff line change @@ -41,11 +41,8 @@ recovery_do_not_stop_on_error: no
4141recovery_wait_minutes : 60
4242
4343# Database (admin) credentials are in a secret in the namespace.
44- # The admin user and password are expected in the secret's: -
45- # - database_admin_user
46- # - database_admin_user_password
4744# We just need to supply the name of the Secret.
48- recovery_secret : postgres
45+ recovery_database_secret : database
4946
5047# Is the recovery volume expected to be an S3 mount?
5148recovery_volume_is_s3 : no
Original file line number Diff line number Diff line change 99 - recovery_namespace|string|length > 0
1010 - recovery_sa|string != 'SetMe'
1111 - recovery_sa|string|length > 0
12- - recovery_secret |string != 'SetMe'
13- - recovery_secret |string|length > 0
12+ - recovery_database_secret |string != 'SetMe'
13+ - recovery_database_secret |string|length > 0
1414 - recovery_database_expected_count|int >= 0
1515 - recovery_latest_backup_maximum_age_h|int >= 0
1616
5757 k8s_info :
5858 kind : Secret
5959 namespace : " {{ recovery_namespace }}"
60- name : " {{ recovery_secret }}"
60+ name : " {{ recovery_database_secret }}"
6161 register : secret_result
6262
6363- name : Assert secret
Original file line number Diff line number Diff line change @@ -33,15 +33,12 @@ spec:
3333 - name: PGHOST
3434 value: '{{ recovery_host }}'
3535 - name: PGUSER
36- valueFrom:
37- secretKeyRef:
38- name: {{ recovery_secret }}
39- key: database_admin_user
36+ value: '{{ recovery_database_admin_user }}'
4037 - name: PGADMINPASS
4138 valueFrom:
4239 secretKeyRef:
43- name: {{ recovery_secret }}
44- key: database_admin_user_password
40+ name: {{ recovery_database_secret }}
41+ key: {{ recovery_database_secret_admin_user_password_key }}
4542{% if recovery_do_not_stop_on_error %}
4643 - name: DO_NOT_STOP_ON_ERROR
4744 value: '1'
Original file line number Diff line number Diff line change @@ -22,3 +22,7 @@ wait_timeout: 600
2222wait_for_bind : no
2323# Volume binding timeout (seconds)
2424bind_timeout : 60
25+
26+ # Names of kesy in the database Secret
27+ recovery_database_admin_user : postgres
28+ recovery_database_secret_admin_user_password_key : root_password
You can’t perform that action at this time.
0 commit comments