From 12184196934b1e77c344653cc3569f7d8855917e Mon Sep 17 00:00:00 2001 From: David Hageman Date: Mon, 22 Apr 2024 18:07:50 -0500 Subject: [PATCH] Add database secret to metric jobs --- .../templates/cronjobs/metrics-utility-gather.yaml.j2 | 10 ++++++++++ .../templates/cronjobs/metrics-utility-report.yaml.j2 | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/roles/installer/templates/cronjobs/metrics-utility-gather.yaml.j2 b/roles/installer/templates/cronjobs/metrics-utility-gather.yaml.j2 index 4e717a45d..25fbd30d5 100644 --- a/roles/installer/templates/cronjobs/metrics-utility-gather.yaml.j2 +++ b/roles/installer/templates/cronjobs/metrics-utility-gather.yaml.j2 @@ -59,6 +59,10 @@ spec: mountPath: "/etc/tower/conf.d/credentials.py" subPath: credentials.py readOnly: true + - name: "{{ secret_key_secret_name }}" + mountPath: /etc/tower/SECRET_KEY + subPath: SECRET_KEY + readOnly: true - name: {{ ansible_operator_meta.name }}-settings mountPath: /etc/tower/settings.py subPath: settings.py @@ -74,6 +78,12 @@ spec: items: - key: credentials.py path: 'credentials.py' + - name: "{{ secret_key_secret_name }}" + secret: + secretName: '{{ secret_key_secret_name }}' + items: + - key: secret_key + path: SECRET_KEY - name: {{ ansible_operator_meta.name }}-settings configMap: name: '{{ ansible_operator_meta.name }}-{{ deployment_type }}-configmap' diff --git a/roles/installer/templates/cronjobs/metrics-utility-report.yaml.j2 b/roles/installer/templates/cronjobs/metrics-utility-report.yaml.j2 index c1e7aed76..c373e10f1 100644 --- a/roles/installer/templates/cronjobs/metrics-utility-report.yaml.j2 +++ b/roles/installer/templates/cronjobs/metrics-utility-report.yaml.j2 @@ -56,6 +56,10 @@ spec: mountPath: "/etc/tower/conf.d/credentials.py" subPath: credentials.py readOnly: true + - name: "{{ secret_key_secret_name }}" + mountPath: /etc/tower/SECRET_KEY + subPath: SECRET_KEY + readOnly: true - name: {{ ansible_operator_meta.name }}-settings mountPath: /etc/tower/settings.py subPath: settings.py @@ -71,6 +75,12 @@ spec: items: - key: credentials.py path: 'credentials.py' + - name: "{{ secret_key_secret_name }}" + secret: + secretName: '{{ secret_key_secret_name }}' + items: + - key: secret_key + path: SECRET_KEY - name: {{ ansible_operator_meta.name }}-settings configMap: name: '{{ ansible_operator_meta.name }}-{{ deployment_type }}-configmap'