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

Add support for node selectors and pod tolerations via attribute #681

Closed
wants to merge 1 commit into from

Conversation

amisevsk
Copy link
Collaborator

What does this PR do?

Add support for pod tolerations and node selectors via attributes:

  • pod-tolerations
  • node-selector

This PR should be left on-hold until devfile/api#689 is resolved

What issues does this PR fix or reference?

DWO-side implementation of devfile/api#689 until that issue is resolved and devfile/api dependency is updated.

Closes #614

Is it tested? How?

E.g. in minikube:

# Apply a taint to the minikube node
kubectl taint nodes minikube key1=value1:NoSchedule
# Apply a new label to the minikube node
kubectl label nodes minikube test-node-selector=test
# Create a DW that tolerates the taint and uses a node selector: 
cat <<EOF | kubectl apply -f - 
kind: DevWorkspace
apiVersion: workspace.devfile.io/v1alpha2
metadata:
  name: nodeselector-test
spec:
  started: true
  routingClass: 'basic'
  template:
    attributes:
      pod-tolerations:
      - key: "key1"
        operator: "Equal"
        value: "value1"
        effect: "NoSchedule"
      node-selector:
        test-node-selector: test
    components:
      - name: web-terminal
        container:
          image: quay.io/wto/web-terminal-tooling:latest
          memoryLimit: 512Mi
          mountSources: true
          command:
           - "tail"
           - "-f"
           - "/dev/null"
EOF

The Pod created for the Workspace should have

  {
    "effect": "NoSchedule",
    "key": "key1",
    "operator": "Equal",
    "value": "value1"
  },

in its .spec.tolerations and

{
  "test-node-selector": "test"
}

in its .spec.nodeSelector.

PR Checklist

  • E2E tests pass (when PR is ready, comment /test v8-devworkspace-operator-e2e, v8-che-happy-path to trigger)
    • v8-devworkspace-operator-e2e: DevWorkspace e2e test
    • v8-che-happy-path: Happy path for verification integration with Che

Signed-off-by: Angel Misevski <amisevsk@redhat.com>
@amisevsk amisevsk requested a review from JPinkney November 22, 2021 17:59
@openshift-ci
Copy link

openshift-ci bot commented Nov 22, 2021

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

@openshift-ci
Copy link

openshift-ci bot commented Nov 22, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: amisevsk

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

The pull request process is described 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

@amisevsk
Copy link
Collaborator Author

/test v8-devworkspace-operator-e2e

@openshift-ci
Copy link

openshift-ci bot commented Nov 24, 2021

@amisevsk: PR needs rebase.

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/test-infra repository.

@AObuchow
Copy link
Collaborator

Can this be closed now that #696 is merged?

@amisevsk
Copy link
Collaborator Author

Can this be closed now that #696 is merged?

No I think we should wait for it to be a year old 😂

@amisevsk amisevsk closed this Sep 21, 2022
@amisevsk amisevsk deleted the pod-tolerations branch September 21, 2022 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Pod tolerations for DevWorkspace Pods
2 participants