Skip to content

Commit

Permalink
Add configuration switch for volume expansion
Browse files Browse the repository at this point in the history
Signed-off-by: Dylan Murray <dymurray@redhat.com>
  • Loading branch information
dymurray committed Jan 17, 2024
1 parent 0ab294c commit e2a72ed
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions roles/tackle/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ http_proxy: "{{ lookup('env', 'HTTP_PROXY') }}"
https_proxy: "{{ lookup('env', 'HTTPS_PROXY') }}"
no_proxy: "{{ lookup('env', 'NO_PROXY') }}"

# PVC Handling
expand_volume_sizes: true

# Components
hub_image_fqin: "{{ lookup('env', 'RELATED_IMAGE_TACKLE_HUB') }}"
hub_component_name: "hub"
Expand Down
13 changes: 13 additions & 0 deletions roles/tackle/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,19 @@
retries: 30
delay: 5

- name: "Retrieve Hub API Database PersistentVolumeClaim"
k8s_info:
api_version: v1
kind: PersistentVolumeClaim
name: "{{ hub_database_volume_claim_name }}"
namespace: "{{ app_namespace }}"
register: hub_database

- name: "Set database volume request size based on existing size"
when: hub_database.resources | length > 0 and not expand_volume_sizes
set_fact:
hub_database_volume_size: " {{ (hub_database.resources | first).spec.resources.requests.storage }}"

- name: "Setup Hub API Database PersistentVolumeClaim"
k8s:
state: present
Expand Down

0 comments on commit e2a72ed

Please sign in to comment.