k8sgpt-ai / k8sgpt

Giving Kubernetes Superpowers to everyone
http://k8sgpt.ai
Apache License 2.0
5.68k stars 652 forks source link

Using the GKE Ingress Class "GCE" shows an Error, evenso it is not #849

Open wofr opened 9 months ago

wofr commented 9 months ago

Checklist

Affected Components

K8sGPT Version

v0.3.25

Kubernetes Version

v.1.27.3

Host OS and its Version

Windows

Steps to reproduce

  1. Having a Cluster runing on the Google Gloud (GKE)
  2. Having a Ingress running on GKE which is using kubernetes.io/ingress.class: gce

Expected behaviour

Should not show an error when using ingress.class gce

Actual behaviour


k8sgpt analyze --explain
 100% |█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| (1/1, 9 it/min)
AI Provider: openai

0 my-dev/my-dev-ingress(my-dev-ingress)
- Error: Ingress uses the ingress class gce which does not exist.
Error: The Ingress resource is using the ingress class "gce" which does not exist.
Solution:
1. Check the available Ingress classes using the command "kubectl get ingressclasses".
2. If "gce" is not listed, create an Ingress class with the name "gce" using the command "kubectl create ingressclass gce --controller=..."
3. Update the Ingress resource to use the correct ingress class by modifying the "ingressClassName" field.
4. Apply the changes using the command "kubectl apply -f <ingress-resource.yaml>".```

### Additional Information

On GKE, The kubernetes.io/ingress.class: gce is the default ingress class, so in this case no error should be shown
kartikaysaxena commented 8 months ago

Can I get some insight on how this issue should be resolved? Would love to contribute