Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[hack] bring back kiali in MC scripts #7312

Merged
merged 4 commits into from May 9, 2024

Conversation

jmazzitelli
Copy link
Collaborator

@jmazzitelli jmazzitelli commented Apr 25, 2024

fixes: #7313

I do not know why these were removed. We have all the kiali options for these hack scripts but they are now ignored - kiali is never deployed even if enabled.

These were removed in the following commits:

I do not know why these were removed. We have all the kiali options for these hack scripts but they are now ignored - kiali is never deployed even if enabled.

These were removed in the following commits:

* kiali@804f21e#diff-ae968abe0209eefd78f858f137a2e418a056ec6e02965d2214bcb46c8a978efeL77-L78
* kiali@d8631a1#diff-b53029271ec37bbeb86a1eb29db8fd5e77a74f0fda8dac3d7d22109fcb11fdf3L203-L204
@jmazzitelli
Copy link
Collaborator Author

I'm testing this now. I'm curious why these are removed... there must have been a reason :) But with them removed, all the kiali options are useless and you never get kiali installed if you use these hack scripts to start a MC demo.

@jmazzitelli
Copy link
Collaborator Author

jmazzitelli commented Apr 25, 2024

After running hack/istio/multicluster/install-primary-remote.sh I now see kiali:

$ kubectl --context east get pods -n istio-system -l app=kiali
NAME                     READY   STATUS    RESTARTS   AGE
kiali-7b556f99cf-gjhsv   1/1     Running   0          3m37s

But I cannot port forward and access it - the login process attempts to redirect to the openid endpoint http://localhost/kiali/api/auth/openid_redirect that doesn't exist.

Looking at the logs of the script while it was installing, I see some errors as it tries to update some kiali things:

(Helm: Chart=[kiali-server], Release=[kiali-server], Version=[1.83.0])
service/kiali patched
service/kiali condition met
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:00:03 --:--:--     0curl: (6) Could not resolve host: realms
curl: (6) Could not resolve host: admin
curl: (6) Could not resolve host: admin
clusterrolebinding.rbac.authorization.k8s.io/kiali-testing-user created
clusterrole.rbac.authorization.k8s.io/kiali created
clusterrolebinding.rbac.authorization.k8s.io/kiali-testing-user created
Switched to context "west".

I think the errors occur in here: https://github.com/kiali/kiali/blob/v1.83.0/hack/istio/multicluster/deploy-kiali.sh#L139-L152

@jmazzitelli
Copy link
Collaborator Author

Same thing with the other script - only this time it exits immediately when the error occurs:

INFO: A remote cluster secret named [kiali-remote-cluster-secret-west] has been created in the Kiali cluster namespace [istio-system]. It can be used by Kiali to access the remote cluster.
Release "kiali-server" does not exist. Installing it now.
NAME: kiali-server
LAST DEPLOYED: Thu Apr 25 14:03:24 2024
NAMESPACE: istio-system
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
Welcome to Kiali! For more details on Kiali, see: https://kiali.io

The Kiali Server [v1.83.0] has been installed in namespace [istio-system]. It will be ready soon.

(Helm: Chart=[kiali-server], Release=[kiali-server], Version=[1.83.0])
service/kiali patched
service/kiali condition met
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:00:10 --:--:--     0curl: (6) Could not resolve host: realms
curl: (6) Could not resolve host: admin

@jmazzitelli
Copy link
Collaborator Author

All CI checks are passing, so the changes to this PR do not affect the CI setup / scripts. That's a good thing. I will try to figure out how to clear up those errors and get this to work so people can run the MC hack scripts and get a MC demo running locally with Kiali.

@jmazzitelli
Copy link
Collaborator Author

KEYCLOAK_ADDRESS is an empty string when the deploy-kiali.sh is being called... I believe that's the problem. We need that set correctly and hopefully that fixes the problem

@jmazzitelli
Copy link
Collaborator Author

jmazzitelli commented Apr 25, 2024

