From 45c59bd5c9067b24de16baf02efb3f13bd3f4dfd Mon Sep 17 00:00:00 2001 From: Daniel Rodowicz Date: Fri, 16 Aug 2024 12:10:23 -0400 Subject: [PATCH 1/2] make webhook path configurable --- roles/eda/templates/eda-ui.ingress.yaml.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/eda/templates/eda-ui.ingress.yaml.j2 b/roles/eda/templates/eda-ui.ingress.yaml.j2 index a6d2aa8..ead427a 100644 --- a/roles/eda/templates/eda-ui.ingress.yaml.j2 +++ b/roles/eda/templates/eda-ui.ingress.yaml.j2 @@ -27,7 +27,7 @@ spec: name: '{{ ansible_operator_meta.name }}-ui' port: number: 80 - - path: '/' + - path: '{{ eda_webhook_prefix_path }}' pathType: '{{ ingress_path_type }}' backend: service: From bf8076e142e427e414327f3bec993a04506d8740 Mon Sep 17 00:00:00 2001 From: Daniel Rodowicz Date: Tue, 20 Aug 2024 14:32:01 -0400 Subject: [PATCH 2/2] add new spec to the crd --- config/crd/bases/eda.ansible.com_edas.yaml | 3 +++ .../bases/eda-server-operator.clusterserviceversion.yaml | 6 ++++++ roles/eda/defaults/main.yml | 1 + roles/eda/templates/eda-ui.ingress.yaml.j2 | 2 +- roles/eda/templates/eda-webhook.ingress.yaml.j2 | 2 +- 5 files changed, 12 insertions(+), 2 deletions(-) diff --git a/config/crd/bases/eda.ansible.com_edas.yaml b/config/crd/bases/eda.ansible.com_edas.yaml index 88a2e56..f01a302 100644 --- a/config/crd/bases/eda.ansible.com_edas.yaml +++ b/config/crd/bases/eda.ansible.com_edas.yaml @@ -2761,6 +2761,9 @@ spec: ingress_class_name: description: The name of ingress class to use instead of the cluster default. type: string + webhook_ingress_path: + description: The ingress path used to reach the webhook service + type: string loadbalancer_protocol: description: Protocol to use for the loadbalancer type: string diff --git a/config/manifests/bases/eda-server-operator.clusterserviceversion.yaml b/config/manifests/bases/eda-server-operator.clusterserviceversion.yaml index f6de27f..4f6fd0d 100644 --- a/config/manifests/bases/eda-server-operator.clusterserviceversion.yaml +++ b/config/manifests/bases/eda-server-operator.clusterserviceversion.yaml @@ -649,6 +649,12 @@ spec: - urn:alm:descriptor:com.tectonic.ui:advanced - urn:alm:descriptor:io.kubernetes:Secret - urn:alm:descriptor:com.tectonic.ui:fieldDependency:ingress_type:Ingress + - displayName: Webhook Ingress Path + path: webhook_ingress_path + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:advanced + - urn:alm:descriptor:com.tectonic.ui:text + - urn:alm:descriptor:com.tectonic.ui:fieldDependency:ingress_type:Ingress - displayName: LoadBalancer Protocol path: loadbalancer_protocol x-descriptors: diff --git a/roles/eda/defaults/main.yml b/roles/eda/defaults/main.yml index b0b0be1..422ec79 100644 --- a/roles/eda/defaults/main.yml +++ b/roles/eda/defaults/main.yml @@ -104,6 +104,7 @@ ingress_class_name: '' ingress_path: '/' ingress_path_type: 'Prefix' ingress_api_version: 'networking.k8s.io/v1' +webhook_ingress_path: '/' # Add annotations to the service account. Specify as literal block. E.g.: # service_account_annotations: | # eks.amazonaws.com/role-arn: arn:aws:iam:::role/ diff --git a/roles/eda/templates/eda-ui.ingress.yaml.j2 b/roles/eda/templates/eda-ui.ingress.yaml.j2 index ead427a..ce00792 100644 --- a/roles/eda/templates/eda-ui.ingress.yaml.j2 +++ b/roles/eda/templates/eda-ui.ingress.yaml.j2 @@ -27,7 +27,7 @@ spec: name: '{{ ansible_operator_meta.name }}-ui' port: number: 80 - - path: '{{ eda_webhook_prefix_path }}' + - path: '{{ webhook_ingress_path }}' pathType: '{{ ingress_path_type }}' backend: service: diff --git a/roles/eda/templates/eda-webhook.ingress.yaml.j2 b/roles/eda/templates/eda-webhook.ingress.yaml.j2 index b322eb2..4e091ee 100644 --- a/roles/eda/templates/eda-webhook.ingress.yaml.j2 +++ b/roles/eda/templates/eda-webhook.ingress.yaml.j2 @@ -20,7 +20,7 @@ spec: rules: - http: paths: - - path: '/' + - path: '{{ webhook_ingress_path }}' pathType: '{{ ingress_path_type }}' backend: service: