diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b3290af..1d2cb58 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: include: - SCENARIO: default # tests headless scenario too - SCENARIO: externaldb - # - SCENARIO: ingress # TODO: This scenario currently fails because ui and webhook ingress cannot have the same host and path in minikube nginx ingress controller + # - SCENARIO: ingress # TODO: This scenario currently fails because ui and event_stream ingress cannot have the same host and path in minikube nginx ingress controller steps: - name: Checkout sources uses: actions/checkout@v4 diff --git a/config/crd/bases/eda.ansible.com_edas.yaml b/config/crd/bases/eda.ansible.com_edas.yaml index 88a2e56..241aabe 100644 --- a/config/crd/bases/eda.ansible.com_edas.yaml +++ b/config/crd/bases/eda.ansible.com_edas.yaml @@ -429,11 +429,11 @@ spec: type: object type: array type: object - webhook: - description: Defines desired state of eda-webhook resources + event_stream: + description: Defines desired state of Event Stream resources properties: prefix: - description: Prefix for the webhook + description: Prefix for the Event Stream URL type: string gunicorn_workers: description: 'The number of gunicorn workers for the api. diff --git a/config/manifests/bases/eda-server-operator.clusterserviceversion.yaml b/config/manifests/bases/eda-server-operator.clusterserviceversion.yaml index f6de27f..26f5d77 100644 --- a/config/manifests/bases/eda-server-operator.clusterserviceversion.yaml +++ b/config/manifests/bases/eda-server-operator.clusterserviceversion.yaml @@ -377,9 +377,9 @@ spec: path: api.topology_spread_constraints x-descriptors: - urn:alm:descriptor:com.tectonic.ui:advanced - - description: Defines desired state of eda-webhook deployment resources + - description: Defines desired state of eda-event-stream deployment resources displayName: Webhook deployment configuration - path: webhook + path: event_stream x-descriptors: - urn:alm:descriptor:com.tectonic.ui:advanced - description: Webhook custom prefix path @@ -389,38 +389,38 @@ spec: - urn:alm:descriptor:com.tectonic.ui:advanced - description: The number of gunicorn workers for the Webhook. displayName: Gunicorn Webhook workers - path: webhook.gunicorn_workers + path: event_stream.gunicorn_workers x-descriptors: - urn:alm:descriptor:com.tectonic.ui:advanced - urn:alm:descriptor:com.tectonic.ui:number - displayName: Webhook server resource requirements - path: webhook.resource_requirements + path: event_stream.resource_requirements x-descriptors: - urn:alm:descriptor:com.tectonic.ui:resourceRequirements - description: The number of Webhook replicas. displayName: Replicas - path: webhook.replicas + path: event_stream.replicas x-descriptors: - urn:alm:descriptor:com.tectonic.ui:podCount - displayName: Node Selector - path: webhook.node_selector + path: event_stream.node_selector x-descriptors: - urn:alm:descriptor:com.tectonic.ui:advanced - description: The deployment strategy to use to replace existing pods with new ones. displayName: Strategy - path: webhook.strategy + path: event_stream.strategy x-descriptors: - urn:alm:descriptor:com.tectonic.ui:updateStrategy - urn:alm:descriptor:com.tectonic.ui:advanced - - description: Node tolerations for the webhook pods. + - description: Node tolerations for the event_stream pods. displayName: Tolerations - path: webhook.tolerations + path: event_stream.tolerations x-descriptors: - urn:alm:descriptor:com.tectonic.ui:advanced - description: Topology rule(s) for the pods. displayName: Topology Spread Constraints - path: webhook.topology_spread_constraints + path: event_stream.topology_spread_constraints x-descriptors: - urn:alm:descriptor:com.tectonic.ui:advanced - description: Defines desired state of eda-ui deployment resources diff --git a/roles/eda/defaults/main.yml b/roles/eda/defaults/main.yml index b0b0be1..1bb4683 100644 --- a/roles/eda/defaults/main.yml +++ b/roles/eda/defaults/main.yml @@ -72,9 +72,9 @@ _scheduler: node_selector: {} tolerations: [] -webhook: {} -_webhook: - prefix: /eda-webhook +event_stream: {} +_event_stream: + prefix: /event-streams gunicorn_workers: 2 replicas: 1 resource_requirements: diff --git a/roles/eda/tasks/combine_defaults.yml b/roles/eda/tasks/combine_defaults.yml index 66e8e30..05d7ea7 100644 --- a/roles/eda/tasks/combine_defaults.yml +++ b/roles/eda/tasks/combine_defaults.yml @@ -5,7 +5,7 @@ combined_api: "{{ _api | combine(api, recursive=True) }}" combined_ui: "{{ _ui | combine(ui, recursive=True) }}" combined_scheduler: "{{ _scheduler | combine(scheduler, recursive=True) }}" - combined_webhook: "{{ _webhook | combine(webhook, recursive=True) }}" + combined_event_stream: "{{ _event_stream | combine(event_stream, recursive=True) }}" # Backwards compatibility support for worker parameters - name: Set defaults for workers # (overridden by worker, default_worker, and activation_worker) @@ -15,8 +15,8 @@ - name: Combine worker params set_fact: - combined_default_worker: "{{ _worker | combine (worker, recursive=True) }}" - combined_activation_worker: "{{ _worker | combine (worker, recursive=True) }}" + combined_default_worker: "{{ _worker | combine(worker, recursive=True) }}" + combined_activation_worker: "{{ _worker | combine(worker, recursive=True) }}" when: worker is defined - name: Set default worker parameters when worker is not defined diff --git a/roles/eda/tasks/deploy_eda.yml b/roles/eda/tasks/deploy_eda.yml index 2fa51fa..a3e0b6b 100644 --- a/roles/eda/tasks/deploy_eda.yml +++ b/roles/eda/tasks/deploy_eda.yml @@ -31,22 +31,22 @@ - 'eda-default-worker.deployment' - 'eda-activation-worker.deployment' - 'eda-scheduler.deployment' - - 'eda-webhook.configmap' - - 'eda-webhook.service' - - 'eda-webhook.deployment' + - 'eda-event-stream.configmap' + - 'eda-event-stream.service' + - 'eda-event-stream.deployment' -- name: Apply webhook ingress resources +- name: Apply event-stream ingress resources k8s: apply: yes definition: "{{ lookup('template', item + '.yaml.j2') }}" wait: no loop: - - 'eda-webhook.ingress' + - 'eda-event-stream.ingress' when: - (service_type | lower) == 'route' or ((service_type | lower) == 'ingress' and ui_disabled) # Always runs if service_type: Route # If service_type: Ingress, only run if UI is disabled - # If UI is enabled, the webhook ingress is handled by the UI ingress via multiple pathes + # If UI is enabled, the event-stream ingress is handled by the UI ingress via multiple pathes - name: Apply UI deployment resources if UI is enabled k8s: diff --git a/roles/eda/templates/eda-webhook.configmap.yaml.j2 b/roles/eda/templates/eda-event-stream.configmap.yaml.j2 similarity index 70% rename from roles/eda/templates/eda-webhook.configmap.yaml.j2 rename to roles/eda/templates/eda-event-stream.configmap.yaml.j2 index ec614e4..9050b85 100644 --- a/roles/eda/templates/eda-webhook.configmap.yaml.j2 +++ b/roles/eda/templates/eda-event-stream.configmap.yaml.j2 @@ -1,10 +1,10 @@ apiVersion: v1 kind: ConfigMap metadata: - name: '{{ ansible_operator_meta.name }}-nginx-webhook-configmap' + name: '{{ ansible_operator_meta.name }}-nginx-event-stream-configmap' namespace: '{{ ansible_operator_meta.namespace }}' data: - nginx_webhook_default_conf_template: | + nginx_event_stream_default_conf_template: | events { worker_connections 1024; } @@ -19,15 +19,15 @@ data: application/manifest+json webmanifest; } - upstream eda-api-webhook-backend { - server 127.0.0.1:{{ webhook_django_port }}; + upstream eda-api-event-stream-backend { + server 127.0.0.1:{{ event_stream_django_port }}; } server { - listen {{ webhook_nginx_port }}; + listen {{ event_stream_nginx_port }}; location / { - proxy_pass http://eda-api-webhook-backend/; + proxy_pass http://eda-api-event-stream-backend/; proxy_set_header Host $host:$server_port; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Host $host; diff --git a/roles/eda/templates/eda-webhook.deployment.yaml.j2 b/roles/eda/templates/eda-event-stream.deployment.yaml.j2 similarity index 75% rename from roles/eda/templates/eda-webhook.deployment.yaml.j2 rename to roles/eda/templates/eda-event-stream.deployment.yaml.j2 index 0a3b0f5..24ac5d2 100644 --- a/roles/eda/templates/eda-webhook.deployment.yaml.j2 +++ b/roles/eda/templates/eda-event-stream.deployment.yaml.j2 @@ -5,37 +5,37 @@ metadata: labels: {{ lookup("template", "../common/templates/labels/common.yaml.j2") | indent(width=4) | trim }} {{ lookup("template", "../common/templates/labels/version.yaml.j2") | indent(width=4) | trim }} - app.kubernetes.io/component: '{{ deployment_type }}-webhook' - name: '{{ webhook_server_name }}' + app.kubernetes.io/component: '{{ deployment_type }}-event-stream' + name: '{{ event_stream_server_name }}' namespace: '{{ ansible_operator_meta.namespace }}' spec: - replicas: {{ combined_webhook.replicas }} -{% if combined_webhook.strategy is defined %} + replicas: {{ combined_event_stream.replicas }} +{% if combined_event_stream.strategy is defined %} strategy: - type: {{ combined_webhook.strategy.type }} -{% if combined_webhook.strategy.type == "Recreate" %} + type: {{ combined_event_stream.strategy.type }} +{% if combined_event_stream.strategy.type == "Recreate" %} rollingUpdate: null -{% elif combined_webhook.strategy.type == "RollingUpdate" %} +{% elif combined_event_stream.strategy.type == "RollingUpdate" %} rollingUpdate: - maxSurge: {{ combined_webhook.strategy.rollingUpdate.maxSurge | default("25%")}} - maxUnavailable: {{ combined_webhook.strategy.rollingUpdate.maxUnavailable | default("25%")}} + maxSurge: {{ combined_event_stream.strategy.rollingUpdate.maxSurge | default("25%")}} + maxUnavailable: {{ combined_event_stream.strategy.rollingUpdate.maxUnavailable | default("25%")}} {% endif %} {% endif %} selector: matchLabels: app.kubernetes.io/name: '{{ ansible_operator_meta.name }}' app.kubernetes.io/managed-by: '{{ deployment_type }}-operator' - app.kubernetes.io/component: '{{ deployment_type }}-webhook' + app.kubernetes.io/component: '{{ deployment_type }}-event-stream' template: metadata: labels: {{ lookup("template", "../common/templates/labels/common.yaml.j2") | indent(width=8) | trim }} {{ lookup("template", "../common/templates/labels/version.yaml.j2") | indent(width=8) | trim }} - app.kubernetes.io/component: '{{ deployment_type }}-webhook' + app.kubernetes.io/component: '{{ deployment_type }}-event-stream' annotations: - kubectl.kubernetes.io/default-container: 'eda-webhook' + kubectl.kubernetes.io/default-container: 'eda-event-stream' {% for template in [ - "eda-webhook.configmap", + "eda-event-stream.configmap", ] %} checksum-{{ template | replace('/', '-') }}: "{{ lookup('template', template + '.yaml.j2') | sha1 }}" {% endfor %} @@ -52,17 +52,17 @@ spec: - name: {{ secret }} {% endfor %} {% endif %} -{% if combined_webhook.node_selector is defined %} +{% if combined_event_stream.node_selector is defined %} nodeSelector: - {{ combined_webhook.node_selector | to_nice_yaml | indent(width=8) }} + {{ combined_event_stream.node_selector | to_nice_yaml | indent(width=8) }} {% endif %} -{% if combined_webhook.tolerations is defined %} +{% if combined_event_stream.tolerations is defined %} tolerations: - {{ combined_webhook.tolerations | to_nice_yaml | indent(width=8) }} + {{ combined_event_stream.tolerations | to_nice_yaml | indent(width=8) }} {% endif %} -{% if combined_webhook.topology_spread_constraints is defined %} +{% if combined_event_stream.topology_spread_constraints is defined %} topologySpreadConstraints: - {{ combined_webhook.topology_spread_constraints | indent(width=8) }} + {{ combined_event_stream.topology_spread_constraints | indent(width=8) }} {% endif %} initContainers: - name: wait-for-migrations @@ -124,8 +124,8 @@ spec: - | mkdir -p /etc/pki/ca-trust/extracted/{java,pem,openssl,edk2} update-ca-trust -{% if combined_webhook.resource_requirements is defined %} - resources: {{ combined_webhook.resource_requirements }} +{% if combined_event_stream.resource_requirements is defined %} + resources: {{ combined_event_stream.resource_requirements }} {% endif %} volumeMounts: - name: "ca-trust-extracted" @@ -136,13 +136,13 @@ spec: readOnly: true {% endif %} containers: - - name: eda-webhook + - name: eda-event-stream image: {{ _image }} imagePullPolicy: '{{ image_pull_policy }}' args: - /bin/bash - -c - - gunicorn --bind 0.0.0.0:{{ webhook_django_port }} --workers {{ combined_webhook.gunicorn_workers }} aap_eda.wsgi:application + - gunicorn --bind 0.0.0.0:{{ event_stream_django_port }} --workers {{ combined_event_stream.gunicorn_workers }} aap_eda.wsgi:application envFrom: - configMapRef: name: '{{ ansible_operator_meta.name }}-{{ deployment_type }}-env-properties' @@ -183,23 +183,23 @@ spec: name: '{{ db_fields_encryption_secret_name }}' key: secret_key ports: - - containerPort: {{ webhook_django_port }} + - containerPort: {{ event_stream_django_port }} readinessProbe: httpGet: path: /_healthz - port: {{ webhook_django_port }} + port: {{ event_stream_django_port }} failureThreshold: 10 periodSeconds: 10 initialDelaySeconds: 20 livenessProbe: httpGet: path: /_healthz - port: {{ webhook_django_port }} + port: {{ event_stream_django_port }} failureThreshold: 10 periodSeconds: 10 initialDelaySeconds: 20 -{% if combined_webhook.resource_requirements is defined %} - resources: {{ combined_webhook.resource_requirements }} +{% if combined_event_stream.resource_requirements is defined %} + resources: {{ combined_event_stream.resource_requirements }} {% endif %} {% if bundle_ca_crt %} volumeMounts: @@ -213,9 +213,9 @@ spec: - name: nginx image: {{ _image_web }} ports: - - containerPort: {{ webhook_nginx_port }} + - containerPort: {{ event_stream_nginx_port }} volumeMounts: - - name: '{{ ansible_operator_meta.name }}-nginx-webhook-conf' + - name: '{{ ansible_operator_meta.name }}-nginx-event-stream-conf' mountPath: /etc/nginx/nginx.conf subPath: nginx.conf readOnly: true @@ -225,11 +225,11 @@ spec: mountPath: /var/run restartPolicy: Always volumes: - - name: '{{ ansible_operator_meta.name }}-nginx-webhook-conf' + - name: '{{ ansible_operator_meta.name }}-nginx-event-stream-conf' configMap: - name: '{{ ansible_operator_meta.name }}-nginx-webhook-configmap' + name: '{{ ansible_operator_meta.name }}-nginx-event-stream-configmap' items: - - key: nginx_webhook_default_conf_template + - key: nginx_event_stream_default_conf_template path: nginx.conf - name: nginx-cache emptyDir: {} diff --git a/roles/eda/templates/eda-webhook.ingress.yaml.j2 b/roles/eda/templates/eda-event-stream.ingress.yaml.j2 similarity index 88% rename from roles/eda/templates/eda-webhook.ingress.yaml.j2 rename to roles/eda/templates/eda-event-stream.ingress.yaml.j2 index b322eb2..9918039 100644 --- a/roles/eda/templates/eda-webhook.ingress.yaml.j2 +++ b/roles/eda/templates/eda-event-stream.ingress.yaml.j2 @@ -5,7 +5,7 @@ apiVersion: '{{ ingress_api_version }}' {% endif %} kind: Ingress metadata: - name: '{{ ansible_operator_meta.name }}-webhook-ingress' + name: '{{ ansible_operator_meta.name }}-event-stream-ingress' namespace: '{{ ansible_operator_meta.namespace }}' labels: {{ lookup("template", "../common/templates/labels/common.yaml.j2") | indent(width=4) | trim }} @@ -24,7 +24,7 @@ spec: pathType: '{{ ingress_path_type }}' backend: service: - name: '{{ ansible_operator_meta.name }}-webhook' + name: '{{ ansible_operator_meta.name }}-event-stream' port: number: 8000 {% if hostname %} @@ -45,7 +45,7 @@ apiVersion: '{{ route_api_version }}' {% endif %} kind: Route metadata: - name: '{{ ansible_operator_meta.name }}-webhook' + name: '{{ ansible_operator_meta.name }}-event-stream' namespace: '{{ ansible_operator_meta.namespace }}' labels: {{ lookup("template", "../common/templates/labels/common.yaml.j2") | indent(width=4) | trim }} @@ -70,7 +70,7 @@ spec: {% endif %} to: kind: Service - name: {{ ansible_operator_meta.name }}-webhook + name: {{ ansible_operator_meta.name }}-event-stream weight: 100 wildcardPolicy: None {% endif %} diff --git a/roles/eda/templates/eda-webhook.service.yaml.j2 b/roles/eda/templates/eda-event-stream.service.yaml.j2 similarity index 56% rename from roles/eda/templates/eda-webhook.service.yaml.j2 rename to roles/eda/templates/eda-event-stream.service.yaml.j2 index d1263be..df4fa9c 100644 --- a/roles/eda/templates/eda-webhook.service.yaml.j2 +++ b/roles/eda/templates/eda-event-stream.service.yaml.j2 @@ -2,16 +2,16 @@ apiVersion: v1 kind: Service metadata: - name: "{{ webhook_server_name }}" + name: "{{ event_stream_server_name }}" namespace: "{{ ansible_operator_meta.namespace }}" labels: {{ lookup("template", "../common/templates/labels/common.yaml.j2") | indent(width=4) | trim }} - app.kubernetes.io/component: '{{ deployment_type }}-webhook' + app.kubernetes.io/component: '{{ deployment_type }}-event-stream' spec: ports: - - port: {{ webhook_nginx_port }} + - port: {{ event_stream_nginx_port }} protocol: TCP - targetPort: {{ webhook_nginx_port }} + targetPort: {{ event_stream_nginx_port }} selector: {{ lookup("template", "../common/templates/labels/common.yaml.j2") | indent(width=4) | trim }} - app.kubernetes.io/component: '{{ deployment_type }}-webhook' + app.kubernetes.io/component: '{{ deployment_type }}-event-stream' diff --git a/roles/eda/templates/eda-ui.ingress.yaml.j2 b/roles/eda/templates/eda-ui.ingress.yaml.j2 index a6d2aa8..6dfe9fd 100644 --- a/roles/eda/templates/eda-ui.ingress.yaml.j2 +++ b/roles/eda/templates/eda-ui.ingress.yaml.j2 @@ -31,7 +31,7 @@ spec: pathType: '{{ ingress_path_type }}' backend: service: - name: '{{ ansible_operator_meta.name }}-webhook' + name: '{{ ansible_operator_meta.name }}-event-stream' port: number: 8000 {% if hostname %} diff --git a/roles/eda/templates/eda.configmap.yaml.j2 b/roles/eda/templates/eda.configmap.yaml.j2 index 450c0f8..c062158 100644 --- a/roles/eda/templates/eda.configmap.yaml.j2 +++ b/roles/eda/templates/eda.configmap.yaml.j2 @@ -11,10 +11,12 @@ data: # Operator specific settings EDA_DEPLOYMENT_TYPE: "k8s" - {% if public_base_url and eda_webhook_prefix_path %} + {% if public_base_url and eda_event_stream_prefix_path %} # Public URL - EDA_WEBHOOK_BASE_URL: "{{ public_base_url.rstrip('/') }}/{{ eda_webhook_prefix_path.lstrip('/') }}" + EDA_WEBHOOK_BASE_URL: "{{ public_base_url.rstrip('/') }}/{{ eda_event_stream_prefix_path.lstrip('/') }}" EDA_WEBHOOK_MTLS_BASE_URL: "@none None" + EDA_EVENT_STREAM_BASE_URL: "{{ public_base_url.rstrip('/') }}/{{ eda_event_stream_prefix_path.lstrip('/') }}" + EDA_EVENT_STREAM_MTLS_BASE_URL: "@none None" {% endif %} # EDA Server diff --git a/roles/eda/vars/main.yml b/roles/eda/vars/main.yml index 9167b48..d5f572f 100644 --- a/roles/eda/vars/main.yml +++ b/roles/eda/vars/main.yml @@ -10,7 +10,7 @@ media_dir: /var/lib/eda/files static_path: /var/lib/eda/static bundle_ca_crt: '' -eda_webhook_prefix_path: "{{ webhook.prefix | default('/eda-webhooks') }}" -webhook_nginx_port: 8000 -webhook_server_name: "{{ ansible_operator_meta.name }}-webhook" -webhook_django_port: 8002 +eda_event_stream_prefix_path: "{{ event_stream.prefix | default('/eda-event-streams') }}" +event_stream_nginx_port: 8000 +event_stream_server_name: "{{ ansible_operator_meta.name }}-event-stream" +event_stream_django_port: 8002