5.2. 다중 프로젝트의 리소스 할당량
ClusterResourceQuota
오브젝트에서 정의하는 다중 프로젝트 할당량은 여러 프로젝트에서 할당량을 공유할 수 있습니다. 선택한 각 프로젝트에서 사용하는 리소스를 집계하고 이 집계 정보를 사용하여 선택한 모든 프로젝트의 리소스를 제한합니다.
이 가이드에서는 클러스터 관리자가 다중 프로젝트에서 리소스 할당량을 설정하고 관리하는 방법을 설명합니다.
5.2.1. 할당량 생성 중 다중 프로젝트 선택
할당량을 생성할 때 주석 선택이나 라벨 선택 또는 둘 다에 따라 다중 프로젝트를 선택할 수 있습니다.
프로세스
주석에 따라 프로젝트를 선택하려면 다음 명령을 실행합니다.
$ oc create clusterquota for-user \ --project-annotation-selector openshift.io/requester=<user_name> \ --hard pods=10 \ --hard secrets=20
이렇게 하면 다음과 같은
ClusterResourceQuota
오브젝트가 생성됩니다.apiVersion: quota.openshift.io/v1 kind: ClusterResourceQuota metadata: name: for-user spec: quota: 1 hard: pods: "10" secrets: "20" selector: annotations: 2 openshift.io/requester: <user_name> labels: null 3 status: namespaces: 4 - namespace: ns-one status: hard: pods: "10" secrets: "20" used: pods: "1" secrets: "9" total: 5 hard: pods: "10" secrets: "20" used: pods: "1" secrets: "9"
이 다중 프로젝트 할당량 문서는 기본 프로젝트 요청 끝점을 사용하여
<user_name>
에서 요청하는 모든 프로젝트를 제어합니다. Pod 10개와 시크릿 20개로 제한되어 있습니다.마찬가지로 라벨에 따라 프로젝트를 선택하려면 다음 명령을 실행합니다.
$ oc create clusterresourcequota for-name \1 --project-label-selector=name=frontend \2 --hard=pods=10 --hard=secrets=20
이렇게 하면 다음과 같은
ClusterResourceQuota
오브젝트 정의가 생성됩니다.apiVersion: quota.openshift.io/v1 kind: ClusterResourceQuota metadata: creationTimestamp: null name: for-name spec: quota: hard: pods: "10" secrets: "20" selector: annotations: null labels: matchLabels: name: frontend