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 cluster-capacity ツールは、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 です。