Certificate Inheritance in Che pods on OpenShift?
Summary
Hey all, I was just wondering, is there any certificate inheritance between the different pods used by Che in the OpenShift version? For example, if the original Che pod has a bunch of special certificates in its truststore beyond the default one, will the Che Plugin Broker pod generated by it also have the same truststore? I'm asking because I see that some traits of the pod seem to be inherited from the Che pod (Like the proxy settings for example), so I was wondering if it's the same case for the truststore. If this is not the case, then I think this should be considered as an (optional?) feature for the next version of Che.
Relevant information
I've been trying to set up Eclipse Che on OpenShift in an enterprize environment with a proxy for about a month now, and I've hit a lot of different errors and snags due to proxy configuration and certificate configuration. I was dismayed to realize that there was still work to be done ever after I got the certificates into the Che pod, and I'm trying to figure out if there is no inheritance or if I messed up putting the certificates into the Che pod.
There are no sudo rights on OpenShift, so we're not able to configure root trust store.
But we implemented and tested an ability to run Che with self-signed certificates, you should create a secret with your self-signed cert (there is only one allowed) and Che will propagate it for its components - Che Server, Plugin Broker, Theia... So, it's configured for each process individually and command like curl https://my-self-signed-host.com will fail because the default trust store is not modified.
@AmitChameides Does it answer your question? Feel free if more info, instructions on how to deploy such Che are needed.
Thanks for the reply @sleshchenko , let me see if I got everything right:
- I can put my self-signed certificate into a secret with the details you described
- I can only put one certificate into this secret
- I can then make Che use this certificate, and in turn all its components (Like the Che Plugin Broker) use it as well
- This configured for each process, so it'll affect the Che code while not affecting the pod passively, so commands ran from the terminal like
curlwill not be affected by this self-signed-certificate.
Please confirm this is correct :)
If so, I do have some follow-up questions:
- My problem is that the Che pods receive packets which are signed by my custom certificates, and don't recognize them because its certificates are not in Che's trust-store. Will changing the self-signed-certificate change this? Because as far as I understand changing the self-signed-certificate changes how Che signs its own packets, and not how it handles the certificates of packets it receives. Could it be that by using this certificate, Che learns to trust packets it receives signed with the same certificate?
- In my case, I actually have a group of certificates which my company uses. I'm not sure which specific certificate the proxy in question uses, so I'd like to include all certificates if possible. Does the encoding of the certificate given to the self-signed-certificate matter? Because when exporting the certificates together in my local computer I have the option to group them together into a single certificate file which is .P7B encoded, so I can use that to cover all fronts :)
Once again, thanks for your help.
Please confirm this is correct :)
Correct!
Will changing the self-signed-certificate change this? Because as far as I understand changing the self-signed-certificate changes how Che signs its own packets, and not how it handles the certificates of packets it receives.
I believe it should change it. Actually OpenShift is a guy who signs Che's packets. And Che is configured with self-signed certificate only for verifying the certificates of packets it receives.
I actually have a group of certificates which my company uses
It must be CA( actually Che Server and Plugin Broker can be configured with Non-CA cert, but Theia will fail). Don't you have a common CA cert for your company certs?
I have the option to group them together into a single certificate file which is .P7B encoded
Can not say for sure. At least you can try it.
Okay, definitely sounds like it's worth trying! I tried the method you described here, and the first part is clear for me, but the second is a little confusing. What is Che CR? How can I modify this field in this file exactly? Should I do it prior to creating my Che project on OpenShift or by configurating its properties afterwards?
I also tried using the grouped-certificate comprised of the company's certificates. That didn't work at all :( I guess I gotta use the specific certificate. Some trial and error should cover that.
If you're not installing Che 7 with Chectl using the operator method, then you won't have this CR (K8s Custom Resource) available.
You should probably first have a look at the following Che 7 documentation pages: https://www.eclipse.org/che/docs/che-7/installing-the-chectl-management-tool/ https://www.eclipse.org/che/docs/che-7/installing-che-on-openshift-3-using-the-operator/
Hey @davidfestal . Thanks for the input. I installed Chectl as documented and began creating a Che project as written here. However, I get the following error when trying to create the project with Chectl:
✔ ✈️ Openshift preflight checklist ✔ Verify if oc is installed...done. ✔ Verify if openshift is running...done. ✔ Verify domain is set...set to (censoring out domain). ❯ 🏃 Running the Che Operator ✔ Copying operator resources...done. ✖ Create Namespace (che) → Error from server (AlreadyExists): project.project.openshift.io "che" already exists Create ServiceAccount che-operator in namespace che Create Role che-operator in namespace che Create RoleBinding che-operator in namespace che Create CRD checlusters.org.eclipse.che Waiting 5 seconds for the new Kubernetes resources to get flushed Create deployment che-operator in namespace che Create Che Cluster eclipse-che in namespace che Error: Command failed: /bin/sh -c oc new-project che Error from server (AlreadyExists): project.project.openshift.io "che" already exists at makeError (/usr/local/lib/chectl/node_modules/execa/index.js:174:9) at Promise.all.then.arr (/usr/local/lib/chectl/node_modules/execa/index.js:278:16)
Now, the error indicates that this is happening because the Che namespace already exists. Which is true - but that's what the previous step in the instructions told me to do! If I try to run the chectl command without first creating the namespace, I get a different error:
❯ ✈️ Openshift preflight checklist ✔ Verify if oc is installed...done. ✖ Verify if openshift is running → E_PLATFORM_NOT_READY: oc status command failed. If there is no project, please create it before by running "oc new-project che" Verify domain is set › Error: E_PLATFORM_NOT_READY: oc status command failed. If there is no project, please create it before by running "oc new-project che"
Please advise.
@l0rd That seems really CheCtl related. any idea ?
@AmitChameides do you mind providing the command you have used to run chectl?
Providing the version of chectl (chectl version) and openshift (oc version) would be useful as well.
chectl starts Che if the namespace already exist but it looks like the call to cheNamespaceExist returns false even if the namespace exist. We are using /api/v1/namespaces/ endpoint and that may not be the right endpoint for the OpenShift version you are using.
Sorry for not responding earlier. I've been following the instructions of this documentation sent to me by @davidfestal so it should be more or less what you'd expect. Here is the information you have requested:
Chectl Command:
oc new-project che
chectl server:start --platform=openshift --installer=operator --domain=(censoring out domain) --multiuser
Chectl Version:
chectl/7.0.0 linux-x64 node-v10.16.2
Oc Version:
oc v3.11.98
kubernetes v1.11.0+d4cacc0
If there's anything else you'll need, please let me know.
Issues go stale after 180 days of inactivity. lifecycle/stale issues rot after an additional 7 days of inactivity and eventually close.
Mark the issue as fresh with /remove-lifecycle stale in a new comment.
If this issue is safe to close now please do so.
Moderators: Add lifecycle/frozen label to avoid stale mode.