-
Notifications
You must be signed in to change notification settings - Fork 61
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(node affinity): add support to specify node affinity rules of NFS Server #59
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #59 +/- ##
============================================
- Coverage 48.37% 36.83% -11.54%
============================================
Files 18 27 +9
Lines 1598 2234 +636
============================================
+ Hits 773 823 +50
- Misses 781 1366 +585
- Partials 44 45 +1
Continue to review full report at Codecov.
|
4e57793
to
e389ab1
Compare
@mittachaitu -- is it feasible to modify the schema for specifying the affinity a litte for the cases where there no values. for example is it possible to just use:
or a comma separated values like this:
|
e389ab1
to
bfce26d
Compare
Question: As of now we are supporting only If we follow with key-value pairs even though there is no value then-current implementation is easy to extend for negation. For example negation config - name: NODEAFFINITY
value: "kubernetes.io/application:~[], kubernetes.io/zones:~[zone-2,zone-3]" can be converted to - matchExpressions:
- key: kubernetes.io/application
operator: DoesNotExist
- key: kubernetes.io/zones
operator: NotIn
values:
- zone-2
- zone-3 |
This should be merged after #58 - as there are some helm chart files with conflicting changes. |
…S Server This commit adds support to specify node affinity rules via NFS-Provisioner ENV to schedule scheduling NFS Server on set of nodes. **How to use?**: - Add 'NODEAFFINITY' ENV in NFS-Provisioner deployment in following manner: ```sh - name: NODEAFFINITY value: "kubernetes.io/hostname:[172.17.0.1],kubernetes.io/os:[linux]" ``` - To schedule NFS Server instance on storage nodes ```sh - name: NODEAFFINITY value: "kubernetes.io/storage:[]" ``` **How it is propogated to NFS Server instance**: - During boot up time of provisioner instance, provisioner will read NODEAFFINITY ENV then parse affinity rules and store them under affinity rules in form of Go structure[in-memory]. - When volume is provisioned NFS-Provisioner will propogate these affinity rules to NFS Server instance. Example propogation: ```yaml ... ... ... affinity: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: kubernetes.io/hostname operator: In values: - 172.17.0.1 - key: kubernetes.io/os operator: In values: - linux ``` Signed-off-by: mittachaitu <[email protected]>
This commit also address review comments Signed-off-by: mittachaitu <[email protected]>
Signed-off-by: mittachaitu <[email protected]>
…INITY Signed-off-by: mittachaitu <[email protected]>
…yaml Signed-off-by: mittachaitu <[email protected]>
…NEBS_IO_NFS_SERVER_NODE_AFFINITY Signed-off-by: mittachaitu <[email protected]>
05b76b5
to
5adecb5
Compare
Pull Request template
Why is this PR required? What issue does it fix?:
This PR adds support to specify node affinity rules via NFS-Provisioner
ENV to schedule NFS Server on a specific set of nodes. It fixes #57
What this PR does?:
This PR adds a feature to propagate node affinity rules to NFS Server
instance via Provisioner ENV.
Does this PR require any upgrade changes?:
No
How to use?:
- name: OPENEBS_IO_NFS_SERVER_NODE_AFFINITY value: "kubernetes.io/hostname:[172.17.0.1],kubernetes.io/os:[linux]"
- name: OPENEBS_IO_NFS_SERVER_NODE_AFFINITY value: "kubernetes.io/storage,kubernetes.io/nfs-node"
How it is propagated to NFS Server instance:
OPENEBS_IO_NFS_SERVER_NODE_AFFINITY ENV then parse
affinity rules and store them under the affinity rules in form of Go structure[in-memory].
rules to NFS Server instance.
Example propagation:
If the changes in this PR are manually verified, list down the scenarios covered::
Any additional information for your reviewer? :
Mention if this PR is part of any design or a continuation of previous PRs
Checklist:
<type>(<scope>): <subject>
Signed-off-by: mittachaitu [email protected]