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

feat: Support node selector and pod tolerations in devworkspaces #1301

Merged
merged 13 commits into from
Feb 1, 2022

Conversation

metlos
Copy link
Contributor

@metlos metlos commented Jan 27, 2022

What does this PR do?

This adds support for a couple of things:

  • adds support for workspace pod tolerations and node selector as properties in
    the CheCluster CRD v1 under spec.server.workspacePodTolerations and spec.server.workspacePodNodeSelector
    in addition to the CHE_WORKSPACE_POD_NODE__SELECTOR and CHE_WORKSPACE_POD_TOLERATIONS__JSON custom
    properties,
  • adds support for the same as properties in the CRD v2alpha1 under spec.workspaces.podTolerations and
    spec.workspaces.podNodeSelector,
  • implements conversion between the two (when converting to v2alpha1, the values are read out of either
    the properties, or if not found there, from the custom che properties)
  • the usernamespace reconciler now annotates the user namespace/project with annotations understood by
    the devworkspace operator to apply the node selector and pod toleration configuration to the actual
    devworkspace pods.

Screenshot/screencast of this PR

none

What issues does this PR fix or reference?

eclipse-che/che#20884

How to test this PR?

  1. Install the che-operator from this PR (I've pre-built an image quay.io/lkrejci/che-operator:issue-20884)
  2. Configure node selector and/or pod tolerations in the CheCluster CR
  3. Create a devworkspace
  4. The configuration should be applied to the workspace pod

PR Checklist

As the author of this Pull Request I made sure that:

Reviewers

Reviewers, please comment how you tested the PR when approving it.

* Upgrade to devworkspace operator with support for pod tolerations
* Implement additional logic in usernamespace controller to sync config
  from checluster CR to ns annotations understood by the dwo
* Add new fields to CheCluster CRD v1 and v2alpha1
* added support for the new fields in conversion methods between v1 and v2alpha1
@metlos metlos changed the title Support node selector and pod tolerations in devworkspaces feat: Support node selector and pod tolerations in devworkspaces Jan 27, 2022
@metlos
Copy link
Contributor Author

metlos commented Jan 28, 2022

/retest

@metlos
Copy link
Contributor Author

metlos commented Jan 28, 2022

@tolusha, help please! How do I unblock the two stuck jobs?

@tolusha
Copy link
Contributor

tolusha commented Jan 28, 2022

/retest

@tolusha
Copy link
Contributor

tolusha commented Jan 28, 2022

I don't know. We can wait or close/opene the PR (I hope it will work)

@metlos
Copy link
Contributor Author

metlos commented Jan 29, 2022

/retest

1 similar comment
@tolusha
Copy link
Contributor

tolusha commented Jan 31, 2022

/retest

@codecov
Copy link

codecov bot commented Jan 31, 2022

Codecov Report

Merging #1301 (39775a0) into main (4f08657) will increase coverage by 0.08%.
The diff coverage is 73.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1301      +/-   ##
==========================================
+ Coverage   60.35%   60.43%   +0.08%     
==========================================
  Files          77       77              
  Lines        6275     6337      +62     
==========================================
+ Hits         3787     3830      +43     
- Misses       2112     2121       +9     
- Partials      376      386      +10     
Impacted Files Coverage Δ
controllers/devworkspace/solver/che_routing.go 77.49% <ø> (ø)
controllers/devworkspace/controller.go 47.80% <50.00%> (ø)
controllers/usernamespace/controller.go 64.31% <57.14%> (-1.02%) ⬇️
api/conversion.go 80.32% <88.23%> (+1.38%) ⬆️
...ontrollers/devworkspace/solver/endpoint_exposer.go 95.31% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4f08657...39775a0. Read the comment docs.

@openshift-ci
Copy link

openshift-ci bot commented Jan 31, 2022

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: metlos, tolusha

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci
Copy link

openshift-ci bot commented Feb 1, 2022

New changes are detected. LGTM label has been removed.

@openshift-ci openshift-ci bot removed the lgtm label Feb 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants