an empty namespace may not be set during creation for k8sgpt operator controller manager
Closed this issue · 1 comments
g3david405 commented
Checklist
- I've searched for similar issues and couldn't find anything matching
- I've included steps to reproduce the behavior
Affected Components
- K8sGPT (CLI)
- K8sGPT Operator
K8sGPT Version
v0.1.4
Kubernetes Version
v1.26.3
Host OS and its Version
Rocky 9
Steps to reproduce
I am facing same error with #1107
This is what I create for k8sgpt CRD resource
apiVersion: core.k8sgpt.ai/v1alpha1
kind: K8sGPT
metadata:
name: k8sgpt-local-ai
namespace: k8sgpt-operator-system
spec:
ai:
anonymized: true
backend: localai
baseUrl: {my local-ai url}
enabled: true
language: english
model: gpt-4
version: v0.3.8
However, If I don't specify targetNamespace, k8sGPT operator controller manager won't create result and will log an error:
Finished Reconciling k8sGPT with error: an empty namespace may not be set during creation
2024-05-10T00:59:16Z ERROR Reconciler error {"controller": "k8sgpt", "controllerGroup": "core.k8sgpt.ai", "controllerKind": "K8sGPT", "K8sGPT": {"name":"k8sgpt-local","namespace":"k8sgpt-operator-system"}, "namespace": "k8sgpt-operator-system", "name": "k8sgpt-local", "reconcileID": "4f9ace39-1e48-4211
-8a56-e7f78a37bebb", "error": "an empty namespace may not be set during creation"}
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler
/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.15.0/pkg/internal/controller/controller.go:324
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem
/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.15.0/pkg/internal/controller/controller.go:265
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2
/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.15.0/pkg/internal/controller/controller.go:226
Creating new client for 10.233.1.108:8080
Connection established between 10.233.1.108:8080 and localhost with time out of 1 seconds.
Remote Address : 10.233.1.108:8080
K8sGPT address: 10.233.1.108:8080
Finished Reconciling k8sGPT with error: an empty namespace may not be set during creation
And If I specify targetNamespace, k8sgpt will only analyze for the namespace.
So If I have multiple namespace, I will create k8sgpt for all namespace??
Expected behaviour
k8sGPT will analyze for all namespace if targetNamespace not specified
Actual behaviour
if targetNamespace not specified, k8sgpt will throw
Finished Reconciling k8sGPT with error: an empty namespace may not be set during creation
if targetNamespace specified,
k8sgpt will only analyze for that namespace
Additional Information
no
thanks~~
MartyB-007 commented
I'm also seeing the same issue on v0.3.32