<p>The istio docs <a href="https://istio.io/latest/docs/setup/install/istioctl/#check-what-s-installed" rel="nofollow noreferrer">here</a> has the following information:</p>
<blockquote>
<p>The istioctl command saves the IstioOperator CR that was used to
install Istio in a copy of the CR named installed-state. You can
inspect this CR if you lose track of what is installed in a cluster.</p>
<p>The installed-state CR is also used to perform checks in some istioctl
commands and should therefore not be removed.</p>
</blockquote>
<p>Now, I would like to know is what is &quot;CR&quot; and how to inspect this &quot;CR&quot; ?</p>

<h2>Short answer</h2>
<p>this will give you all deployed objects belongs to Istio CRs in all namespaces:</p>
<pre><code>kubectl api-resources | grep -i istio | awk '{print $4}' | while read cr; do
    kubectl get $(echo $cr | tr '[:upper:]' '[:lower:]') --all-namespaces
done
</code></pre>
<h2>Details:</h2>
<p>CR is a general k8s terminology and it means <code>Custom Resource</code>.
And its definition is named CRD : Custom Resource Definition.</p>
<p>So we have two category of resources:</p>
<ul>
<li><p>Built-in Resources: Pod, Service, Deployment, Ingress, ReplicaSet, StatefulSet,...</p>
</li>
<li><p>Custom Resources(CR): which depends on your customization of your cluster.</p>
<ul>
<li>For example if you install Istio, you will get CRs like : IstioOperator, ...</li>
<li>If you install Prometheus-Operator, you will get CRs like: Alertmanager, PrometheusRule, ...</li>
</ul>
</li>
</ul>
<p>Now to get the list of resources whether are built-in or custom (CR) , run:</p>
<pre><code>kubectl api-resources | awk '{print $4}'
</code></pre>
<p>Filter them to resources belongs to Istio</p>
<pre><code>kubectl api-resources | grep -i istio | awk '{print $4}'
</code></pre>
<p>Now because <code>IstioOperator</code> (for example) is a resource, you can run the following:</p>
<pre><code>kubectl get istiooperator
</code></pre>
<p>Check objects belongs to this CR in all namespaces</p>
<pre><code>kubectl get istiooperator --all-namespaces
</code></pre>
<p>All commands above will help you to build a YAML object based on the existing resources. Actually, it will help you in <code>kind: ???</code> field</p>
<p>If you want also to get the suitable <code>apiVersion: ???</code>, check <code>kubectl api-versions</code></p>
