Skip to content

Commit

Permalink
add new extensions configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
jmazzitelli committed Jun 27, 2024
1 parent b4e01d3 commit f50da9d
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crd-docs/cr/kiali.io_v1alpha1_kiali.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,11 @@ spec:
version_label: ""
view_only_mode: false

# default: extensions is an empty list
extensions:
- enabled: true
name: "skupper"

external_services:
custom_dashboards:
discovery_auto_threshold: 10
Expand Down
14 changes: 14 additions & 0 deletions crd-docs/crd/kiali.io_kialis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,20 @@ spec:
description: "When true, Kiali will be in 'view only' mode, allowing the user to view and retrieve management and monitoring data for the service mesh, but not allow the user to modify the service mesh."
type: boolean

extensions:
description: |
Defines third-party extensions whose metrics can be integrated into the Kiali UI.
type: array
items:
type: object
properties:
enabled:
description: Determines if the extension is to be visualized in the Kiali UI.
type: boolean
name:
description: The name that is used to identify the metric timeseries for the extension.
type: string

external_services:
description: |
These external service configuration settings define how to connect to the external services
Expand Down
20 changes: 20 additions & 0 deletions molecule/config-values-test/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@
- kiali_pod_spec.dnsPolicy == "ClusterFirst"
- kiali_pod_spec.dnsConfig is not defined

- name: Test the default extensions list is empty
assert:
that:
- kiali_configmap.extensions | length == 0

# This test will change some config settings to make sure things work like we expect.
# We will add additional tasks and asserts in the future to test other config changes.
# We load in the current kiali CR and then alter it with new config and deploy that new CR.
Expand Down Expand Up @@ -210,6 +215,14 @@
set_fact:
current_kiali_cr: "{{ current_kiali_cr | combine({'spec': {'deployment': {'dns': dns_settings}}}, recursive=True) }}"

- name: Add an extension
vars:
extensions:
- name: "skupper"
enabled: false
set_fact:
current_kiali_cr: "{{ current_kiali_cr | combine({'spec': {'extensions': extensions}}, recursive=True) }}"

- name: The new Kiali CR to be tested
debug:
msg: "{{ current_kiali_cr }}"
Expand Down Expand Up @@ -364,3 +377,10 @@
- kiali_pod_spec.dnsPolicy == "Default"
- kiali_pod_spec.dnsConfig.options[0].name == "ndots"
- kiali_pod_spec.dnsConfig.options[0].value == "1"

- name: Test the extensions settings
assert:
that:
- kiali_configmap.extensions | length == 1
- kiali_configmap.extensions[0].name == "skupper"
- kiali_configmap.extensions[0].enabled == False
2 changes: 2 additions & 0 deletions roles/default/kiali-deploy/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ kiali_defaults:
version_label: ""
view_only_mode: false

extensions: []

external_services:
custom_dashboards:
discovery_auto_threshold: 10
Expand Down
7 changes: 7 additions & 0 deletions roles/default/kiali-deploy/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ kiali_vars:
{{ kiali_defaults.deployment }}
{%- endif -%}
extensions: |
{%- if extensions is defined and extensions is iterable -%}
{{ extensions }}
{%- else -%}
{{ kiali_defaults.extensions }}
{%- endif -%}
external_services: |
{%- if external_services is defined and external_services is iterable -%}
{{ kiali_defaults.external_services | combine((external_services | stripnone), recursive=True) }}
Expand Down

0 comments on commit f50da9d

Please sign in to comment.