6.6.6. etcd クォーラムガードを再度有効化する
コントロールプレーンノードの交換が完了したら、etcd クォーラムガードを再度有効にして、クラスターの正常な動作を復元し、クラスターが正常な 3 メンバーの etcd 設定に戻ったことを確認してください。
手順
以下のコマンドを実行して、クォーラムガードを再度有効にします。
$ oc patch etcd/cluster --type=merge -p '{"spec": {"unsupportedConfigOverrides": null}}'以下のコマンドを実行して、
unsupportedConfigOverridesセクションが削除されていることを確認してください。$ oc get etcd/cluster -oyamlシングルノードの OpenShift を使用している場合は、ノードを再起動してください。そうしないと、etcd クラスター Operator で次のエラーが発生する可能性があります。
出力例
EtcdCertSignerControllerDegraded: [Operation cannot be fulfilled on secrets "etcd-peer-sno-0": the object has been modified; please apply your changes to the latest version and try again, Operation cannot be fulfilled on secrets "etcd-serving-sno-0": the object has been modified; please apply your changes to the latest version and try again, Operation cannot be fulfilled on secrets "etcd-serving-metrics-sno-0": the object has been modified; please apply your changes to the latest version and try again]
検証
以下のコマンドを実行して、すべての etcdPod が実行されていることを確認してください。
$ oc -n openshift-etcd get pods -l k8s-app=etcd出力例
etcd-openshift-control-plane-0 5/5 Running 0 105m etcd-openshift-control-plane-1 5/5 Running 0 107m etcd-openshift-control-plane-3 5/5 Running 0 12m直前のコマンドの出力に 2 つの Pod のみがリスト表示される場合、etcd の再デプロイメントを手動で強制できます。クラスターにアクセスできるターミナルで、
cluster-adminユーザーとして以下のコマンドを実行します。$ oc patch etcd cluster -p='{"spec": {"forceRedeploymentReason": "recovery-'"$( date --rfc-3339=ns )"'"}}' --type=mergeforceRedeploymentReason値は一意である必要があります。そのため、タイムスタンプが付加されます。次のコマンドを実行して、実行中の etcd コンテナーに接続します。
$ oc rsh -n openshift-etcd etcd-openshift-control-plane-0以下のコマンドを実行してメンバーリストを表示します。
sh-4.2# etcdctl member list -w table出力例
+------------------+---------+--------------------+---------------------------+---------------------------+-----------------+ | ID | STATUS | NAME | PEER ADDRS | CLIENT ADDRS | IS LEARNER | +------------------+---------+--------------------+---------------------------+---------------------------+-----------------+ | 8d5abe9669a39192 | started | openshift-control-plane-1 | https://192.168.10.10:2380 | https://192.168.10.10:2379 | false | | cc3830a72fc357f9 | started | openshift-control-plane-0 | https://192.168.10.9:2380 | https://192.168.10.9:2379 | false | | d4f6a4e8b2c91a3f | started | openshift-control-plane-3 | https://192.168.10.12:2380 | https://192.168.10.12:2379 | false | +------------------+---------+--------------------+---------------------------+---------------------------+-----------------+etcd メンバーが正確に 3 つリストされていることを確認してください。
以下のコマンドを実行して、すべての etcd メンバーが正常であることを確認します。
sh-4.2# etcdctl endpoint health --cluster出力例
https://192.168.10.10:2379 is healthy: successfully committed proposal: took = 8.973065ms https://192.168.10.9:2379 is healthy: successfully committed proposal: took = 11.559829ms https://192.168.10.12:2379 is healthy: successfully committed proposal: took = 11.665203ms以下のコマンドを実行して、rsh セッションを終了します。
sh-4.2# exit以下のコマンドを実行して、すべてのノードが最新のリビジョンになっていることを確認してください。
$ oc get etcd -o=jsonpath='{range.items[0].status.conditions[?(@.type=="NodeInstallerProgressing")]}{.reason}{"\n"}{.message}{"\n"}'出力例
AllNodesAtLatestRevision