From 6726b54d24f3dbfd6afd4bdf8cacb70bec1d5221 Mon Sep 17 00:00:00 2001 From: sdimovv <36302090+sdimovv@users.noreply.github.com> Date: Sun, 29 Oct 2023 11:15:32 +0000 Subject: [PATCH] feat(scale): Add experimental cluster cert questions support (#14055) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Description** Adding experimental support for the cluster certs in the SCALE UI. Ties in with PR #13852 . ⚒️ Fixes # **⚙️ Type of change** - [x] ⚙️ Feature/App addition - [ ] 🪛 Bugfix - [ ] ⚠️ Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] 🔃 Refactor of current code **🧪 How Has This Been Tested?** Not tested on SCALE. I just checked the common lib and if I understand correctly it looks for `certificateIssuer` entry and if empty eventually looks for a `secretName` entry **📃 Notes:** For now, Common Lib has no knowledge of cluster-wide certificates. Thus: 1. It wouldn't know how to resolve the full secret name from just the cert name. I.e. it doesn't know what the ClusterIssuer deployment is called and what the certificate naming scheme is. So, for now, the user must provide the full secret name in the form of `-clusterissuer-`. 2. It wouldn't be able to enforce cluster-issuer and Kubernetes-reflector being installed if the user provides a cluster certificate name Nevertheless, I think it's fine to have this listed as an experimental feature since having it in the SCALE GUI makes it much easier to test the cluster certificates support. **QUESTION:** Why is the Cert Manager clusterIssuer option variable named `certificateIssuer` in `IngressTls.yaml` and `clusterIssuer` in `IngressList.yaml`. I think it should be `certificateIssuer` in both places. **✔️ Checklist:** - [X] ⚖️ My code follows the style guidelines of this project - [X] 👀 I have performed a self-review of my own code - [X] #️⃣ I have commented my code, particularly in hard-to-understand areas - [ ] 📄 I have made corresponding changes to the documentation - [X] ⚠️ My changes generate no new warnings - [ ] 🧪 I have added tests to this description that prove my fix is effective or that my feature works - [ ] ⬆️ I increased versions for any altered app according to semantic versioning **➕ App addition** If this PR is an app addition please make sure you have done the following. - [ ] 🪞 I have opened a PR on [truecharts/containers](https://github.com/truecharts/containers) adding the container to TrueCharts mirror repo. - [ ] 🖼️ I have added an icon in the Chart's root directory called `icon.png` --- _Please don't blindly check all the boxes. Read them and only check those that apply. Those checkboxes are there for the reviewer to see what is this all about and the status of this PR with a quick glance._ --------- Signed-off-by: sdimovv <36302090+sdimovv@users.noreply.github.com> Signed-off-by: Kjeld Schouten Co-authored-by: Kjeld Schouten --- templates/questions/ingress/ingressList.yaml | 7 +++++++ templates/questions/ingress/ingressTLS.yaml | 13 +++++++++++++ 2 files changed, 20 insertions(+) diff --git a/templates/questions/ingress/ingressList.yaml b/templates/questions/ingress/ingressList.yaml index cac5905ca58..20484474ab1 100644 --- a/templates/questions/ingress/ingressList.yaml +++ b/templates/questions/ingress/ingressList.yaml @@ -128,6 +128,13 @@ type: int $ref: - "definitions/certificate" + - variable: clusterCertificate + label: Cluster Certificate (Experimental) + description: 'Add the name of your cluster-wide certificate, that you set up in the ClusterIssuer chart. NOTE: This is an experimental feature' + schema: + type: string + show_if: [["clusterIssuer", "=", ""]] + default: "" - variable: secretName label: Use Custom Secret (Advanced) schema: diff --git a/templates/questions/ingress/ingressTLS.yaml b/templates/questions/ingress/ingressTLS.yaml index 4f0a240a556..95065e21b25 100644 --- a/templates/questions/ingress/ingressTLS.yaml +++ b/templates/questions/ingress/ingressTLS.yaml @@ -4,3 +4,16 @@ schema: type: string default: "" + - variable: clusterCertificate + label: Cluster Certificate (Experimental) + description: 'Add the name of your cluster-wide certificate, that you set up in ClusterIssuer chart. NOTE: This is an experimental feature' + schema: + show_if: [["certificateIssuer", "=", ""]] + type: string + default: "" + - variable: secretName + label: Custom Certificate Secret (Advanced)' + schema: + show_if: [["certificateIssuer", "=", ""]] + type: string + default: ""