<p>I was trying to uninstall and reinstall Istio from k8s cluster following the steps:
<img src="https://user-images.githubusercontent.com/10824322/101385666-b85d7000-3881-11eb-932f-da65955eb0dd.png" alt="image" /></p>
<p>But I made a mistake that I deleted the namespace before deleting the istio-control-plane: <code>kubectl delete istiooperator istio-control-plane -n istio-system</code>. Then when I try to delete the <code>istio-control-plane</code> again, it froze.</p>
<p>I tried to remove the finalizer using the following steps but it said <code>Error from server (NotFound): istiooperators.install.istio.io &quot;istio-control-plane&quot; not found</code></p>
<pre><code>kubectl get istiooperator -n istio-system -o json &gt; output.json
nano output.json # and remove finalizer
kubectl replace --raw &quot;/apis/install.istio.io/v1alpha1/namespaces/istio-system/istiooperators/istio-control-plane/finalize&quot; -f output.json
</code></pre>
<p>Here is the content of <code>kubectl get istiooperator -n istio-system -o json</code>:</p>
<pre><code>{
    &quot;apiVersion&quot;: &quot;v1&quot;,
    &quot;items&quot;: [
        {
            &quot;apiVersion&quot;: &quot;install.istio.io/v1alpha1&quot;,
            &quot;kind&quot;: &quot;IstioOperator&quot;,
            &quot;metadata&quot;: {
                &quot;annotations&quot;: {
                    &quot;kubectl.kubernetes.io/last-applied-configuration&quot;: &quot;{\&quot;apiVersion\&quot;:\&quot;install.istio.io/v1alpha1\&quot;,\&quot;kind\&quot;:\&quot;IstioOperator\&quot;,\&quot;metadata\&quot;:{\&quot;annotations\&quot;:{},\&quot;name\&quot;:\&quot;istio-control-plane\&quot;,\&quot;namespace\&quot;:\&quot;istio-system\&quot;},\&quot;spec\&quot;:{\&quot;addonComponents\&quot;:{\&quot;prometheus\&quot;:{\&quot;enabled\&quot;:false},\&quot;tracing\&quot;:{\&quot;enabled\&quot;:false}},\&quot;hub\&quot;:\&quot;hub.docker.prod.walmart.com/istio\&quot;,\&quot;profile\&quot;:\&quot;default\&quot;,\&quot;values\&quot;:{\&quot;global\&quot;:{\&quot;defaultNodeSelector\&quot;:{\&quot;beta.kubernetes.io/os\&quot;:\&quot;linux\&quot;}}}}}\n&quot;
                },
                &quot;creationTimestamp&quot;: &quot;2020-12-05T23:39:34Z&quot;,
                &quot;deletionGracePeriodSeconds&quot;: 0,
                &quot;deletionTimestamp&quot;: &quot;2020-12-07T16:41:41Z&quot;,
                &quot;finalizers&quot;: [
                ],
                &quot;generation&quot;: 2,
                &quot;name&quot;: &quot;istio-control-plane&quot;,
                &quot;namespace&quot;: &quot;istio-system&quot;,
                &quot;resourceVersion&quot;: &quot;11750055&quot;,
                &quot;selfLink&quot;: &quot;/apis/install.istio.io/v1alpha1/namespaces/istio-system/istiooperators/istio-control-plane&quot;,
                &quot;uid&quot;: &quot;fda8ee4f-54e7-45e8-91ec-c328fad1a86f&quot;
            },
            &quot;spec&quot;: {
                &quot;addonComponents&quot;: {
                    &quot;prometheus&quot;: {
                        &quot;enabled&quot;: false
                    },
                    &quot;tracing&quot;: {
                        &quot;enabled&quot;: false
                    }
                },
                &quot;hub&quot;: &quot;hub.docker.prod.walmart.com/istio&quot;,
                &quot;profile&quot;: &quot;default&quot;,
                &quot;values&quot;: {
                    &quot;global&quot;: {
                        &quot;defaultNodeSelector&quot;: {
                            &quot;beta.kubernetes.io/os&quot;: &quot;linux&quot;
                        }
                    }
                }
            },
            &quot;status&quot;: {
                &quot;componentStatus&quot;: {
                    &quot;Base&quot;: {
                        &quot;status&quot;: &quot;HEALTHY&quot;
                    },
                    &quot;IngressGateways&quot;: {
                        &quot;status&quot;: &quot;HEALTHY&quot;
                    },
                    &quot;Pilot&quot;: {
                        &quot;status&quot;: &quot;HEALTHY&quot;
                    }
                },
                &quot;status&quot;: &quot;HEALTHY&quot;
            }
        }
    ],
    &quot;kind&quot;: &quot;List&quot;,
    &quot;metadata&quot;: {
        &quot;resourceVersion&quot;: &quot;&quot;,
        &quot;selfLink&quot;: &quot;&quot;
    }
}
</code></pre>
<p>Any ideas on how can I uninstall <code>istio-control-plane</code> manually?</p>

<p>You can use below command to change istio operator finalizer and delete it, it's a <code>jq/kubectl</code> oneliner made by @Rico <a href="https://stackoverflow.com/a/52825601/11977760">here</a>. I have tried also with <code>kubectl patch</code> but it didn't work.</p>
<pre><code>kubectl get istiooperator -n istio-system istio-control-plane -o=json | \
jq '.metadata.finalizers = null' | kubectl apply -f -
</code></pre>
<p>Additionally I have used <code>istioctl operator remove</code></p>
<pre><code>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
</code></pre>
<p>Results from <code>kubectl get</code></p>
<pre><code>kubectl get istiooperator istio-control-plane -n istio-system
Error from server (NotFound): namespaces &quot;istio-system&quot; not found
</code></pre>
