Red Hat Training

A Red Hat training course is available for OpenShift Container Platform

42.2. 명령줄에서 클러스터 용량 분석 실행

openshift-enterprise-cluster-capacity RPM 패키지를 설치하여 툴을 가져옵니다. 명령줄에서 툴을 실행하려면 다음을 수행합니다.

$ hypercc cluster-capacity --kubeconfig <path-to-kubeconfig> \
    --podspec <path-to-pod-spec>

kubeconfig 옵션은 Kubernetes 구성 파일을 나타내고, --podspec 옵션은 툴에서 리소스 사용량을 추정하는 데 사용하는 샘플 Pod 사양 파일을 나타냅니다. podspec은 리소스 요구 사항을 limits 또는 requests로 지정합니다. hypercc 클러스터 용량 툴은 추정 분석에 Pod의 리소스 요구 사항을 고려합니다.

Pod 사양 입력의 예는 다음과 같습니다.

apiVersion: v1
kind: Pod
metadata:
  name: small-pod
  labels:
    app: guestbook
    tier: frontend
spec:
  containers:
  - name: php-redis
    image: gcr.io/google-samples/gb-frontend:v4
    imagePullPolicy: Always
    resources:
      limits:
        cpu: 150m
        memory: 100Mi
      requests:
        cpu: 150m
        memory: 100Mi

-verbose 옵션을 추가하여 클러스터의 각 노드에서 예약할 수 있는 Pod 수에 대한 자세한 설명을 출력할 수도 있습니다.

$ hypercc cluster-capacity --kubeconfig <path-to-kubeconfig> \
    --podspec <path-to-pod-spec> --verbose

출력은 다음과 유사합니다.

small-pod pod requirements:
	- CPU: 150m
	- Memory: 100Mi

The cluster can schedule 52 instance(s) of the pod small-pod.

Termination reason: Unschedulable: No nodes are available that match all of the
following predicates:: Insufficient cpu (2).

Pod distribution among nodes:
small-pod
	- 192.168.124.214: 26 instance(s)
	- 192.168.124.120: 26 instance(s)

위 예에서 클러스터에 예약할 수 있는 예상 Pod 수는 52개입니다.