@nrfox What should KEYCLOAK_ADDRESS be when on minikube?

Based on what I see, our deploy-kiali.sh is not even being used anymore anywhere. I put the code back to invoke it again, but it can't run because KEYCLOAK_ADDRESS is an empty string.

I think if I find out what KEYCLOAK_ADDRESS is supposed to be, we can set it and it should be back to working.

I'm curious how people are actually using these MC hack scripts to use a MC environment without having Kiali even deployed?

@nrfox
Copy link
Contributor

nrfox commented Apr 25, 2024

I'm testing this now. I'm curious why these are removed... there must have been a reason

I think if you add back the deploy-kiali.sh call then you will end up trying to deploy Kiali twice when running kind since that script is called here:

"${SCRIPT_DIR}"/istio/multicluster/install-multi-primary.sh \
--manage-kind true \
--certs-dir "${certs_dir}" \
-dorp docker \
--istio-dir "${istio_dir}" \
${hub_arg:-}

And later kiali is deployed here:

auth_flags=()
if [ "${AUTH_STRATEGY}" == "openid" ]; then
local keycloak_ip
keycloak_ip=$(kubectl get svc keycloak -n keycloak -o=jsonpath='{.status.loadBalancer.ingress[0].ip}' --context "${cluster1_context}")
auth_flags+=(--keycloak-address "${keycloak_ip}")
auth_flags+=(--certs-dir "${certs_dir}")
fi
"${SCRIPT_DIR}"/istio/multicluster/deploy-kiali.sh \
--cluster1-context ${cluster1_context} \
--cluster2-context ${cluster2_context} \
--cluster1-name ${cluster1_name} \
--cluster2-name ${cluster2_name} \
--manage-kind true \
${auth_flags[@]} \
-dorp docker \
-kas "${AUTH_STRATEGY}" \
-kudi true \
-kshc "${HELM_CHARTS_DIR}"/_output/charts/kiali-server-*.tgz

I'm curious how people are actually using these MC hack scripts to use a MC environment without having Kiali even deployed?

Personally I just use kind because that is what CI uses and it is the easiest to setup and consumes the least amount of resources. Which might mean that minikube isn't well supported if other folks are not running it.

@nrfox What should KEYCLOAK_ADDRESS be when on minikube?

This is where keycloak address comes from in the kind setup:

local keycloak_ip
keycloak_ip=$(kubectl get svc keycloak -n keycloak -o=jsonpath='{.status.loadBalancer.ingress[0].ip}' --context "${cluster1_context}")
auth_flags+=(--keycloak-address "${keycloak_ip}")

@nrfox
Copy link
Contributor

nrfox commented Apr 26, 2024

@jmazzitelli I think if you run these separately it might still work on minikube:

hack/istio/multicluster/install-multi-primary.sh -mm true -kudi true
hack/istio/multicluster/deploy-kiali.sh --single-kiali true --cluster1-context east --cluster2-context west --kiali-auth-strategy openid --keycloak-address keycloak-192-168-39-130.nip.io

@jmazzitelli
Copy link
Collaborator Author

./hack/istio/multicluster/install-multi-primary.sh results in:

image

@jmazzitelli
Copy link
Collaborator Author

hack/istio/multicluster/install-primary-remote.sh results in:
image

@jmazzitelli jmazzitelli marked this pull request as ready for review May 9, 2024 01:47
@jmazzitelli jmazzitelli self-assigned this May 9, 2024
Copy link
Collaborator

@jshaughn jshaughn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Visually approving this.

@jshaughn jshaughn added the test: n/a PR does not need test additions or updates label May 9, 2024
@jmazzitelli jmazzitelli merged commit 792b516 into kiali:master May 9, 2024
9 checks passed
@jmazzitelli jmazzitelli deleted the hack-mc-bring-back-kiali branch May 9, 2024 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test: n/a PR does not need test additions or updates
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[hack] multicluster hack scripts fail to install Kiali
3 participants