-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Support for CustomResource openshift
& kubernetes
devfile components is not working
#22137
Comments
@amisevsk can you please have a look |
I'm looking into the first example (with |
For the first Devfile sample, the dashboard hits a 403 error when attempting to patch the DevWorkspace, but ignores it and does not show it to the user (created issue: #22145) Attempting to manually apply the same patch as the dashboard gives a more useful message:
The basic explanation here is that in order to allow the DevWorkspace Operator to manage CRs from this operator, it needs to be granted There may also be an issue with the dashboard (as DWO verifies the user applying the patch has permissions to get/create/update/delete the CR in question) but I cannot verify this at the moment. @cgruver For this issue in specific, could you try again after creating the following resources on the cluster? apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: devworkspace-controller-admin-kafka
rules:
- apiGroups:
- kafka.strimzi.io
resources:
- kafkas
- kafkatopics
verbs:
- "*"
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
name: devworkspace-controller-admin-kafka
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: devworkspace-controller-admin-kafka
subjects:
- kind: ServiceAccount
name: devworkspace-controller-serviceaccount
namespace: dw # Or wherever the DevWorkspace Operator is installed |
@amisevsk Yes, I'll apply that RBAC and update here. |
Testing (very) briefly on OpenShift, I suspect the RBAC will not fix the issue as the user is not granted admin permissions in their namespace:
|
Note: I've updated the clusterrole/clusterrolebinding in the comment above -- I had the incorrect API group for the clusterrole. Tested on OpenShift with a cluster-admin user and a regular user:
|
@amisevsk I had the wrong API version in the CRs. I failed to notice that it had recently updated to |
Never mind. I get the same error after the correction:
|
If I grant my user I'd prefer not to do that thought, because I would like the resources to be managed by the workspace. i.e. shutdown and/or removed when the workspace stops or is deleted. |
Yeah, the I think our hands may be tied within the operator here, at least for the time being. I'll try to look into it more when I have some time. The second flow (devfile no. 2) is still something that should be supported via the editor, though. |
Update: I validated that the creation of OpenShift resources works if it's something that the service account has permission to create: - openshift:
deployByDefault: true
inlined: |
kind: ConfigMap
apiVersion: v1
metadata:
name: test-config
data:
test: "value"
name: config-map |
@amisevsk can you suggest a new title / description for the issue on the DW side please? |
2.2.X
spec for openshift
& kubernetes
objects is not workingopenshift
& kubernetes
devfile components is not working
I've updated the title to more precisely define the issue (custom resources are not supported in devfile components). Currently, the problem is that within the controller, we require the golang specs for custom resource objects in order to apply them and cache them within the reconcile loop. However, standard Kubernetes objects should be supported. @cgruver let me know if this is accurate. |
@amisevsk That is accurate |
@cgruver We're at an impasse on this issue; Go-based Kubernetes operators can only manage resources they "understand" (which basically means the Go structs are included in the project at build time). As a result, supporting arbitrary CR kinds in the operator is not possible using the standard controller-runtime library -- it doesn't know how to compare them, how to apply them, etc. We may be able to ultimately find a solution that works in general, but it would likely require an entirely different way of dealing with these components. It's technically on the backlog, but near the bottom. |
Issues go stale after Mark the issue as fresh with If this issue is safe to close now please do so. Moderators: Add |
Describe the bug
I am attempting to create a devfile which will deploy a Kafka cluster and Kafka topics in the workspace along with the other workspace components.
Following the documentation at https://devfile.io/docs/2.2.0/adding-a-kubernetes-or-openshift-component yields unsuccessful results.
This feature appears to have been enabled by: devfile/devworkspace-operator#961
However, variations on a devfile to implement it have failed.
Che version
7.63@latest
Steps to reproduce
Example Devfile
#1
:With this devfile, the workspace silently excludes all of the included components... No errors are obvious.
Example Devfile
#2
:With this devfile, the workspace deploys with the correct container components, but there is no obvious way to run the
apply
commands. Further, theapply
commands cannot be created with thedeploy
group as that group does not appear to be implemented. Note: you have to remove thegroup
entries from theapply
commands for this example to not throw an error.Expected behavior
Workspace deployed with Kafka cluster and Topic
Runtime
OpenShift
Screenshots
No response
Installation method
OperatorHub
Environment
macOS
Eclipse Che Logs
No response
Additional context
The Strimzi Operator is installed with cluster scope.
The text was updated successfully, but these errors were encountered: