Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split metrics utility cronjobs for crc and local report #1906

Merged
merged 3 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions roles/installer/tasks/enable_metrics_utility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,3 @@
loop:
- {name: 'metrics-utility-gather', template: 'cronjobs/metrics-utility-gather.yaml.j2'}
- {name: 'metrics-utility-report', template: 'cronjobs/metrics-utility-report.yaml.j2'}

- name: Create metrics-utility Kubernetes CronJob for Red Hat Hybrid Cloud Console
kubernetes.core.k8s:
definition: "{{ lookup('template', item.template) }}"
apply: true
wait: true
vars:
cronjob_name: "{{ item.name }}"
metrics_utility_ship_target: crc # TODO - Update to console when changed
loop:
- {name: 'metrics-utility-gather-console', template: 'cronjobs/metrics-utility-gather.yaml.j2'}
when: _metrics_utility_console_enabled
11 changes: 11 additions & 0 deletions roles/installer/tasks/enable_metrics_utility_console.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
- name: Create metrics-utility Kubernetes CronJob for Red Hat Hybrid Cloud Console
kubernetes.core.k8s:
definition: "{{ lookup('template', item.template) }}"
apply: true
wait: true
vars:
cronjob_name: "{{ item.name }}"
metrics_utility_ship_target: crc # TODO - Update to console when changed
loop:
- {name: 'metrics-utility-gather-console', template: 'cronjobs/metrics-utility-gather.yaml.j2'}
6 changes: 5 additions & 1 deletion roles/installer/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,11 @@

- name: Enable optional metrics-utility
include_tasks: enable_metrics_utility.yml
when: metrics_utility_enabled | bool
when: _metrics_utility_enabled | bool

- name: Enable optional metrics-utility for Redhat Console
include_tasks: enable_metrics_utility_console.yml
when: _metrics_utility_console_enabled | bool

- name: Update status variables
include_tasks: update_status.yml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,11 @@ spec:
name: {{ metrics_utility_secret }}
{% endif %}
volumeMounts:
{% if _metrics_utility_ship_target == "directory" %}
- name: {{ ansible_operator_meta.name }}-metrics-utility
mountPath: /metrics-utility
readOnly: false
{% endif %}
- name: "{{ ansible_operator_meta.name }}-application-credentials"
mountPath: "/etc/tower/conf.d/credentials.py"
subPath: credentials.py
Expand All @@ -69,10 +71,12 @@ spec:
readOnly: true
{{ lookup("template", "common/volume_mounts/extra_settings_files.yaml.j2") | indent(width=12) | trim }}
volumes:
{% if _metrics_utility_ship_target == "directory" %}
- name: {{ ansible_operator_meta.name }}-metrics-utility
persistentVolumeClaim:
claimName: {{ _metrics_utility_pvc_claim }}
readOnly: false
{% endif %}
- name: "{{ ansible_operator_meta.name }}-application-credentials"
secret:
secretName: "{{ ansible_operator_meta.name }}-app-credentials"
Expand Down
Loading