-
Notifications
You must be signed in to change notification settings - Fork 5
Unable to login to openunison #32
Comments
you should check the AFAIK, |
Ok, thanks. Yes I see in the logs for the operator an error about creating secrets. I will look into that. Regarding NGinx for ingress. I did see that. Someone from Tremulo indicated that other ingresses should be reported in the future and that using Kong should not prevent this from working. I am not sure why the ingress would matter. Ingress just handles coming into the cluster. Openunison should only be deploying into the cluster. Any ingress should be fine as long as it points to the correct backend service. Brian |
Here is what I see in the operator log. Not that it states to "check the logs". Not sure what logs it means: Done invoking javascript |
I don't know that openunison would need to run on a NodePort. The
For 1, the key is to have the annotation
This can be done in the helm chart by adding the annotations to
For option 2, you can set
Your
There should be an error earlier in the logs? Have you deployed the k8s dashboard yet? |
I will look at suggestions for the HELM. Also, Yes, the dashboard is installed an I can connect. I am currently using the same VIP (which points to each of my controplane nodes) for Dashboard and what would have been openunison and just separating by NodePort. Apparently that is not going to work and I should set up a distinct entry in my F5 for each. Brian |
openunison runs two "logical" applications (akin to virtual hosts) that both run in the same container. You woudln't need (not want) to run the dashboard as a public Ingress or NodePort. For dashboard it's User --> LB --> Ingress --> OpenUnison --> Dashboard. |
I have pod security policies in place. Is it possible that is what is preventing this from deploying correctly? Do I need to give the openunison-operator service account elevated privileges? |
I tried updating the envionment so that the Dashboard pointed to the Cluster IP of the dashboard service. I believe it was stated that openunison could access the dashboard from pod to pod rather than using the external address. However I am still seeing issues: Invoking javascript |
Correct, there's no need to have an external IP for the dashboard. OpenUnison talks to it via the service. Just to double check, the dashboard is version 2.x running in the Also, did you create the |
Yes dashboard runs in that namespace: Pod Template: I created the orchestra-secrets-source per the documentation. Opaque secret with base 64 encoded values. Brian |
i'm noticing you have an IP for your Can you use host names for these instead of IPs? Generally the host names will point to the load balancer, which in turn is linked to the Ingress controller which routes the request based on your |
I originally was using my CN (alias for my cluster), however that was not working since I use nodePort for my ingress. So I should use the service name for the Dashboard? When you say Load balancer, are you talking about the internal one? I have calico which does load balancing. I also have my kong proxy. |
this is a common question. let me draw something out to see if it helps since the terms can be interpreted different ways depending on what layer of the infrastructure you're talking about. |
Does this do a better job of explaining the network flow and how the pieces fit? This is generic (though based on a simple model such as Nginx Ingress). I've not deployed Kong so I'm not sure how it would differ but most Ingress controllers work along the same lines. Both DNS entries for I think the issue you are seeing right now is because your K8S_DB_HOST is set to an IP. Both K8S_DB_HOST should be fully qualified DNS host names that point to your load ballancer. |
Ok, so your assuming there is a load ballancer in front of Kubernetes. I have F5, but it does not have the Kubernetes load ballancer option. So as I stated earlier I am using node port and allowing kube-api and calico to do the load balancing to pods. Sounds like I need to create some more F5 entries and mask the nodePort for the objects. Of course for your example you have k8sdb.domain.com for your dashboard, but then you state: " OpenUnison then routes dashboard traffic directly to the dashboard Service", but apparently that is not true since it appears you need a CName entry in the load ballancer for the dashboard too. So sounds like I need to do the following: Two separate F5 entries for Dashboard and OpenUnison that would point to my nodePorts managed by Kong ingress proxy. Sound right? Brian |
yes
you need the additional CNAME entry in the load balancer so OpenUnison knows how to route traffic. We do so based on the host name of the URL (similar to how the Ingress controller routes requests based on host name to
There would be a single nodePort (as OpenUnison has just one |
I tried to redeploy with modifications to the values.yaml for those URLs. Still getting errors during creation: Getting host variable names |
Your hosts shouldn't include the protocol |
Removed https from the hosts, but still seeing: java.lang.IllegalArgumentException: Last unit does not have enough valid bits |
What happens if you remove the ports? (I know you want to run on nodeport, just curious if it will run) |
Same error during creation after removing ports as well (java.lang.IllegalArgumentException: Last unit does not have enough valid bits) Brian |
Hmm. Something in your input is breaking cert generation. Will add better error handling and reporting to the operator to give you better feedback. |
Could it be this part of the values.yaml that is used during the helm install? openunison: Should that secrets point to the kubernetes secret I created? I tried adding it in like: openunison: , but I received an error with that as well: $ helm install orchestra tremolo/openunison-k8s-login-oidc --namespace openunison -f ./values.yaml |
Seems like the issue might have been related to the trusted_certs section. I did not originally change that from the example values.yaml provided by openunison. I just attempted to use the name and PEM value from my OIDC and when trying to create after that I get the following error: java.security.cert.CertificateException: java.io.IOException: Invalid BER/DER data (too huge?) |
so your saying your values.yaml still has:
? |
It did, until I just tried with the PEM values from the cert of my OIDC. However when I did that I got that too huge error. |
is your oidc identity provider a public provider? (ie okta)? |
Yes, our company has set up okta. |
Great, you don't need to set the cert
Once you replace that section with an empty list hopefully we'll get past the cert generation error |
Ok, I will try it |
Ok, yes that seemed to work... Now orchestrator gets an error :) [2021-03-01 16:49:00,152][main] INFO OpenShiftTarget - Token: '***************************' Caused by: java.nio.file.NoSuchFileException: /var/run/secrets/kubernetes.io/serviceaccount/token |
Odd, in your values.yaml, what's your |
services: |
does your cluster support the TokenRequest API? |
I double checked the code, we're not making tokenrequest available until 1.0.21 (next release), this week. For now |
Ok, thanks. That helped... I am seeing the pod for the orchestra now. Now if I could get Kong to play nice we would be in good shape. Unless you have any suggestion regarding kong config with this I think I have gone as far as I can with this thread. What I am seeing now is an issue with kong ingress communicating with openunison: 2021/03/01 19:25:52 [error] 22#0: *20344447 upstream timed out (110: Operation timed out) while connecting to upstream, client: 172.16.0.0, server: kong, request: "GET /ou HTTP/2.0", upstream: "https://172.16.127.136:8443/" |
is |
Yes that is the orchestra pod: pod/openunison-orchestra-9c7d69cc5-xmlv6 1/1 Running 0 28m 172.16.127.136 Yes kong is inside the cluster NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE NAME READY UP-TO-DATE AVAILABLE AGE NAME DESIRED CURRENT READY AGE |
What's your |
Here is what I currently have (monitoring commented out as I am not running prometheus) network_policies: So I should add? Under the ingress section? |
I added kong to the network policies. I see that it created one, but I still see the timeout errors. 2021/03/01 21:49:47 [error] 22#0: *20496133 upstream timed out (110: Operation timed out) while connecting to upstream, client: 172.16.0.0, server: kong, request: "GET /ou HTTP/2.0", upstream: "https://172.16.127.141:8443/" Name: allow-from-ingress |
I think what you want is:
The labels all must match the source namespaces to allow traffic from it. So adding Also, commenting out the monitoring block will take the defaults, which is |
Ok, I made those changes and redeployed. I am still seeing the timeout errors connecting to the upstream target. So I can see in Kong ingress where it tries to connect to openunison, but I don't see anything in the logs for the orchestra. Is there somewhere else I should look? 2021/03/02 13:03:33 [error] 22#0: *21140768 upstream timed out (110: Operation timed out) while connecting to upstream, client: 172.16.220.64, server: kong, request: "GET /ou HTTP/2.0", upstream: "https://172.16.127.145:8443/" NAME READY STATUS RESTARTS AGE IP NODE |
I see in the logs for the orchestra that it is watching the following cluster IP: [2021-03-02 13:03:18,628][Thread-14] INFO K8sLoadTrusts - watching https://10.96.0.1:443/apis/openunison.tremolo.io/v1/namespaces/openunison/trusts?watch=true&timeoutSeconds=1 However that is the default kubernetes cluster IP for my system in the default namespace. That would be coordinated from the kubernetes-api no? [2021-03-02 13:03:18,628][Thread-14] INFO K8sLoadTrusts - watching https://10.96.0.1:443/apis/openunison.tremolo.io/v1/namespaces/openunison/trusts?watch=true&timeoutSeconds=10 Do I need to change the api server mentioned in the values.yaml to be the kong-proxy? Brian |
I logged into the orchestra and not sure if it is healthy: openunison@openunison-orchestra-9c7d69cc5-5vkph:/$ curl -L -k -I localhost:8443 curl -L -k -I https://172.16.127.155:8443 |
If you disable network policies entirely by setting
This is openunison talking to the API server to see if any changes have come in for trust objects. These are the objects that you create for adding additional clusters or applications and is unrelated to the issues you're seeing now. |
Disabling the network policies and adding an ingress rule helped, but on the orchestrator pod I see: [2021-03-02 15:49:23,384][XNIO-1 task-1] INFO AccessLog - [NotFound] - UNKNOWN - https://XXXXXXX:31725/ - cn=none - Resource Not Found [172.16.64.138] - [fcb433f6953777147e2962d1acab94a5c30eeee8d] |
is |
Yes, Host is the same as what I putting on the browser. |
Are you including the port in |
That does not seem to help either. I am getting an upsteam timeout... pstream timed out (110: Operation timed out) while connecting to upstream, client: 172.16.44.192, server: kong, request: "GET / HTTP/2.0", upstream: "http://172.16.127.162:8443/" |
If I am on the orchestra host, shouldn't I be able to curl the site? openunison@openunison-orchestra-9c7d69cc5-czhcx:/$ curl -L http://localhost:8080/ |
Tried using the pods IP as well. This is what the openunison service points to. Explains why kong is getting errors as well: 021/03/03 18:59:00 [error] 22#0: *22804688 upstream timed out (110: Operation timed out) while connecting to upstream, client: 172.16.220.64, server: kong, request: "GET / HTTP/2.0", upstream: "https://172.16.127.167:8443/" NAME READY STATUS RESTARTS AGE IP openunison@openunison-orchestra-9c7d69cc5-czhcx:/$ curl -I -k -L https://172.16.127.167:8443 |
Definitely something off with how these network policies are set up I think. I don't have any issues hitting my Kubernetes dashboard so I know that Kong and calico are basically working correctly. I found that if I login to the orchestrator pod and hit localhost. I can get a response from tremolo, but if I try to hit the service from the operator pod I get a timed out. _openunison@openunison-orchestra-9c7d69cc5-czhcx:/$ curl -L -i -k https://127.0.0.1:8443/auth HTTP/1.1 500 Internal Server Error |
Seems like there is an issue with the openunison site/dashboard. The server does not respond. Getting 404 errors on the default page. Is there a specific URL that is required? Documentation seems to indicate that nothing is required and a redirect would occur if someone hits the base URL, but indication from the server is that is not happening: Reading HSTS entries from /usr/local/openunison/.wget-hsts ---request begin--- ---request end--- ---response end--- |
yes. You need to hit openunison using the host name as defined in |
If I curl to the kong ingress I get a timeout error. Kong is sending the request to the Service which redirects to the pods internal IP. How can I use the network.openunison_host inside the Kubernetes cluster? It has no knowledge of the outside DNS? It only knows about internal names to the cluster.
Brain
From: Marc Boorshtein <[email protected]>
Sent: Friday, March 5, 2021 10:11 AM
To: OpenUnison/openunison-k8s-login-oidc <[email protected]>
Cc: Bellrose, Brian <[email protected]>; Author <[email protected]>
Subject: [EXTERNAL]: Re: [OpenUnison/openunison-k8s-login-oidc] Unable to login to openunison (#32)
Getting 404 errors on the default page. Is there a specific URL that is required?
yes. You need to hit openunison using the host name as defined in network.openunison_host. You're getting a 404 because there's no app defined for 127.0.0.1/. I think the issue you're having is that you're not trying to access via the standard https port (443). if you do a curl to your kong ingress, do you get a 302 in response? Is the hanging in the browser?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_OpenUnison_openunison-2Dk8s-2Dlogin-2Doidc_issues_32-23issuecomment-2D791480112&d=DwMCaQ&c=pG3N8eJDEvizGbIy8hw-0w&r=Avd8jJaAOeUVJ3AmVEriBLvYqiK8qqaP7C8huZnWyCI&m=Rixu_YdB0ZmBKXOXMXb02PFDsQCZYxoS61GLYsMKbWk&s=xytir8zPuh7vqp2LhuJoOIzjE4opB4Asvz_WSuA305E&e=>, or unsubscribe<https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AOZIRZFOCKQFUCRGPZQUZB3TCDYA5ANCNFSM4X42ZTDA&d=DwMCaQ&c=pG3N8eJDEvizGbIy8hw-0w&r=Avd8jJaAOeUVJ3AmVEriBLvYqiK8qqaP7C8huZnWyCI&m=Rixu_YdB0ZmBKXOXMXb02PFDsQCZYxoS61GLYsMKbWk&s=VOZEMccMp2Mfjf1Y1a9OBBroKd_NgvRTEm0iWkXT3mc&e=>.
This email and any attachments are only for use by the intended recipient(s) and may contain legally privileged, confidential, proprietary or otherwise private information. Any unauthorized use, reproduction, dissemination, distribution or other disclosure of the contents of this e-mail or its attachments is strictly prohibited. If you have received this email in error, please notify the sender immediately and delete the original. Neither this information block, the typed name of the sender, nor anything else in this message is intended to constitute an electronic signature unless a specific statement to the contrary is included in this message.
|
Seems like there is a disconnect between Openunison and the Kubernetes cluster. When Kong receives the request from the browser the Ingress catches it and forwards it to the openunison-orchestra service. Which in turn knows about the pod that openunison is running on. So what I see is the service handing off to the internal IP of the pod client: 172.16.0.0, server: kong, request: "GET / HTTP/2.0", upstream: "https://172.16.127.167:8443/ And this receives a timeout error. It sounds like you are saying this is occuring because openunison does not know about that host and the service should be redirecting the call to the name provided by the network.openunison_host parameter, is that correct? However, when I curl the internal IP for that POD and I pass the address as indicated I get a 404 not found: If I modify that and pass /auth to the internal IP I seem to get a redirect code indicating it found something. So seems like this may be an openunison issue more than a Kong redirect issue. No? openunison@openunison-orchestra-9c7d69cc5-czhcx:/$ curl -I -L -k https://172.16.127.167:8443/auth HTTP/1.1 500 Internal Server Error |
I followed the instruction for deploying this using help. I notice that it does not create a pod for the orchestra, but a kind of "OpenUnison". There is no pod, no service, no ingress. How can I expose this without a service?
I am using kubernetes 1.20 with Kong as my Ingress Controller. I am using kong with nodeport. So any service would have to be a NodePort service:
$ kubectl get all -n openunison
NAME READY STATUS RESTARTS AGE
pod/openunison-operator-6b95dc6574-v2t7p 1/1 Running 0 2d
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/openunison-operator 1/1 1 1 2d
NAME DESIRED CURRENT READY AGE
replicaset.apps/openunison-operator-6b95dc6574 1 1 1 2d
kubectl get openunison orchestra -n openunison
NAME AGE
orchestra 4h34m
For the values.yaml used with HELM. Would I need to set my openunison_host to be my Cluster IP:NodePort? How do I know what I should set this URL to normally I hit my host with the generic VIP I set up and then the NodePort.
Brian
The text was updated successfully, but these errors were encountered: