chenyulin0719 opened a new pull request, #843: URL: https://github.com/apache/yunikorn-k8shim/pull/843
### 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 More detail could be found in YUNIKORN-1352, [[Design Doc][v4] Define policy for when to use annotations vs labels.pdf ](https://issues.apache.org/jira/secure/attachment/13067758/%5BDesign%20Doc%5D%5Bv4%5D%20Define%20policy%20for%20when%20to%20use%20annotations%20vs%20labels%20.pdf) (‘What will be changed’ → ‘Admission Controller Changes) ### What type of PR is it? * [x] - 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 <img width="641" alt="image" src="https://github.com/apache/yunikorn-k8shim/assets/26764036/a3ea8d42-bd10-411c-9da8-dc4f44124f46"> - pod-with-no-labels <img width="642" alt="image" src="https://github.com/apache/yunikorn-k8shim/assets/26764036/0c4a1a38-a315-4d2b-b59d-f31b8590336b"> - pod-with-canonical-labels: <img width="652" alt="image" src="https://github.com/apache/yunikorn-k8shim/assets/26764036/68bdb89d-b247-46b6-b8cf-6f704adc63d2"> ### Questions: NA -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
