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

pod admission mutate patch affinity #2737

Merged
merged 2 commits into from Apr 10, 2023

Conversation

jiamin13579
Copy link
Contributor

@jiamin13579 jiamin13579 commented Mar 14, 2023

Admission pods, resourceGroups support mutate patch pod affinity. The format is a json string.

volcano-admission.conf example

apiVersion: v1
data:
  volcano-admission.conf: |
    resourceGroups:
    - resourceGroup: fixed                        # if the object is unsetted, default is:  the key is annotation,
      schedulerName: volcano                      # the annotation key is fixed and is "volcano.sh/resource-group", The corresponding value is the resourceGroup field
      object:
        key: annotation
        value:
        - "volcano.sh/resource-group-job-role: master"
      # set the affinity for patching, the format is a json string.
      affinity: "{\"nodeAffinity\":{\"requiredDuringSchedulingIgnoredDuringExecution\":{\"nodeSelectorTerms\":[{\"matchExpressions\":[{\"key\":\"volcano.sh/nodetype",\"operator\":\"In\",\"values\":[\"fixed\"]}]}]}}}"
kind: ConfigMap
metadata:
  annotations:
    meta.helm.sh/release-name: volcano
    meta.helm.sh/release-namespace: volcano-system
  labels:
    app.kubernetes.io/managed-by: Helm
  name: volcano-admission-configmap
  namespace: volcano-system

@volcano-sh-bot volcano-sh-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Mar 14, 2023
@jiamin13579 jiamin13579 force-pushed the affinity branch 2 times, most recently from 8ea649d to 7e9062b Compare March 14, 2023 15:12
@jiamin13579 jiamin13579 reopened this Mar 15, 2023
@jiamin13579 jiamin13579 force-pushed the affinity branch 2 times, most recently from 7e9062b to 1cf8fbd Compare March 20, 2023 06:07
@jiamin13579 jiamin13579 changed the title pod mutate patch affinity pod admission mutate patch affinity Mar 21, 2023
@jiamin13579 jiamin13579 force-pushed the affinity branch 2 times, most recently from d680dac to 1cf8fbd Compare March 31, 2023 05:17
@wangyang0616
Copy link
Member

/ok-to-test

@volcano-sh-bot volcano-sh-bot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Mar 31, 2023
@wangyang0616
Copy link
Member

/retest

Copy link
Member

@hwdef hwdef left a comment

Choose a reason for hiding this comment

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

What is the background of this function

@jiamin13579
Copy link
Contributor Author

What is the background of this function

We want to use more rich affinity configurations to control pod allocation, which may not only be node selection. In case of insufficient machines, we can occupy cluster resources of other services.

@hwdef
Copy link
Member

hwdef commented Mar 31, 2023

Sorry I still don't understand the scenario, please be more specific or give an example, thanks

@volcano-sh-bot volcano-sh-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 4, 2023
Signed-off-by: min.jia <jiamin13579@126.com>

Signed-off-by: min.jia <jiamin13579@126.com>
Signed-off-by: min.jia <jiamin13579@126.com>
Copy link
Member

@hwdef hwdef left a comment

Choose a reason for hiding this comment

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

/lgtm

@volcano-sh-bot volcano-sh-bot added the lgtm Indicates that a PR is ready to be merged. label Apr 4, 2023
@jiamin13579 jiamin13579 closed this Apr 4, 2023
@jiamin13579 jiamin13579 reopened this Apr 4, 2023
@jiamin13579 jiamin13579 closed this Apr 4, 2023
@jiamin13579 jiamin13579 reopened this Apr 4, 2023
@william-wang
Copy link
Member

I just restarted the ci.

@jiamin13579 jiamin13579 closed this Apr 7, 2023
@jiamin13579 jiamin13579 reopened this Apr 7, 2023
@jiamin13579 jiamin13579 closed this Apr 7, 2023
@jiamin13579 jiamin13579 reopened this Apr 7, 2023
@hwdef
Copy link
Member

hwdef commented Apr 10, 2023

/lgtm

Copy link
Member

@william-wang william-wang left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@volcano-sh-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: william-wang

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

@volcano-sh-bot volcano-sh-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 10, 2023
@volcano-sh-bot volcano-sh-bot merged commit bed4a04 into volcano-sh:master Apr 10, 2023
29 of 53 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants