Koschei: Update manual playbooks for migration to Kubernetes Deployment

This commit is contained in:
Mikolaj Izdebski 2024-06-04 18:31:44 +02:00
parent 73486f6350
commit e9993b5670
4 changed files with 28 additions and 33 deletions

View file

@ -19,14 +19,17 @@
- import_tasks: "{{ handlers_path }}/restart_services.yml"
tasks:
- name: Stop backend services
shell: oc -n koschei scale dc/{{item.name}} --replicas=0
with_items: "{{ koschei_backend_services }}"
loop_control:
label: "{{ item.name }}"
- name: Delete all jobs
shell: oc -n koschei delete job --all
- name: Stop frontend
shell: oc -n koschei scale dc/frontend --replicas=0
- name: Pause all deployments
shell: oc -n koschei rollout pause deploy
- name: Delete all replica sets
shell: oc -n koschei delete rs --all
- name: Delete all pods
shell: oc -n koschei delete pod --all
- name: Drop koschei database
postgresql_db: name=koschei state=absent
@ -46,11 +49,5 @@
name: db-create
command: "koschei-admin create-db && koschei-admin create-collection f41 --display-name 'Fedora Rawhide' --target f41 --bugzilla-product Fedora --bugzilla-version rawhide && koschei-admin create-group php"
- name: Start frontend
shell: oc -n koschei scale dc/frontend --replicas={{koschei_frontend_replicas}}
- name: Start backend services
shell: oc -n koschei scale dc/{{item.name}} --replicas=1
with_items: "{{ koschei_backend_services }}"
loop_control:
label: "{{ item.name }}"
- name: Resume all deployments
shell: oc -n koschei rollout resume deploy

View file

@ -16,14 +16,17 @@
- import_tasks: "{{ handlers_path }}/restart_services.yml"
tasks:
- name: Stop backend services
shell: oc -n koschei scale dc/{{item.name}} --replicas=0
with_items: "{{ koschei_backend_services }}"
loop_control:
label: "{{ item.name }}"
- name: Delete all jobs
shell: oc -n koschei delete job --all
- name: Stop frontend
shell: oc -n koschei scale dc/frontend --replicas=0
- name: Pause all deployments
shell: oc -n koschei rollout pause deploy
- name: Delete all replica sets
shell: oc -n koschei delete rs --all
- name: Delete all pods
shell: oc -n koschei delete pod --all
- name: Import upstream image into OpenShift
include_role: name=openshift/import-image
@ -44,11 +47,5 @@
name: db-vacuum
command: "koschei-admin psql <<<'VACUUM FULL ANALYZE'"
- name: Start frontend
shell: oc -n koschei scale dc/frontend --replicas={{koschei_frontend_replicas}}
- name: Start backend services
shell: oc -n koschei scale dc/{{item.name}} --replicas=1
with_items: "{{ koschei_backend_services }}"
loop_control:
label: "{{ item.name }}"
- name: Resume all deployments
shell: oc -n koschei rollout resume deploy

View file

@ -14,10 +14,11 @@
handlers:
- import_tasks: "{{ handlers_path }}/restart_services.yml"
# Simply import latest upstream Koschei image from Quay.io, which
# should automatically trigger new OpenShift deployments as needed.
tasks:
- name: Import upstream image into OpenShift
include_role: name=openshift/import-image
vars:
imagestreamname: koschei
- name: Restart all deployments
shell: oc -n koschei rollout restart deploy

View file

@ -50,7 +50,7 @@
- frontend-deployment
- frontend-service
- name: Apply DeploymentConfig
- name: Apply Deployment
include_role: name=openshift/object
vars:
template: backend-deployment.yml