5.5. クラスターの初期化失敗のトラブルシューティング
インストールプログラムは、Cluster Version Operator を使用して、OpenShift Container Platform クラスターのすべてのコンポーネントを作成します。インストールプログラムがクラスターの初期化に失敗した場合は、ClusterVersion オブジェクトと ClusterOperator オブジェクトから最も重要な情報を取得できます。
手順
次のコマンドを実行して
ClusterVersionオブジェクトを検査します。oc --kubeconfig=${INSTALL_DIR}/auth/kubeconfig get clusterversion -o yaml$ oc --kubeconfig=${INSTALL_DIR}/auth/kubeconfig get clusterversion -o yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow 出力例
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 次のコマンドを実行して状態を表示します。
oc --kubeconfig=${INSTALL_DIR}/auth/kubeconfig get clusterversion version \ -o=jsonpath='{range .status.conditions[*]}{.type}{" "}{.status}{" "}{.message}{"\n"}{end}'$ oc --kubeconfig=${INSTALL_DIR}/auth/kubeconfig get clusterversion version \ -o=jsonpath='{range .status.conditions[*]}{.type}{" "}{.status}{" "}{.message}{"\n"}{end}'Copy to Clipboard Copied! Toggle word wrap Toggle overflow 最も重要な状態は、
Failing、Available、Progressingです。出力例
Available True Done applying 4.1.1 Failing False Progressing False Cluster version is 4.0.0-0.alpha-2019-02-26-194020 RetrievedUpdates False Unable to retrieve available updates: unknown version 4.1.1
Available True Done applying 4.1.1 Failing False Progressing False Cluster version is 4.0.0-0.alpha-2019-02-26-194020 RetrievedUpdates False Unable to retrieve available updates: unknown version 4.1.1Copy to Clipboard Copied! Toggle word wrap Toggle overflow 次のコマンドを実行して
ClusterOperatorオブジェクトを検査します。oc --kubeconfig=${INSTALL_DIR}/auth/kubeconfig get clusteroperator$ oc --kubeconfig=${INSTALL_DIR}/auth/kubeconfig get clusteroperatorCopy to Clipboard Copied! Toggle word wrap Toggle overflow このコマンドは、クラスター Operators のステータスを返します。
出力例
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 次のコマンドを実行して、個々のクラスター Operator を検査します。
oc --kubeconfig=${INSTALL_DIR}/auth/kubeconfig get clusteroperator <operator> -oyaml$ oc --kubeconfig=${INSTALL_DIR}/auth/kubeconfig get clusteroperator <operator> -oyaml1 Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
<operator>は、クラスター Operator の名前に置き換えます。このコマンドは、クラスター Operator のステータスがAvailableにならない理由、またはFailedになる理由を特定するために使用できます。
出力例
Copy to Clipboard Copied! Toggle word wrap Toggle overflow クラスター Operator のステータス状態を取得するには、次のコマンドを実行します。
oc --kubeconfig=${INSTALL_DIR}/auth/kubeconfig get clusteroperator <operator> \ -o=jsonpath='{range .status.conditions[*]}{.type}{" "}{.status}{" "}{.message}{"\n"}{end}'$ oc --kubeconfig=${INSTALL_DIR}/auth/kubeconfig get clusteroperator <operator> \ -o=jsonpath='{range .status.conditions[*]}{.type}{" "}{.status}{" "}{.message}{"\n"}{end}'Copy to Clipboard Copied! Toggle word wrap Toggle overflow <Operator>は、上記のいずれかの Operator の名前に置き換えます。出力例
Available True Successfully rolled out the stack Progressing False Failing False
Available True Successfully rolled out the stack Progressing False Failing FalseCopy to Clipboard Copied! Toggle word wrap Toggle overflow クラスター Operator が所有するオブジェクトのリストを取得するには、次のコマンドを実行します。
oc --kubeconfig=${INSTALL_DIR}/auth/kubeconfig get clusteroperator kube-apiserver \ -o=jsonpath='{.status.relatedObjects}'oc --kubeconfig=${INSTALL_DIR}/auth/kubeconfig get clusteroperator kube-apiserver \ -o=jsonpath='{.status.relatedObjects}'Copy to Clipboard Copied! Toggle word wrap Toggle overflow 出力例
[map[resource:kubeapiservers group:operator.openshift.io name:cluster] map[group: name:openshift-config resource:namespaces] map[group: name:openshift-config-managed resource:namespaces] map[group: name:openshift-kube-apiserver-operator resource:namespaces] map[group: name:openshift-kube-apiserver resource:namespaces]]
[map[resource:kubeapiservers group:operator.openshift.io name:cluster] map[group: name:openshift-config resource:namespaces] map[group: name:openshift-config-managed resource:namespaces] map[group: name:openshift-kube-apiserver-operator resource:namespaces] map[group: name:openshift-kube-apiserver resource:namespaces]]Copy to Clipboard Copied! Toggle word wrap Toggle overflow