Closed electrocucaracha closed 4 months ago
Hi I am getting this issue too did u manage to resolve it?
would you re install k8sgpt and operator?
@JuHyung-Son I don't mind giving it a try but could you explain what was changed on the release version that I tested?
I am seeing a similar issue. However, providing a 'targetNamespace' generates results for only that particular namespace.
I am seeing a similar issue. However, providing a 'targetNamespace' generates results for only that particular namespace.
It seems like that is the missing part, thanks @Nitishmane for the solution.
This is the Operator CR:
apiVersion: core.k8sgpt.ai/v1alpha1
kind: K8sGPT
metadata:
name: k8sgpt-local
namespace: k8sgpt-operator-system
spec:
ai:
model: gpt-4
backend: localai
baseUrl: http://local-ai.local-ai-system.svc.cluster.local:8080/v1
enabled: true
version: v0.3.30
noCache: false
targetNamespace: default
and this is the pod broken example
apiVersion: v1
kind: Pod
metadata:
name: broken-pod
namespace: default
spec:
containers:
- name: broken-pod
image: nginx:1.a.b.c
livenessProbe:
httpGet:
path: /
port: 90
initialDelaySeconds: 3
periodSeconds: 3
Which generates the following result:
$ kubectl describe results.core.k8sgpt.ai
Name: defaultbrokenpod
Namespace: default
Labels: k8sgpts.k8sgpt.ai/backend=localai
k8sgpts.k8sgpt.ai/name=k8sgpt-local
k8sgpts.k8sgpt.ai/namespace=k8sgpt-operator-system
Annotations: <none>
API Version: core.k8sgpt.ai/v1alpha1
Kind: Result
Metadata:
Creation Timestamp: 2024-05-15T20:58:20Z
Generation: 1
Resource Version: 3550
UID: d34c1a0b-ee29-477e-b721-0f29bef9d7e7
Spec:
Backend: localai
Details: Error: Back-off pulling image "nginx:1.a.b.c" indicates that Kubernetes is unable to pull the specified Docker image due to network issues or registry unavailability.
Solution:
1. Check the internet connection: Ensure that the Kubernetes cluster has stable network access to the Docker registry hosting the image.
2. Verify image URL: Double-check the image name and tag "nginx:1.a.b.c" for any typos or missing information.
3. Pull image manually: Run the command "docker pull nginx:1.a.b.c" outside of Kubernetes to ensure that the image can be pulled successfully.
4. Check image availability: Confirm that the specified image version "1.a.b.c" is available on the registry.
5. Update image pull policy: If the image is available, consider updating the image pull policy in the pod's specification to "IfNotPresent" or "Always" to force Kubernetes to pull the image.
Error:
Text: Back-off pulling image "nginx:1.a.b.c"
Kind: Pod
Name: default/broken-pod
Parent Object:
Events: <none>
electrocucaracha so k8sgpt operator can analyze for only one namespace now?
electrocucaracha so k8sgpt operator can analyze for only one namespace now?
I'm not sure if the operator was designed to work in that way, but it looks like that's the intention.
I'm also seeing the same issue on v0.3.32, it doesn't feel like the intent is to force a target namespace, otherwise we'd have to run one K8sGPT per namespace on the cluster to get a clear view in the results crd.. seems like a maintenance nightmare. Unless I'm missing it the documentation has never alluded to this need
i guess this is bug, i will take a look
@JuHyung-Son thank you!
this will be fixed soon. https://github.com/k8sgpt-ai/k8sgpt-operator/pull/449
it's done. Test with a new version https://github.com/k8sgpt-ai/k8sgpt-operator/pull/449
Hey @JuHyung-Son thanks for the fast reply and fast fix! I just tested and it is working now. Thank you :)
Checklist
Affected Components
K8sGPT Version
v0.3.30
Kubernetes Version
v1.28.6
Host OS and its Version
Ubuntu 18.04.6 LTS
Steps to reproduce
Expected behaviour
I expect some results resources
Actual behaviour
Additional Information
No response