ストレージ・オペレーターがデプロイされている名前空間が Terminating 状況のままになるのはなぜですか?

Satellite のストレージ構成を削除した後、「 Terminating 」ステータスから抜け出せなくなっているネームスペースを解決します。

クラスターからストレージ構成を削除すると、オペレーター・ポッドやストレージ・クラスなどのリソースは削除されますが、名前空間は Terminating 状況のままになります。

ファイナライザによって、ネームスペース内の残りのリソースおよびネームスペース自体が削除されないようになっています。

以下の手順を実行して、リソースおよび名前空間を削除します。

kube-system 名前空間内のリソースファイナライザには、パッチを適用したり削除したりしないでください。

  1. Terminating 状況のままになっている名前空間を取得します。 message: 'Some resources are remaining: セクションにリストされているリソースをメモします。
    oc get ns <namespace> -o yaml
    
    NetApp Trident 名前空間の出力例
    status:
        conditions:
        - lastTransitionTime: "2021-05-18T17:40:31Z"
        message: All resources successfully discovered
        reason: ResourcesDiscovered
        status: "False"
        type: NamespaceDeletionDiscoveryFailure
        - lastTransitionTime: "2021-05-18T17:40:31Z"
        message: All legacy kube types successfully parsed
        reason: ParsedGroupVersions
        status: "False"
        type: NamespaceDeletionGroupVersionParsingFailure
        - lastTransitionTime: "2021-05-18T17:40:31Z"
        message: All content successfully deleted, may be waiting on finalization
        reason: ContentDeleted
        status: "False"
        type: NamespaceDeletionContentFailure
        - lastTransitionTime: "2021-05-18T17:40:31Z"
        message: 'Some resources are remaining: tridentbackends.trident.netapp.io has 1 resource instances, tridentnodes.trident.netapp.io has 3 resource instances, tridentversions.trident.netapp.io has 1 resource instances, tridentvolumes.trident.netapp.io has 1 resource instances'
        reason: SomeResourcesRemain
        status: "True"
        type: NamespaceContentRemaining
        - lastTransitionTime: "2021-05-18T17:40:31Z"
        message: 'Some content in the namespace has finalizers remaining: trident.netapp.io
        in 6 resource instances'
        reason: SomeFinalizersRemain
        status: "True"
        type: NamespaceFinalizersRemaining
        phase: Terminating
    
  2. oc get コマンドを実行して、削除保留中のリソースを取得します。 この出力例では、 tridentbackends.trident.netapp.io リソースは 1 つのリソース・インスタンスをリストします。 先ほど取得したネームスペースのYAMLファイルの「 message 」セクションにインスタンスが記載されている各リソースについて、この手順を繰り返してください。
    oc get <resource> -n <namespace>
    
    tridentbackends.trident.netapp.io リソースのコマンド例。
    oc get tridentbackends.trident.netapp.io -n trident
    
    出力例
    tbe-bhb5r
    
    pvc-26d97ecd-c268-47ff-a2fd-a0a1a51a9e12
    
  3. インスタンスがリストされている各リソースについて、次の kubectl patch コマンドを実行して、ファイナライザを削除し、そのリソースを削除してください。 すべてのリソースにパッチが適用されると、名前空間は削除されます。
    kubectl -n <namespace> patch <resource>/<instance> -p '{"metadata":{"finalizers":[]}}' --type=merge
    
    tridentbackends.trident.netapp.io リソースのコマンド例。
    kubectl -n trident patch tridentbackends.trident.netapp.io/tbe-bhb5r -p '{"metadata":{"finalizers":[]}}' --type=merge
    
  4. 残りのリソースでファイナライザーを削除した後、 oc get ns コマンドを実行して、名前空間が削除されたことを確認します。
    oc get ns