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

use precreated labeled namespace for workspaces #18090

Merged
merged 14 commits into from
Oct 20, 2020
Merged

use precreated labeled namespace for workspaces #18090

merged 14 commits into from
Oct 20, 2020

Conversation

sparkoo
Copy link
Member

@sparkoo sparkoo commented Oct 9, 2020

Signed-off-by: Michal Vala mvala@redhat.com

What does this PR do?

Allow using precreated namespaces labeled with proper labels. The labels are configurable with che.infra.kubernetes.namespace.labels property.

Documentation PR

eclipse-che/che-docs#1643

TODO:

  • Make labeled namespace as a valid namespace for creating new workspace (TODO in KubernetesNamespaceFactory.java)
  • Javadocs
  • Tests
  • Documentation

Screenshot/screencast of this PR

What issues does this PR fix or reference?

#17842

How to test this PR?

  1. create namespace with labels app.kubernetes.io/part-of=che.eclipse.org,app.kubernetes.io/component=workspace,che.eclipse.org/username=<username> and make sure your user has access to it (admin role)
  2. On OpenShift with OAuth, it should be enough just to create RoleBinding for the user and admin role in pre-created project.
  3. On Kubernetes, you will also need to add list namespaces clusterrole permission to che serviceaccount.
  4. login to Che with the user
  5. go to create new namespace page
  6. you should see the namespace name in the dropdown "Namespace"
  7. when you use factory to create a namespace, this labeled namespace will be used
  8. when you label more namespaces, all will be shown in dashboard. If you use factory with more labeled namespaces, the first one will be used (should be alphabetical order, but not guaranteed)

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.

Signed-off-by: Michal Vala <mvala@redhat.com>
@che-bot che-bot added status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. kind/task Internal things, technical debt, and to-do tasks to be performed. labels Oct 9, 2020
Signed-off-by: Michal Vala <mvala@redhat.com>
Signed-off-by: Michal Vala <mvala@redhat.com>
Copy link
Member Author

@sparkoo sparkoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've changed the labels property to use placeholders, because without them, we would not be able to be really flexible with label names.

Signed-off-by: Michal Vala <mvala@redhat.com>
Signed-off-by: Michal Vala <mvala@redhat.com>
Signed-off-by: Michal Vala <mvala@redhat.com>
Signed-off-by: Michal Vala <mvala@redhat.com>
@skabashnyuk
Copy link
Contributor

looks 'ok' in general

Signed-off-by: Michal Vala <mvala@redhat.com>
Signed-off-by: Michal Vala <mvala@redhat.com>
Signed-off-by: Michal Vala <mvala@redhat.com>
@eclipse-che eclipse-che deleted a comment from che-bot Oct 14, 2020
@eclipse-che eclipse-che deleted a comment from che-bot Oct 14, 2020
@eclipse-che eclipse-che deleted a comment from che-bot Oct 14, 2020
@eclipse-che eclipse-che deleted a comment from che-bot Oct 14, 2020
@eclipse-che eclipse-che deleted a comment from che-bot Oct 14, 2020
@eclipse-che eclipse-che deleted a comment from che-bot Oct 14, 2020
@eclipse-che eclipse-che deleted a comment from che-bot Oct 14, 2020
@eclipse-che eclipse-che deleted a comment from che-bot Oct 14, 2020
@eclipse-che eclipse-che deleted a comment from che-bot Oct 14, 2020
@eclipse-che eclipse-che deleted a comment from che-bot Oct 14, 2020
@eclipse-che eclipse-che deleted a comment from che-bot Oct 14, 2020
@eclipse-che eclipse-che deleted a comment from che-bot Oct 15, 2020
@eclipse-che eclipse-che deleted a comment from che-bot Oct 15, 2020
@eclipse-che eclipse-che deleted a comment from artaleks9 Oct 15, 2020
Signed-off-by: Michal Vala <mvala@redhat.com>
@sparkoo sparkoo marked this pull request as ready for review October 16, 2020 11:08
@sparkoo
Copy link
Member Author

sparkoo commented Oct 16, 2020

@metlos @skabashnyuk @mshaposhnik ready to review

@eclipse-che eclipse-che deleted a comment from che-bot Oct 16, 2020
@eclipse-che eclipse-che deleted a comment from che-bot Oct 16, 2020
@sparkoo sparkoo merged commit b1e484c into eclipse-che:master Oct 20, 2020
@sparkoo sparkoo deleted the gh17842-precreatedNamespaces branch October 20, 2020 11:49
@che-bot che-bot removed the status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. label Oct 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/task Internal things, technical debt, and to-do tasks to be performed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants