Skip to content

Issues with Websockets for Che with Nginx-Ingress Controller. #23049

Open
@Wosin

Description

Summary

Hey!
I am facing an issue with Eclipse Che deployment on Vanilla k8s cluster running with Keycloak as OIDC provider using nginx-ingress controller. We have managed to pretty much configure and make everything work correctly, the only issue is the websocket connection.

We are using the below patch to deploy che:

apiVersion: org.eclipse.che/v2
spec:
  devEnvironments:
     serviceAccount: default
     defaultNamespace:
       autoProvision: false
  networking:
    ingressClassName: nginx
    annotations:
      acme.cert-manager.io/http01-edit-in-place: "true"
      cert-manager.io/cluster-issuer: le-wildcard-issuer
      nginx.ingress.kubernetes.io/ssl-redirect: "true"
    auth:
      gateway:
        oAuthProxy:
         cookieExpireSeconds: 300
        deployment:
          containers:
          - name: "oauth-proxy"
            env:
            - name: OAUTH2_PROXY_COOKIE_CSRF_PER_REQUEST
              value: "true"
            - name: OAUTH2_PROXY_PASS_AUTHORIZATION_HEADER
              value: "true"
            - name: OAUTH2_PROXY_WHITELIST_DOMAINS
              value: "[keycloak-url]"
            - name: OAUTH2_PROXY_COOKIE_REFRESH
              value: "200s"
      identityProviderURL: [keycloak-url]
      oAuthClientName: kubernetes-client
      oAuthSecret: XXXXXXXX

As I've mentioned everything in general works okay, but the websocket connetions to /dashboard/api/websocket are only working for as long as the initial oauth cookie is valid, after that they are failing with No valid authentication in request. Initiating login. and we see the WebSocket connections are failing. Refer to "Network Troubleshooting" in the user guide. error on dashboard screen.After manual refresh everything is back to normal, again for the validity time of the cookie set in the configuration.

Is there any documentation about setting up Che with Nginx to make sure the websocket connetions are working correctly ?

Relevant information

No response

Metadata

Assignees

No one assigned

    Labels

    area/che-operatorIssues and PRs related to Eclipse Che Kubernetes Operatorkind/questionQuestions that haven't been identified as being feature requests or bugs.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions