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

node selection #17

Open
meredrica opened this issue Aug 4, 2024 · 5 comments
Open

node selection #17

meredrica opened this issue Aug 4, 2024 · 5 comments
Milestone

Comments

@meredrica
Copy link
Owner

a way to select a cluster node would be nice.
https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes/

could work like this and support direct nodename as well as labeled nodes

deployment:
 node: "host"

for a labelled node:

deployment:
  node:
    label: value
@meredrica
Copy link
Owner Author

scheduling to a specific node is easy

spec:
  nodeName: foo-node # schedule pod to specific node

labelled nodes too

spec:
  nodeSelector:
    disktype: ssd #this is the whole label

@meredrica
Copy link
Owner Author

meredrica commented Oct 30, 2024

as for affinity, this is a little more complicated
there are two ways to specify preferred or required

required:

spec:
  affinity:
    nodeAffinity:
      requiredDuringSchedulingIgnoredDuringExecution:
        nodeSelectorTerms:
        - matchExpressions:

preferred:

spec:
  affinity:
    nodeAffinity:
      preferredDuringSchedulingIgnoredDuringExecution:
      - weight: 1
        preference:
          matchExpressions:

match expressions are always the same format

- key: another-node-label-key
  operator: In
  values:
  - another-node-label-value

operators are defined here: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#operators

Topology spread will not be done with this feature, I'll add a new one

@meredrica meredrica added this to the 0.0.12 milestone Oct 30, 2024
@meredrica
Copy link
Owner Author

additionally, podAffinity can be used instead of nodeAffinity

@meredrica
Copy link
Owner Author

so, one way would be for short syntax:

deployment: 
  node: "name"

long syntax:

deployment:
  node:
    'label' : "value"

affinity could be done like this:

deployment:
  affinity:
    pod:
    node:

still thinking about how to do the rest and how to avoid the duplicate node

@FrostbittenKing
Copy link

Awesome, thanks. Now it remains that I fill in the remaining blanks for antiAffinity I guess.

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

No branches or pull requests

2 participants