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

oauth-proxy container in che-gateway pod throws error while setting up eclipse-che on k8s cluster #21452

Closed
Divine1 opened this issue Jun 8, 2022 · 13 comments
Labels
area/install Issues related to installation, including offline/air gap and initial setup kind/question Questions that haven't been identified as being feature requests or bugs. severity/P1 Has a major impact to usage or development of the system.

Comments

@Divine1
Copy link

Divine1 commented Jun 8, 2022

Summary

i have configured a k8s cluster in my virtual machine and i installed eclipse-che using below command. the installation completed, but i have explained the issue below

chectl server:deploy --che-operator-cr-patch-yaml=/home/ubuntu/kubeapps/che-operator-cr-patch.yaml --platform=k8s --installer=operator --debug --k8spoderrorrechecktimeout=480000 --domain=eclipseche.mangotree.click --k8spodreadytimeout=480000

i was able to follow this documentation and integrate dex with an example-app successfully. Now i have to integrate dex and eclipse-che.

below screenshot shows the output after successfully installing eclipse-che in k8s cluster but without integrating eclipse-che with dex.

But what steps should i follow to inregrate eclipse-che and dex?

(not real url)sample url is https://eclipseche.example.click:31931/ , https://eclipseche.example.click:31931/dashboard

image

image

i investigated the error and found che-gateway-766fdb7b54-pb8bz pod in errored state. i investigated the state of the containers with-in the pod, oauth-proxy container in che-gateway-766fdb7b54-pb8bz pod is in errored state.

image

image

i checked the oauth-proxy container logs in che-gateway-766fdb7b54-pb8bz pod , it shows below error message. where should i update the information mentioned in the error message ?
Please help me on what should i do to fix this error?

image

Relevant information

No response

@Divine1 Divine1 added the kind/question Questions that haven't been identified as being feature requests or bugs. label Jun 8, 2022
@che-bot che-bot added the status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. label Jun 8, 2022
@l0rd
Copy link
Contributor

l0rd commented Jun 8, 2022

@sparkoo may have an idea how to address that.
Adding issue to the list in #21304

@Divine1
Copy link
Author

Divine1 commented Jun 9, 2022

@sparkoo please help me on this

@sparkoo
Copy link
Member

sparkoo commented Jun 9, 2022

you have to set these fields in CheCluster

spec:
  auth:
    identityProviderURL: 
    oAuthClientName: 
    oAuthSecret: 

@Divine1
Copy link
Author

Divine1 commented Jun 9, 2022

@sparkoo

could you please elaborate on that? where should i add it?

should i add it like below?
che-operator-cr-patch.yaml

apiVersion: org.eclipse.che/v1
kind: CheCluster
metadata:
  name: eclipse-che
spec:
  database:
    chePostgresHostName: datasd4567fgg86wjj.com
    chePostgresPassword: rasdf5664sfrot123
    chePostgresUser: vmsdf3456sfv123
    externalDb: true
  auth:
    identityProviderURL: 
    oAuthClientName: 
    oAuthSecret: 

is my below assumption correct?
identityProviderURL - https://dex.example.com
oAuthClientName - github client name (for example)
oAuthSecret - github client secret (for example)

Also, after i add this configuration using chectl server:deploy, which command shall i use to view the configuration in the k8scluster?

i apologize for asking the basic questions, please clarify...

chectl server:deploy --che-operator-cr-patch-yaml=/home/ubuntu/kubeapps/che-operator-cr-patch.yaml --platform=k8s --installer=operator --debug --k8spoderrorrechecktimeout=480000 --domain=eclipseche.mangotree.click --k8spodreadytimeout=480000

@sparkoo
Copy link
Member

sparkoo commented Jun 9, 2022

oAuthClientName and oAuthSecret is id and secret from Dex configuration https://github.com/dexidp/dex/blob/master/examples/config-dev.yaml#L110.

Che will always talk to Dex here. If you want to login with GitHub, you have to configure Dex to connect to it https://dexidp.io/docs/connectors/github/

It looks like this:
Che --(OIDC)--> Dex ----> Identity Provider (GitHub, Gitlab, Google, ...)

Kubernetes must be using same Dex for authentication and by that we're able to use Kubernetes RBAC to control permissions for users. It will also allow us to have various Identity providers.

chectl command looks right

@Divine1
Copy link
Author

Divine1 commented Jun 9, 2022

@sparkoo thank you for the details, i will try this and share the feedback.

@Divine1
Copy link
Author

Divine1 commented Jun 10, 2022

@sparkoo

today i updated eclipse-che to below version
image

then i installed eclipseche using below command

chectl server:deploy --che-operator-cr-patch-yaml=/home/ubuntu/kubeapps/che-operator-cr-patch.yaml --platform=k8s --installer=operator --debug --k8spoderrorrechecktimeout=480000 --domain=eclipseche.mangotree.click --k8spodreadytimeout=480000

i received below error in the operator pod kubectl logs che-operator-7cf69497d5-lhd5w -n eclipse-che -f

image

i tried to delete the eclipse-che namespace, but it remains in Terminating status
image

i'm not sure why this error appears now, i didnot face this issue previously

Please help me to fix this issue

@amisevsk amisevsk added severity/P1 Has a major impact to usage or development of the system. area/install Issues related to installation, including offline/air gap and initial setup and removed status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. labels Jun 10, 2022
@sparkoo
Copy link
Member

sparkoo commented Jun 11, 2022

cc: @tolusha can you please take a look what might be wrong?

@tolusha
Copy link
Contributor

tolusha commented Jun 13, 2022

It is related to switching to CheCluster API v2.
Could you try the following:

chectl server:delete
chectl server:deploy ...

If it fails, pls attach chectl logs.

@Divine1
Copy link
Author

Divine1 commented Jun 13, 2022

@tolusha

i ran chectl server:delete , but as shown in below screenshot, eclipse-che namespace still did not get deleted

image

image

@tolusha
Copy link
Contributor

tolusha commented Jun 13, 2022

Try to clean up checluster CR manually
oc patch checluster/eclipse-che --patch '{"metadata": {"finalizers": null}}' --type=merge -n eclipse-che
Namespace should be deleted automatically.

@Divine1
Copy link
Author

Divine1 commented Jun 13, 2022

@tolusha i have deleted my k8s cluster and created a new k8s cluster. i will use the solution you provided, if i face the issue again

i'm facing another issue while installing eclipse-che in new k8s cluster.
#21460

please help me to fix this issue

@Divine1 Divine1 closed this as completed Jun 13, 2022
@nischaysn
Copy link

nischaysn commented Sep 13, 2022

you have to set these fields in CheCluster

spec:
  auth:
    identityProviderURL: 
    oAuthClientName: 
    oAuthSecret: 

Hi @tolusha After adding this to my yaml still my oauth-proxy container is failing . the error it shows is :
[main.go:54] invalid configuration:
missing setting: login-url
missing setting: redeem-url
could you pls help me resolve this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/install Issues related to installation, including offline/air gap and initial setup kind/question Questions that haven't been identified as being feature requests or bugs. severity/P1 Has a major impact to usage or development of the system.
Projects
None yet
Development

No branches or pull requests

7 participants