Skip to content

Commit

Permalink
🐛 Use postgresql modules for migration
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Montleon <jmontleo@redhat.com>
  • Loading branch information
jmontleon committed Jul 22, 2024
1 parent 455abeb commit bbb0162
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions roles/tackle/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -241,26 +241,26 @@
dbm_user: "{{ pgsql_secret.resources[0].data['database-user'] | b64decode }}"
dbm_pass: "{{ pgsql_secret.resources[0].data['database-password'] | b64decode }}"

- name: ping source database
- name: Ping source database
postgresql_ping:
db: "{{ keycloak_database_db_name }}"
login_host: "{{ keycloak_database_service_k8s_resource_name }}"
login_user: "{{ dbm_user }}"
login_password: "{{ dbm_pass }}"
register: src_ping
retries: 12
until: src_ping.is_available
until: src_ping.is_available and src_ping.server_version.major == 12
delay: 10

- name: ping destination database
- name: Ping destination database
postgresql_ping:
db: "{{ keycloak_database_db_name }}"
login_host: "{{ keycloak_database_service_k8s_resource_name }}-migration"
login_user: "{{ dbm_user }}"
login_password: "{{ dbm_pass }}"
register: dst_ping
retries: 12
until: dst_ping.is_available
until: dst_ping.is_available and dst_ping.server_version.major == 15
delay: 10

- name: Dump database
Expand Down
6 changes: 3 additions & 3 deletions roles/tackle/templates/deployment-keycloak-postgresql.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ metadata:
name: {{ keycloak_database_deployment_name }}-{{ keycloak_database_db_version }}
namespace: {{ app_namespace }}
labels:
app.kubernetes.io/name: {{ keycloak_database_service_name }}
app.kubernetes.io/name: {{ keycloak_database_service_name }}-{{ keycloak_database_db_version }}
app.kubernetes.io/component: {{ keycloak_database_component_name }}
app.kubernetes.io/part-of: {{ app_name }}
version: "{{ keycloak_database_db_version }}"
spec:
replicas: {{ keycloak_database_deployment_replicas }}
selector:
matchLabels:
app.kubernetes.io/name: {{ keycloak_database_service_name }}
app.kubernetes.io/name: {{ keycloak_database_service_name }}-{{ keycloak_database_db_version }}
app.kubernetes.io/component: {{ keycloak_database_component_name }}
app.kubernetes.io/part-of: {{ app_name }}
version: "{{ keycloak_database_db_version }}"
Expand All @@ -24,7 +24,7 @@ spec:
template:
metadata:
labels:
app.kubernetes.io/name: {{ keycloak_database_service_name }}
app.kubernetes.io/name: {{ keycloak_database_service_name }}-{{ keycloak_database_db_version }}
app.kubernetes.io/component: {{ keycloak_database_component_name }}
app.kubernetes.io/part-of: {{ app_name }}
app: {{ app_name }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spec:
targetPort: 5432
protocol: TCP
selector:
app.kubernetes.io/name: {{ keycloak_database_service_name }}
app.kubernetes.io/name: {{ keycloak_database_service_name }}-{{ keycloak_database_db_version }}
app.kubernetes.io/component: {{ keycloak_database_component_name }}
app.kubernetes.io/part-of: {{ app_name }}
version: "{{ keycloak_database_db_version }}"
2 changes: 1 addition & 1 deletion roles/tackle/templates/service-keycloak-postgresql.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spec:
targetPort: 5432
protocol: TCP
selector:
app.kubernetes.io/name: {{ keycloak_database_service_name }}
app.kubernetes.io/name: {{ keycloak_database_service_name }}-{{ keycloak_database_db_version }}
app.kubernetes.io/component: {{ keycloak_database_component_name }}
app.kubernetes.io/part-of: {{ app_name }}
version: "{{ keycloak_database_db_version }}"

0 comments on commit bbb0162

Please sign in to comment.