diff --git a/api/v1alpha1/k8sgpt_types.go b/api/v1alpha1/k8sgpt_types.go index 2bbb6525..d3194d7d 100644 --- a/api/v1alpha1/k8sgpt_types.go +++ b/api/v1alpha1/k8sgpt_types.go @@ -124,6 +124,7 @@ type K8sGPTSpec struct { RemoteCache *RemoteCacheRef `json:"remoteCache,omitempty"` Integrations *Integrations `json:"integrations,omitempty"` NodeSelector map[string]string `json:"nodeSelector,omitempty"` + TargetNamespace string `json:"targetNamespace,omitempty"` // Define the kubeconfig the Deployment must use. // If empty, the Deployment will use the ServiceAccount provided by Kubernetes itself. Kubeconfig *SecretRef `json:"kubeconfig,omitempty"` diff --git a/chart/operator/templates/k8sgpt-crd.yaml b/chart/operator/templates/k8sgpt-crd.yaml index 85afa3d2..12f7386e 100644 --- a/chart/operator/templates/k8sgpt-crd.yaml +++ b/chart/operator/templates/k8sgpt-crd.yaml @@ -178,6 +178,8 @@ spec: webhook: type: string type: object + targetNamespace: + type: string version: type: string type: object diff --git a/config/crd/bases/core.k8sgpt.ai_k8sgpts.yaml b/config/crd/bases/core.k8sgpt.ai_k8sgpts.yaml index b7e5fc21..8985f870 100644 --- a/config/crd/bases/core.k8sgpt.ai_k8sgpts.yaml +++ b/config/crd/bases/core.k8sgpt.ai_k8sgpts.yaml @@ -188,6 +188,8 @@ spec: webhook: type: string type: object + targetNamespace: + type: string version: type: string type: object diff --git a/pkg/client/analysis.go b/pkg/client/analysis.go index 4a98410b..92469e5b 100644 --- a/pkg/client/analysis.go +++ b/pkg/client/analysis.go @@ -19,6 +19,7 @@ func (c *Client) ProcessAnalysis(deployment v1.Deployment, config *v1alpha1.K8sG Explain: config.Spec.AI.Enabled && allowAIRequest, Nocache: config.Spec.NoCache, Backend: config.Spec.AI.Backend, + Namespace: config.Spec.TargetNamespace, Filters: config.Spec.Filters, Anonymize: config.Spec.AI.Anonymize, Language: config.Spec.AI.Language,