che-operator
che-operator copied to clipboard
Support Devfile endpoint annotations in Che Router
What does this PR do?
- Imports the latest DevWorkspaceRouting (DWR) API, which adds endpoint annotations coming from the devfile
- Adds the DWR endpoint annotations as annotations for the route (on OpenShift) or ingresse (on Kubernetes) created by the Che Router for a given endpoint
There are a few additional changes made in this PR that are not meant to be merged (though the Che-Operator repo devfile changes may be desirable):
- Importing a forked version of DWO into the
go.moduntil https://github.com/devfile/devworkspace-operator/pull/1297 is merged and DWO 0.31 upstream is released - Using per-workspace storage as well as the UDI in the Che-Operator devfile. This was helpful for developing this patch in Che.
- Installing a forked version of DWO using an index image built from https://github.com/devfile/devworkspace-operator/pull/1297
Screenshot/screencast of this PR
n/a
What issues does this PR fix or reference?
Fix eclipse-che/che#23064
How to test this PR?
- Install DWO built from this PR, as well as Che-Operator built from the current PR onto your cluster.
- On OpenShift, this can easily be done by running
./build/scripts/olm/test-catalog-from-sources.shfrom the root of this repo. - On minikube/kubernetes, you'll have to:
- Build DWO: From the root of the DWO repo run
export DWO_IMG=quay.io/<username>/devworkspace-controller:endpoint-annotations && make docker(or just use my image:export DWO_IMG=quay.io/<username>/devworkspace-controller:endpoint-annotations-implementation) - Install DWO:
make install_cert_manager && make install - Build Che-Operator:
make docker-build docker-push IMG=<YOUR_OPERATOR_IMAGE> - Install Che:
chectl server:deploy -p minikube --che-operator-image=<YOUR_OPERATOR_IMAGE>
- Build DWO: From the root of the DWO repo run
- Once both DWO and Che are installed onto your cluster, verify there's a Che Cluster CR instance created so that you can access the Che User dashboard
- From the Che User Dashboard, create a workspace with a devfile that defines endpoints with annotations, such as this one.
endpoints:
- name: https-python
targetPort: 8080
protocol: https
annotation:
my-annotation: test
another-annotation: test2
- Once the workspace has started up, verify the routes & ingresses for the endpoint(s) with annotations have the expected annotations from the devfile. In my example devfile, your
<workspaceid>-py-8080-https-pythonroute/ingress should havemy-annotation: test&another-annotation: test2, as shown below:
kind: Route
apiVersion: route.openshift.io/v1
metadata:
annotations:
+ another-annotation: test2
che.routing.controller.devfile.io/component-name: py
che.routing.controller.devfile.io/endpoint-name: https-python
+ my-annotation: test
resourceVersion: '48291'
name: workspace4b929cbc569a4473-py-8080-https-python
(...)
namespace: che-kube-admin-che-rwxo67
ownerReferences:
- apiVersion: controller.devfile.io/v1alpha1
kind: DevWorkspaceRouting
name: routing-workspace4b929cbc569a4473
uid: 497a6df3-9e14-47f8-9fc6-33acfda6df77
controller: true
blockOwnerDeletion: true
labels:
app.kubernetes.io/part-of: che.eclipse.org
controller.devfile.io/devworkspace_id: workspace4b929cbc569a4473
spec:
(...)
PR Checklist
As the author of this Pull Request I made sure that:
- [x] The Eclipse Contributor Agreement is valid
- [x] Code produced is complete
- [x] Code builds without errors
- [x] Tests are covering the bugfix
- [ ] Development resource are up to date
- [x] The repository devfile is up to date and works
- [x] Sections
What issues does this PR fix or referenceandHow to test this PRcompleted - [ ] Relevant user documentation updated
- [ ] Relevant contributing documentation updated
- [ ] CI/CD changes implemented, documented and communicated
Reviewers
Reviewers, please comment how you tested the PR when approving it.
Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all
@tolusha Though this PR is still a draft, it should be good for review if you want to take a look already. In order for this PR to no longer be a draft, we'll need to release DWO 0.31.0, and I'll update this PR to pull in the latest version of DWO
Sounds good for me
@tolusha the DWO 0.31.0 release is currently in progress. Once it's released, I will update this PR and it will be ready for review :)
@tolusha this PR is finally ready for review now that DWO 0.31.0 is being used in Che-Operator :)
@tolusha by the way, if you end up wanting the devfile changes, I'll rewrite the commit messages for them (since they're currently marked as "do not merge").
/retest-required
/retest-required
/retest-required
Not sure why the pro v14-che-behind-proxy test is failing, though it seems unrelated to this PR:
INFO[2024-09-19T17:04:27Z] Logs for container test in pod che-behind-proxy-ipi-conf-aws-blackholenetwork:
INFO[2024-09-19T17:04:27Z]
An error occurred (AlreadyExistsException) when calling the CreateStack operation: Stack [ci-op-mfqq3b2j-9dadd-shared-vpc-blackhole] already exists
{"component":"entrypoint","error":"wrapped process failed: exit status 254","file":"sigs.k8s.io/prow/pkg/entrypoint/run.go:84","func":"sigs.k8s.io/prow/pkg/entrypoint.Options.internalRun","level":"error","msg":"Error executing test process","severity":"error","time":"2024-09-19T17:04:27Z"}
error: failed to execute wrapped command: exit status 254
INFO[2024-09-19T17:04:27Z] Step che-behind-proxy-ipi-conf-aws-blackholenetwork failed after 9s.
(...)
INFO[2024-09-19T17:06:58Z] Ran for 4m36s
ERRO[2024-09-19T17:06:58Z] Some steps failed:
ERRO[2024-09-19T17:06:58Z]
* could not run steps: step che-behind-proxy failed: "che-behind-proxy" pre steps failed: "che-behind-proxy" pod "che-behind-proxy-ipi-conf-aws-blackholenetwork" failed: could not watch pod: the pod ci-op-mfqq3b2j/che-behind-proxy-ipi-conf-aws-blackholenetwork failed after 7s (failed containers: test): ContainerFailed one or more containers exited
Container test exited with code 254, reason Error
---
An error occurred (AlreadyExistsException) when calling the CreateStack operation: Stack [ci-op-mfqq3b2j-9dadd-shared-vpc-blackhole] already exists
{"component":"entrypoint","error":"wrapped process failed: exit status 254","file":"sigs.k8s.io/prow/pkg/entrypoint/run.go:84","func":"sigs.k8s.io/prow/pkg/entrypoint.Options.internalRun","level":"error","msg":"Error executing test process","severity":"error","time":"2024-09-19T17:04:27Z"}
error: failed to execute wrapped command: exit status 254
---
/retest
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: AObuchow, dkwon17, ibuziuk
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
New changes are detected. LGTM label has been removed.
/retest-required
/retest-required
/retest-required
/retest-required
@AObuchow: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:
| Test name | Commit | Details | Required | Rerun command |
|---|---|---|---|---|
| ci/prow/v14-che-behind-proxy | c0afbf96b8d80c2e9e58f0f353359eea68a46e78 | link | true | /test v14-che-behind-proxy |
Full PR test history. Your PR dashboard.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.
Build 3.17 :: operator_3.x/404: Console, Changes, Git Data
Build 3.17 :: sync-to-downstream_3.x/7729: Console, Changes, Git Data
Build 3.17 :: push-latest-container-to-quay_3.x/4936: Console, Changes, Git Data
Build 3.17 :: get-sources-rhpkg-container-build_3.x/7723:
devspaces-operator : 3.x :: Build 64454618 : quay.io/devspaces/devspaces-rhel8-operator:3.17-15
SUCCESS; copied to quay; /DS_CI/push-latest-container-to-quay_3.x/4936 triggered
Build 3.17 :: update-digests_3.x/7609: Console, Changes, Git Data
Build 3.17 :: operator-bundle_3.x/3619: Console, Changes, Git Data
Build 3.17 :: sync-to-downstream_3.x/7730: Console, Changes, Git Data
Build 3.17 :: push-latest-container-to-quay_3.x/4937: Console, Changes, Git Data
Build 3.17 :: copyIIBsToQuay/2802: Console, Changes, Git Data