From a94a6f045de732d99e752a3f669445a558f00410 Mon Sep 17 00:00:00 2001 From: Hao Liu Date: Tue, 27 Sep 2022 21:37:57 -0400 Subject: [PATCH] change receptor ca secret to tls secret change the type of secret use for receptor ca to tls secret, to be more "proper" Signed-off-by: Hao Liu --- .../templates/deployments/deployment.yaml.j2 | 16 +++++++++++++--- .../templates/secrets/receptor_ca_secret.yaml.j2 | 5 +++-- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/roles/installer/templates/deployments/deployment.yaml.j2 b/roles/installer/templates/deployments/deployment.yaml.j2 index 988a9663..54ea5c62 100644 --- a/roles/installer/templates/deployments/deployment.yaml.j2 +++ b/roles/installer/templates/deployments/deployment.yaml.j2 @@ -67,7 +67,12 @@ spec: fieldPath: metadata.name volumeMounts: - name: "{{ ansible_operator_meta.name }}-receptor-ca" - mountPath: "/etc/receptor/tls/ca" + mountPath: "/etc/receptor/tls/ca/receptor-ca.crt" + subPath: "tls.crt" + readOnly: true + - name: "{{ ansible_operator_meta.name }}-receptor-ca" + mountPath: "/etc/receptor/tls/ca/receptor-ca.key" + subPath: "tls.key" readOnly: true - name: "{{ ansible_operator_meta.name }}-receptor-tls" mountPath: "/etc/receptor/tls/" @@ -179,7 +184,12 @@ spec: subPath: "work-public-key.pem" readOnly: true - name: "{{ ansible_operator_meta.name }}-receptor-ca" - mountPath: "/etc/receptor/tls/ca" + mountPath: "/etc/receptor/tls/ca/receptor-ca.crt" + subPath: "tls.crt" + readOnly: true + - name: "{{ ansible_operator_meta.name }}-receptor-ca" + mountPath: "/etc/receptor/tls/ca/receptor-ca.key" + subPath: "tls.key" readOnly: true {% if development_mode | bool %} - name: awx-devel @@ -324,7 +334,7 @@ spec: mountPath: "/etc/receptor/" - name: "{{ ansible_operator_meta.name }}-receptor-ca" mountPath: "/etc/receptor/tls/ca/receptor-ca.crt" - subPath: "receptor-ca.crt" + subPath: "tls.crt" readOnly: true - name: "{{ ansible_operator_meta.name }}-receptor-work-signing" mountPath: "/etc/receptor/signing/work-private-key.pem" diff --git a/roles/installer/templates/secrets/receptor_ca_secret.yaml.j2 b/roles/installer/templates/secrets/receptor_ca_secret.yaml.j2 index 6a6d0c05..84ef1602 100644 --- a/roles/installer/templates/secrets/receptor_ca_secret.yaml.j2 +++ b/roles/installer/templates/secrets/receptor_ca_secret.yaml.j2 @@ -10,6 +10,7 @@ metadata: app.kubernetes.io/managed-by: '{{ deployment_type }}-operator' app.kubernetes.io/component: '{{ deployment_type }}' app.kubernetes.io/operator-version: '{{ lookup("env", "OPERATOR_VERSION") }}' +type: kubernetes.io/tls data: - receptor-ca.crt: '{{ lookup('file', '{{ _receptor_ca_crt_file.path }}') | b64encode }}' - receptor-ca.key: '{{ lookup('file', '{{ _receptor_ca_key_file.path }}') | b64encode }}' + tls.crt: '{{ lookup('file', '{{ _receptor_ca_crt_file.path }}') | b64encode }}' + tls.key: '{{ lookup('file', '{{ _receptor_ca_key_file.path }}') | b64encode }}'