【问题标题】:Istio -- Delete istio-control-plane Process Is FrozenIstio -- 删除 istio-control-plane 进程被冻结
【发布时间】:2021-03-19 01:35:51
【问题描述】:

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

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

我尝试使用以下步骤删除终结器,但它显示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 有什么想法吗?

【问题讨论】:

  • 你的 istio 版本是多少?你试过用istioctl operator remove删除它吗?您是否尝试过使用kubectl patch 来修补您的 istio 运算符终结器?有stackoverflow 的问题。

标签: kubernetes istio azure-aks


【解决方案1】:

您可以使用以下命令更改 istio 运算符终结器并将其删除,它是 @Rico here 制作的 jq/kubectl oneliner。我也尝试过kubectl patch,但没有成功。

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

另外我用过istioctl operator 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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-04-03
    • 2020-07-25
    • 2019-12-30
    • 1970-01-01
    • 2021-07-23
    相关资源
    最近更新 更多