18.2. 프로젝트 선택
주석 선택, 레이블 선택 또는 둘 다에 따라 프로젝트를 선택할 수 있습니다. 예를 들어 주석에 따라 프로젝트를 선택하려면 다음 명령을 실행합니다.
$ oc create clusterquota for-user \
--project-annotation-selector openshift.io/requester=<user-name> \
--hard pods=10 \
--hard secrets=20
다음과 같은 ClusterResourceQuota 오브젝트를 생성합니다.
apiVersion: v1
kind: ClusterResourceQuota
metadata:
name: for-user
spec:
quota:
hard:
pods: "10"
secrets: "20"
selector:
annotations:
openshift.io/requester: <user-name>
labels: null
status:
namespaces:
- namespace: ns-one
status:
hard:
pods: "10"
secrets: "20"
used:
pods: "1"
secrets: "9"
total:
hard:
pods: "10"
secrets: "20"
used:
pods: "1"
secrets: "9"
이 다중 프로젝트 할당량 문서는 기본 프로젝트 요청 끝점을 사용하여 <user-name> 에서 요청하는 모든 프로젝트를 제어합니다. Pod 10개와 시크릿 20개로 제한되어 있습니다.
마찬가지로 라벨에 따라 프로젝트를 선택하려면 다음 명령을 실행합니다.
$ oc create clusterresourcequota for-name \
--project-label-selector=name=frontend \
--hard=pods=10 --hard=secrets=20
다음과 같은 ClusterResourceQuota 오브젝트 정의를 생성합니다.
apiVersion: v1
kind: ClusterResourceQuota
metadata:
creationTimestamp: null
name: for-name
spec:
quota:
hard:
pods: "10"
secrets: "20"
selector:
annotations: null
labels:
matchLabels:
name: frontend