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

CHE_INFRA_KUBERNETES_NAMESPACE_ANNOTATIONS does not work as expected for OpenShift Node Selector annotation #23375

Open
simonkrenger opened this issue Mar 5, 2025 · 1 comment
Labels
area/che-server help wanted Community, we are fully engaged on other issues. Feel free to take this one. We'll help you! kind/bug Outline of a bug - must adhere to the bug report template. severity/P2 Has a minor but important impact to the usage or development of the system. status/analyzing An issue has been proposed and it is currently being analyzed for effort and implementation approach

Comments

@simonkrenger
Copy link

Describe the bug

The customer would like to set the openshift.io/node-selector annotation on newly created namespaces. They are aware of devEnvironments.nodeSelector, but would like to set the Node Selector on the namespace via this annotation still.

When they set CHE_INFRA_KUBERNETES_NAMESPACE_ANNOTATIONS: openshift.io/node-selector=node-role.kubernetes.io/worker= in .spec.components.cheServer.extraProperties on the CheCluster however this does not work as expected (likely due to the "=" at the end). See the attached screenshots.

I believe this is a Bug on how these additional annotations are handled. Or do you have any hints on how to set the necessary annotation like openshift.io/node-selector: node-role.kubernetes.io/worker= on Dev Spaces namespaces?

Che version

other (please specify in additional context)

Steps to reproduce

  1. Set CHE_INFRA_KUBERNETES_NAMESPACE_ANNOTATIONS: openshift.io/node-selector=node-role.kubernetes.io/worker= in .spec.components.cheServer.extraProperties on the CheCluster
  2. Create a new Dev Space so that a new namespace is created
  3. Observe the annotations on the newly created namespace

Expected behavior

The annotation openshift.io/node-selector=node-role.kubernetes.io/worker= is set on the newly created namespace.

Runtime

OpenShift

Screenshots

Image

Image

Installation method

OperatorHub

Environment

Linux

Eclipse Che Logs

Additional context

No response

@simonkrenger simonkrenger added the kind/bug Outline of a bug - must adhere to the bug report template. label Mar 5, 2025
@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 Mar 5, 2025
@ibuziuk
Copy link
Member

ibuziuk commented Mar 5, 2025

@simonkrenger hello, please take a look at the similar issue #23350 that might be useful. In general, annotations are expected to be comma-separated + if you override it you should consider adding che.eclipse.org/username=<username> (which is the default one)

# List of annotations to find {orch-namespace} prepared for {prod-short} user workspaces.
# Only {orch-namespace} matching the `che.infra.kubernetes.namespace.labels` is matched against these annotations.
# {orch-namespace} that matches both `che.infra.kubernetes.namespace.labels` and `che.infra.kubernetes.namespace.annotations`
# is used preferentially for user workspaces.
# It's possible to use `<username>` placeholder to specify the {orch-namespace} to concrete user.
# They are used to:
#  - Find prepared {orch-namespace} for users in combination with `che.infra.kubernetes.namespace.labels`.
#  - Actively annotate {orch-namespace} with any workspace.
che.infra.kubernetes.namespace.annotations=che.eclipse.org/username=<username>

however, if you think there is bug, contributions are most welcome ;-) see KubernetesNamespaceFactory.java

@ibuziuk ibuziuk added status/analyzing An issue has been proposed and it is currently being analyzed for effort and implementation approach help wanted Community, we are fully engaged on other issues. Feel free to take this one. We'll help you! severity/P2 Has a minor but important impact to the usage or development of the system. area/che-server and removed status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. labels Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/che-server help wanted Community, we are fully engaged on other issues. Feel free to take this one. We'll help you! kind/bug Outline of a bug - must adhere to the bug report template. severity/P2 Has a minor but important impact to the usage or development of the system. status/analyzing An issue has been proposed and it is currently being analyzed for effort and implementation approach
Projects
None yet
Development

No branches or pull requests

3 participants