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

[YUNIKORN-2631] Support canonical labels for queue/applicationId in Admission Controller #46

Closed
wants to merge 5 commits into from

Conversation

chenyulin0719
Copy link
Owner

@chenyulin0719 chenyulin0719 commented May 17, 2024

What is this PR for?

When Admission Controller try to patch queue/applicationID to pod, also add canonical representations.

  • applicationId (legacy, should be removed in 1.7.0)
  • queue (legacy, should be removed in 1.7.0)
  • yunikorn.apache.org/app-id (New, Canonical Label)
  • yunikorn.apache.org/queue (New, Canonical Label)

In 1.6.0, if only canonical labels were found in pod, add the value back to legacy labels for backward compatibility

  • applicationId
  • queue

What type of PR is it?

  • - Improvement

Todos

  • Support canonical representation in scheduler
  • Update documents

What is the Jira issue?

https://issues.apache.org/jira/browse/YUNIKORN-2631

How should this be tested?

  1. make test
  2. create below pod and check the pod labels
  • pod-with-legacy-labels: AM won't add new labels
  • pod-with-no-labels: AM add both legacy/canonical labels
  • pod-with-canonical-labels: Besides the existing canonical labels, AM also add the value to legacy labels.
apiVersion: v1
kind: Pod
metadata:
  labels:
    app: sleep
    applicationId: "application-sleep-0001"
    queue: "root.sandbox"
  name: pod-with-legacy-labels
spec:
  schedulerName: yunikorn
  restartPolicy: Never
  containers:
    - name: sleep-6000s
      image: "alpine:latest"
      command: ["sleep", "6000"]
      resources:
        requests:
          cpu: "100m"
          memory: "500M"
---
apiVersion: v1
kind: Pod
metadata:
  labels:
    app: sleep
  name: pod-with-no-labels
spec:
  schedulerName: yunikorn
  restartPolicy: Never
  containers:
    - name: sleep-6000s
      image: "alpine:latest"
      command: ["sleep", "6000"]
      resources:
        requests:
          cpu: "100m"
          memory: "500M"
---
apiVersion: v1
kind: Pod
metadata:
  labels:
    app: sleep
    yunikorn.apache.org/app-id: "application-sleep-0003"
    yunikorn.apache.org/queue: "root.sandbox"
  name: pod-with-canonical-labels
spec:
  schedulerName: yunikorn
  restartPolicy: Never
  containers:
    - name: sleep-6000s
      image: "alpine:latest"
      command: ["sleep", "6000"]
      resources:
        requests:
          cpu: "100m"
          memory: "500M"


Screenshots (if appropriate)

  • pod-with-legacy-labels
image
  • pod-with-no-labels
image
  • pod-with-canonical-labels:
image

Questions:

NA

Copy link

codecov bot commented May 17, 2024

Codecov Report

Attention: Patch coverage is 38.27160% with 50 lines in your changes missing coverage. Please review.

Project coverage is 67.15%. Comparing base (58adfe9) to head (9c37688).

Current head 9c37688 differs from pull request most recent head d8b8a7a

Please upload reports for the commit d8b8a7a to get more accurate results.

Files Patch % Lines
pkg/client/apifactory.go 0.00% 16 Missing ⚠️
pkg/cache/context.go 38.88% 6 Missing and 5 partials ⚠️
pkg/cmd/admissioncontroller/main.go 0.00% 11 Missing ⚠️
pkg/admission/conf/am_conf.go 0.00% 5 Missing ⚠️
pkg/client/apifactory_mock.go 0.00% 3 Missing ⚠️
pkg/admission/namespace_cache.go 60.00% 1 Missing and 1 partial ⚠️
pkg/admission/priority_class_cache.go 60.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #46      +/-   ##
==========================================
- Coverage   67.25%   67.15%   -0.10%     
==========================================
  Files          70       70              
  Lines        7600     7629      +29     
==========================================
+ Hits         5111     5123      +12     
- Misses       2277     2287      +10     
- Partials      212      219       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

Successfully merging this pull request may close these issues.

4 participants