The following migration plan should be carried out in each environment sequentially, starting with dev. It should be easy to roll-back, if any issues surface.
Stop the descriptor using the following command:
kubectl scale deployments/injector-jira --replicas=0
Kill the Flink Topology using the URLs outlined in the AWS Infra doc.
At this point, the services will be down and ready to migrate.
Using a terminal with access to both RDS instances (System of Record and the new Jira instance), run the following commands:
# Creates an intermediate file
PGPASSWORD=<pass> pg_dump -h sor.ph-dev.beescloud.com -p 5432 -U soradmin -C -n 'jira' data > db.sql
PGPASSWORD=<pass> psql -h sdm-ji-dev.beescloud.com -p 5432 -U soradmin -f db.sql postgres
# OR
# Without an intermediate file
PGPASSWORD=<pass> pg_dump -h sor.ph-dev.beescloud.com -p 5432 -U soradmin -C -n 'jira' data | PGPASSWORD=<pass> psql -h sdm-ji-dev.beescloud.com -p 5432 -U soradmin postgres
Domain Names:
sor.ph-dev.beescloud.com
&sdm-ji-dev.beescloud.com
sor.ph.beescloud.com
&sdm-ji.beescloud.com
sor.ph.cloudbees.com
&sdm-ji.cloudbees.com
Once migrated, verify that the tables exist and that data is in each table as expected.
Modify the deployment again, this time adjusting the environment variable to point to the metadata database.
kubectl edit deployments.apps/injector-jira
Change the spec.replica
to 1
and
# Please edit the object below. Lines beginning with a '#' will be ignored,
# and an empty file will abort the edit. If an error occurs while saving this file will be
# reopened with the relevant failures.
#
apiVersion: apps/v1
kind: Deployment
metadata:
...
spec:
...
template:
metatdata:
...
spec:
containers:
- env:
...
- name: METADATA_HOST
value: sor.ph-dev.beescloud.com <--- CHANGE THIS LINE
- name: METADATA_PORT
value: "5432"
- name: METADATA_DB
value: data
- name: QUARKUS_DATASOURCE_URL
value: jdbc:postgresql://sor.ph-dev.beescloud.com:5432/data?currentSchema=jira <-- CHANGE THIS LINE
- name: METADATA_USER
value: injector_jira
- name: QUARKUS_DATASOURCE_USERNAME
valueFrom:
secretKeyRef:
key: username
name: injector-jira-db-user
optional: false
- name: METADATA_PASS
value: vault://cloudbees/secret/development/ph-dev/k8s/ph-sor-injector-jira:injector_jira_db_user_password
- name: QUARKUS_DATASOURCE_PASSWORD
valueFrom:
secretKeyRef:
key: password
name: injector-jira-db-user
optional: false
Once you save the file, the pod should start creating. View the pod logs to ensure that it redeploys the topology - you can verify in the logs or in the running topology config that the topology has the correct METADATA_HOST
host value.
We can get support from Jordan/Ryan on this to trigger events and ensure that they flow through correctly.
@ryanwren @jordanglassman for the verification step above, can we either get your help or some advice on how we can verify all is well?