-
Notifications
You must be signed in to change notification settings - Fork 560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question]: "An empty namespace may not be set during creation" error #1107
Comments
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? |
@JuHyung-Son I suspect that this error could be caused by PodAnalyzer sending an empty namespace value to the Analyzer |
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 |
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. |
it's done. Test with a new version |
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
The text was updated successfully, but these errors were encountered: