diff --git a/deploy/kiali/kiali_cr_dev_servicemesh.yaml b/deploy/kiali/kiali_cr_dev_servicemesh.yaml deleted file mode 100644 index 846425c6..00000000 --- a/deploy/kiali/kiali_cr_dev_servicemesh.yaml +++ /dev/null @@ -1,56 +0,0 @@ -apiVersion: kiali.io/v1alpha1 -kind: Kiali -metadata: - name: kiali - annotations: - ansible.sdk.operatorframework.io/verbosity: "1" -spec: - istio_namespace: "${ISTIO_NAMESPACE}" - version: "${KIALI_CR_SPEC_VERSION}" - auth: - strategy: "${AUTH_STRATEGY}" - deployment: - accessible_namespaces: [ "${ACCESSIBLE_NAMESPACES}" ] - image_name: "${KIALI_IMAGE_NAME}" - image_pull_policy: "${KIALI_IMAGE_PULL_POLICY}" - image_version: "${KIALI_IMAGE_VERSION}" - ingress: - enabled: true - namespace: "${NAMESPACE}" - service_type: "${SERVICE_TYPE}" - logger: - log_level: info - external_services: - grafana: - auth: - password: ${KIALI_EXTERNAL_SERVICES_PASSWORD} - type: basic - use_kiali_token: false - username: internal - enabled: true - in_cluster_url: https://grafana.${NAMESPACE}.svc:3000 - url: https://grafana-${NAMESPACE}.${ROUTER_HOSTNAME} - istio: - config_map_name: "istio-custom" - istio_sidecar_injector_config_map_name: "istio-sidecar-injector-custom" - istiod_deployment_name: "istiod-custom" - url_service_version: http://istiod-custom.${NAMESPACE}:15014/version - prometheus: - auth: - password: ${KIALI_EXTERNAL_SERVICES_PASSWORD} - type: basic - use_kiali_token: false - username: internal - url: https://prometheus.${NAMESPACE}.svc:9090 - tracing: - auth: - password: ${KIALI_EXTERNAL_SERVICES_PASSWORD} - type: basic - use_kiali_token: false - username: internal - enabled: true - in_cluster_url: https://jaeger-query.${NAMESPACE}.svc - url: https://jaeger-${NAMESPACE}.${ROUTER_HOSTNAME} - use_grpc: false - installation_tag: Kiali [${NAMESPACE}] - istio_namespace: ${NAMESPACE} diff --git a/molecule/asserts/configmap_asserts.yml b/molecule/asserts/configmap_asserts.yml index d485ac1d..0cd152b8 100644 --- a/molecule/asserts/configmap_asserts.yml +++ b/molecule/asserts/configmap_asserts.yml @@ -29,22 +29,16 @@ assert: that: - kiali_configmap.external_services.prometheus.url == "http://prometheus.{{ istio.control_plane_namespace }}:9090" - when: - is_maistra == False - name: Assert Kiali Configmap has the correct Grafana Url for Upstream Istio installs assert: that: - kiali_configmap.external_services.grafana.in_cluster_url == "http://grafana.{{ istio.control_plane_namespace }}:3000" - when: - is_maistra == False - name: Assert Kiali Configmap has correct Version Url for Upstream Istio installs assert: that: - kiali_configmap.external_services.istio.url_service_version == "http://istiod.{{ istio.control_plane_namespace }}:15014/version" - when: - is_maistra == False - name: Actual Kiali Accessible namespace list should be the same as the CR assert: diff --git a/molecule/common/tasks.yml b/molecule/common/tasks.yml index b3394f7a..f58a0ac6 100644 --- a/molecule/common/tasks.yml +++ b/molecule/common/tasks.yml @@ -7,24 +7,6 @@ is_k8s: "{{ False if 'route.openshift.io' in api_groups else True }}" is_minikube: "{{ True if lookup('env', 'MOLECULE_CLUSTER_TYPE') == 'minikube' else False }}" is_kind: "{{ True if lookup('env', 'MOLECULE_CLUSTER_TYPE') == 'kind' else False }}" -- name: Determine the Istio implementation - set_fact: - is_maistra: "{{ True if 'maistra.io' in api_groups else False }}" - -- name: Get SMCP if running in Maistra environment - k8s_info: - api_version: maistra.io/v2 - kind: ServiceMeshControlPlane - namespace: "{{ istio.control_plane_namespace }}" - register: maistra_smcp - when: - - is_maistra == True - -- name: There must one and only one SMCP already installed in the control plane - set_fact: - maistra_smcp: "{{ maistra_smcp.resources[0] }}" - when: - - is_maistra == True - name: Get Kiali CR if present set_fact: diff --git a/molecule/default/destroy.yml b/molecule/default/destroy.yml index 52aa05f0..9ce78dc3 100644 --- a/molecule/default/destroy.yml +++ b/molecule/default/destroy.yml @@ -14,9 +14,6 @@ is_k8s: "{{ False if 'route.openshift.io' in api_groups else True }}" is_minikube: "{{ True if lookup('env', 'MOLECULE_CLUSTER_TYPE') == 'minikube' else False }}" is_kind: "{{ True if lookup('env', 'MOLECULE_CLUSTER_TYPE') == 'kind' else False }}" - - name: Determine the Istio implementation - set_fact: - is_maistra: "{{ True if 'maistra.io' in api_groups else False }}" - name: Determine if the operator installation is managed externally or not set_fact: @@ -51,12 +48,6 @@ retries: "{{ wait_retries }}" delay: 5 - - name: Delete any NetworkPolicy that was created - import_tasks: process-network-policy.yml - vars: - network_policy_state: "absent" - network_policy_namespace: "{{ kiali.install_namespace }}" - - name: Uninstall Operator via Helm command: argv: diff --git a/molecule/default/prepare.yml b/molecule/default/prepare.yml index 7d3b059e..05aba2dc 100644 --- a/molecule/default/prepare.yml +++ b/molecule/default/prepare.yml @@ -14,43 +14,11 @@ is_k8s: "{{ False if 'route.openshift.io' in api_groups else True }}" is_minikube: "{{ True if lookup('env', 'MOLECULE_CLUSTER_TYPE') == 'minikube' else False }}" is_kind: "{{ True if lookup('env', 'MOLECULE_CLUSTER_TYPE') == 'kind' else False }}" - - name: Determine the Istio implementation - set_fact: - is_maistra: "{{ True if 'maistra.io' in api_groups else False }}" - name: Determine if the operator installation is managed externally or not set_fact: operator_installer: "{{ lookup('env', 'MOLECULE_OPERATOR_INSTALLER') | default('helm', True) }}" # can be 'helm' or 'skip' - - name: Get the SMCP name if on Maistra - k8s_info: - api_version: maistra.io/v2 - kind: smcp - namespace: "{{ istio.control_plane_namespace }}" - register: smcp_raw - when: - - is_maistra == True - - - set_fact: - smcp_name: "{{ smcp_raw.resources[0].metadata.name }}" - when: - - is_maistra == True - - - name: See if we have Maistra htpasswd secret for accessing external services like Prometheus - k8s_info: - api_version: v1 - kind: Secret - namespace: "{{ istio.control_plane_namespace }}" - name: htpasswd - register: maistra_secret_htpasswd_raw - when: - - is_maistra == True - - - set_fact: - maistra_secret_password: "{{ maistra_secret_htpasswd_raw.resources[0].data.rawPassword | b64decode }}" - when: - - is_maistra == True - - name: Make sure the operator namespace exists k8s: state: present @@ -124,12 +92,6 @@ kind: Namespace name: "{{ cr_namespace }}" - - name: Create any NetworkPolicy needed to access the Kiali UI - import_tasks: process-network-policy.yml - vars: - network_policy_state: "present" - network_policy_namespace: "{{ kiali.install_namespace }}" - - name: Wait for the CRD to be established k8s_info: api_version: apiextensions.k8s.io/v1 @@ -143,42 +105,6 @@ set_fact: kiali_cr_definition: "{{ lookup('template', cr_file_path) }}" - - name: Modify the Kiali CR definition with specific Maistra config for Prometheus, Tracing, Grafana and Istio - vars: - prometheus_config: - url: "https://prometheus.{{ istio.control_plane_namespace }}.svc:9090" - auth: - username: internal - type: basic - use_kiali_token: false - password: "{{ maistra_secret_password }}" - tracing_config: - in_cluster_url: "https://jaeger-query.{{ istio.control_plane_namespace }}.svc" - url: "https://jaeger-query.{{ istio.control_plane_namespace }}.svc" - use_grpc: false # today, OSSM 2.2 and under cannot use gRPC - auth: - username: internal - type: basic - use_kiali_token: false - password: "{{ maistra_secret_password }}" - grafana_config: - in_cluster_url: "https://grafana.{{ istio.control_plane_namespace }}.svc:3000" - url: "https://grafana.{{ istio.control_plane_namespace }}.svc" - auth: - username: internal - type: basic - use_kiali_token: false - password: "{{ maistra_secret_password }}" - istio_config: - config_map_name: "istio-{{ smcp_name }}" - istio_sidecar_injector_config_map_name: "istio-sidecar-injector-{{ smcp_name }}" - istiod_deployment_name: "istiod-{{ smcp_name }}" - url_service_version: "http://istiod-{{ smcp_name }}.{{ istio.control_plane_namespace }}:15014/version" - set_fact: - kiali_cr_definition: "{{ kiali_cr_definition | from_yaml | combine({'spec':{'external_services':{'prometheus': prometheus_config, 'tracing': tracing_config, 'grafana': grafana_config, 'istio': istio_config }}}, recursive=True) | to_yaml }}" - when: - - is_maistra == True - - name: Create Kiali CR k8s: namespace: "{{ cr_namespace }}" diff --git a/molecule/default/process-network-policy.yml b/molecule/default/process-network-policy.yml deleted file mode 100644 index a3f23ee1..00000000 --- a/molecule/default/process-network-policy.yml +++ /dev/null @@ -1,19 +0,0 @@ -- name: "Process NetworkPolicy needed to access the Kiali UI when in Maistra environment [state={{ network_policy_state }}]" - k8s: - state: "{{ network_policy_state }}" - definition: - apiVersion: networking.k8s.io/v1 - kind: NetworkPolicy - metadata: - name: kiali-network-policy-molecule - namespace: "{{ network_policy_namespace }}" - labels: - app.kubernetes.io/name: kiali - spec: - podSelector: - matchLabels: - app.kubernetes.io/name: kiali - policyTypes: ["Ingress"] - ingress: [{}] - when: - - is_maistra == True diff --git a/molecule/metrics-test/converge.yml b/molecule/metrics-test/converge.yml index 04e2c4eb..27a94d9d 100644 --- a/molecule/metrics-test/converge.yml +++ b/molecule/metrics-test/converge.yml @@ -21,11 +21,9 @@ test_start_time: "{{ ansible_date_time.iso8601 }}" - set_fact: - # OSSM 2.2 uses Prometheus 2.23.0. Upstream Istio Prometheus addon uses something >2.31.0. The label is different for each. - prom_namespace_label: "{{ 'kubernetes_namespace' if is_maistra == True else 'namespace' }}" + prom_namespace_label: "namespace" # Operator metrics are always enabled - make sure we have them - # NOTE: Service Mesh/Maistra does NOT collect these metrics, so do not test when running in Maistra env. # an operator http-metric - import_tasks: ../common/query-prometheus.yml @@ -33,13 +31,9 @@ prometheus_request: query: "workqueue_work_duration_seconds_count{app=\\\"kiali-operator\\\",{{ prom_namespace_label }}=\\\"{{ kiali.operator_namespace }}\\\"}" time: "{{ test_start_time}}" - when: - - is_maistra != True - assert: that: - prometheus_query_results.json.data.result | length > 0 - when: - - is_maistra != True # an operator build info metric - import_tasks: ../common/query-prometheus.yml @@ -47,13 +41,9 @@ prometheus_request: query: "ansible_operator_build_info" time: "{{ test_start_time}}" - when: - - is_maistra != True - assert: that: - prometheus_query_results.json.data.result | length > 0 - when: - - is_maistra != True # The test is initialized with Kiali metrics turned off so there should not be any yet - import_tasks: ../common/query-prometheus.yml