Istio-删除istio-control-plane进程被冻结 [英] Istio -- Delete istio-control-plane Process Is Frozen

查看:57
本文介绍了Istio-删除istio-control-plane进程被冻结的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正尝试按照以下步骤从k8s集群中卸载并重新安装Istio:

I was trying to uninstall and reinstall Istio from k8s cluster following the steps:

但是我犯了一个错误,我在删除istio-control-plane之前删除了名称空间: kubectl delete istiooperator istio-control-plane -n​​ istio-system .然后,当我尝试再次删除 istio-control-plane 时,它冻结了.

But I made a mistake that I deleted the namespace before deleting the istio-control-plane: kubectl delete istiooperator istio-control-plane -n istio-system. Then when I try to delete the istio-control-plane again, it froze.

我尝试使用以下步骤删除终结器,但它表示服务器中的 Error(NotFound):istiooperators.install.istio.io"istio-control-plane"找不到

I tried to remove the finalizer using the following steps but it said Error from server (NotFound): istiooperators.install.istio.io "istio-control-plane" not found

kubectl get istiooperator -n istio-system -o json > output.json
nano output.json # and remove finalizer
kubectl replace --raw "/apis/install.istio.io/v1alpha1/namespaces/istio-system/istiooperators/istio-control-plane/finalize" -f output.json

这是 kubectl get istiooperator -n istio-system -o json 的内容:

{
    "apiVersion": "v1",
    "items": [
        {
            "apiVersion": "install.istio.io/v1alpha1",
            "kind": "IstioOperator",
            "metadata": {
                "annotations": {
                    "kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"install.istio.io/v1alpha1\",\"kind\":\"IstioOperator\",\"metadata\":{\"annotations\":{},\"name\":\"istio-control-plane\",\"namespace\":\"istio-system\"},\"spec\":{\"addonComponents\":{\"prometheus\":{\"enabled\":false},\"tracing\":{\"enabled\":false}},\"hub\":\"hub.docker.prod.walmart.com/istio\",\"profile\":\"default\",\"values\":{\"global\":{\"defaultNodeSelector\":{\"beta.kubernetes.io/os\":\"linux\"}}}}}\n"
                },
                "creationTimestamp": "2020-12-05T23:39:34Z",
                "deletionGracePeriodSeconds": 0,
                "deletionTimestamp": "2020-12-07T16:41:41Z",
                "finalizers": [
                ],
                "generation": 2,
                "name": "istio-control-plane",
                "namespace": "istio-system",
                "resourceVersion": "11750055",
                "selfLink": "/apis/install.istio.io/v1alpha1/namespaces/istio-system/istiooperators/istio-control-plane",
                "uid": "fda8ee4f-54e7-45e8-91ec-c328fad1a86f"
            },
            "spec": {
                "addonComponents": {
                    "prometheus": {
                        "enabled": false
                    },
                    "tracing": {
                        "enabled": false
                    }
                },
                "hub": "hub.docker.prod.walmart.com/istio",
                "profile": "default",
                "values": {
                    "global": {
                        "defaultNodeSelector": {
                            "beta.kubernetes.io/os": "linux"
                        }
                    }
                }
            },
            "status": {
                "componentStatus": {
                    "Base": {
                        "status": "HEALTHY"
                    },
                    "IngressGateways": {
                        "status": "HEALTHY"
                    },
                    "Pilot": {
                        "status": "HEALTHY"
                    }
                },
                "status": "HEALTHY"
            }
        }
    ],
    "kind": "List",
    "metadata": {
        "resourceVersion": "",
        "selfLink": ""
    }
}

关于如何手动卸载 istio-control-plane 的任何想法?

Any ideas on how can I uninstall istio-control-plane manually?

推荐答案

您可以使用以下命令来更改istio运算符终结器并将其删除,这是@Rico创建的 jq/kubectl oneliner 此处.我也尝试过使用 kubectl修补程序,但是没有用.

You can use below command to change istio operator finalizer and delete it, it's a jq/kubectl oneliner made by @Rico here. I have tried also with kubectl patch but it didn't work.

kubectl get istiooperator -n istio-system istio-control-plane -o=json | \
jq '.metadata.finalizers = null' | kubectl apply -f -

此外,我还使用了 istioctl运算符remove

istioctl operator remove
Removing Istio operator...
  Removed Deployment:istio-operator:istio-operator.
  Removed Service:istio-operator:istio-operator.
  Removed ServiceAccount:istio-operator:istio-operator.
  Removed ClusterRole::istio-operator.
  Removed ClusterRoleBinding::istio-operator.
✔ Removal complete

kubectl get

kubectl get istiooperator istio-control-plane -n istio-system
Error from server (NotFound): namespaces "istio-system" not found

这篇关于Istio-删除istio-control-plane进程被冻结的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