<p>I have set up istio for my k8s cluster and it seems successfully working. The <strong>istioctl</strong> also works and return version 1.17.2 which is compatible with my k8s cluster.
Deployment output is as follows.</p>
<pre><code>k8s@k8master-virtual-machine:~$ kubectl get pods -n istio-system
NAME                                   READY   STATUS    RESTARTS   AGE
istio-egressgateway-85649899f8-ccgs4   1/1     Running   0          2m58s
istio-ingressgateway-f56888458-bzkfk   1/1     Running   0          2m58s
istiod-64848b6c78-74s48                1/1     Running   0          3m2s

k8s@k8master-virtual-machine:~/istio-yamls$ kubectl get rolebindings -n istio-system
NAME                       ROLE                            AGE
istio-egressgateway-sds    Role/istio-egressgateway-sds    27m
istio-ingressgateway-sds   Role/istio-ingressgateway-sds   27m
istiod                     Role/istiod                     27m
istiod-istio-system        Role/istiod-istio-system        27m

k8s@k8master-virtual-machine:~/istio-yamls$ kubectl get roles -n istio-system
NAME                       CREATED AT
istio-egressgateway-sds    2023-05-25T06:48:22Z
istio-ingressgateway-sds   2023-05-25T06:48:22Z
istiod                     2023-05-25T06:48:18Z
istiod-istio-system        2023-05-25T06:48:16Z
</code></pre>
<p><strong>Problem:</strong>
The very strange problem I faced is as follows. When I apply my gateway file with <code>kubectl apply -f gateway.yaml</code>  it shows created.</p>
<pre><code>k8s@k8master-virtual-machine:~/istio-yamls$ kubectl apply -f gateway.yaml
gateway.networking.istio.io/testmy-gateway created
</code></pre>
<p>But when I use the get command to see the status I see no resources found.</p>
<pre><code>k8s@k8master-virtual-machine:~/istio-yamls$ kubectl get gateway -n istio-system
No resources found in istio-system namespace.
</code></pre>
<p>In my YAML file, I used the namespace istio-system as this is my yaml file.</p>
<pre><code>apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: testmy-gateway
  namespace: istio-system
spec:
  selector:
    istio: ingressgateway
  servers:

  - port:
      number: 80
      name: gw-http
      protocol: HTTP
    hosts:
    - '*'
</code></pre>
<p><strong>What I have done to fix it?</strong>
I look to the gateway in <strong>all namespaces</strong> and I found nothing.
I uninstall istio and delete its namespace CRDs and all the data to start clean and still face the same issue.
I create a new k8s cluster with the same resources and deploy this Istio setup it works perfectly.</p>
<p>I found a <a href="https://stackoverflow.com/questions/76198265/create-istio-ingressgateway-successful-but-cannt-find-the-gateway">StackOverflow question</a> like my problem but the answer is just one comment. I am struggling to understand the logic behind it.</p>
<p><strong>What Do I want?</strong>
As the same Istio setup and yaml files perfectly work on another cluster, it means something is wrong with this cluster. I have tried everything to find the problem but no luck. I need to find out why my gateway file is deployed here but not shown. <strong>OR Please Explain the other question how does that information matter?</strong> I even check the gateway name and deeply it and found the same issue.
Any help suggestions and support will be appreciated. Thanks in Advance.</p>

tauqeerahmad24
<p>There are two possible explanations why you don't see the gateway, even if it has been applied successfully.</p>
<ol>
<li><p>You installed an old version of istio before (which you confirmed in your comment) and the gateway CRD's group changed since then, but the old one hasn't been cleaned up/is still supported and thus it's still there.</p>
</li>
<li><p>You have a different CRD with the same name (plural) <code>gateways</code> but different group (unrelated to istio) in your cluster.</p>
</li>
</ol>
<p>You can verify which one is true by <code>kubectl get crd | grep gateways</code> which will show you all CRDs with that plural. Check those that have a name of <code>gateways.&lt;some-api-group&gt;</code>.</p>
<p>If it's an old, unused CRD you can delete it. Otherwise you need to specify your kubectl command, like <code>kubectl get gateways.networking.istio.io</code>, because kubectl doesn't know which group you mean and shows you the other one for which you don't have any resources.</p>
<p>It's probably because of the Kubernetes Gateway API <code>gateways.gateway.networking.k8s.io</code> CRD. You could think about configuring your gateway using that CRD instead if your cluster already provides it, see <a href="https://istio.io/latest/docs/tasks/traffic-management/ingress/gateway-api/" rel="nofollow noreferrer">docs</a>.</p>
<p>Otherwise you need to specify the whole name, including the istio group, every time. You could create an alias if that is too annoying.</p>
