[Question]: Details field is empty and some AI responses are in English despite Portuguese configuration
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
0.2.22
Kubernetes Version
v1.28.10
Host OS and its Version
No response
Steps to reproduce
I am using the latest version of both the k8sgpt-operator and k8sgpt-ai, which is the CLI that triggers the AI for error recommendations.
helm install my-k8sgpt-operator k8sgpt/k8sgpt-operator --version 0.2.22
k8sgpt.yaml apiVersion: core.k8sgpt.ai/v1alpha1 kind: K8sGPT metadata: name: k8sgpt-sample namespace: default spec: ai: anonymized: false autoRemediation: enabled: false resources:
- Pod
- Deployment
- Service
- Ingress similarityRequirement: "" backOff: enabled: false maxRetries: 5 backend: google enabled: true language: portuguese maxTokens: "2048" model: gemini-2.5-pro secret: key: google-api-key name: google-api-secret topk: "50" analysis: interval: 30m filters:
- Pod
- Deployment
- Ingress
- Service
- Security repository: ghcr.io/k8sgpt-ai/k8sgpt version: v0.4.23 <--------------------------------- latest version k8stp-ai
- I changed prompts.go to translate to my language portuguese I have already tested 4 different versions of k8sgpt-ai with the same result. I have rebuilt the Docker image and re-applied the k8sgpt-ai after changing the prompts.go file to confirm that my changes were used.
package ai
const ( default_prompt = `Você é um analista de Kubernetes. Responda EXCLUSIVAMENTE em Português do Brasil (pt-BR). Nunca use outro idioma.
Explique o erro do Kubernetes abaixo de forma concisa e proponha uma solução passo a passo.
Se o contexto for insuficiente, forneça uma mensagem padrão em português: "Não foi possível analisar o erro. Verifique os logs do pod para mais detalhes."
Entrada (entre ---):
---
%s
---
`
prom_conf_prompt = `Você é um especialista em Prometheus e Kubernetes.
Responda EXCLUSIVAMENTE em Português do Brasil (pt-BR). Nunca use outro idioma.
Explique o erro de configuração do Prometheus abaixo e forneça a solução mais provável em passos.
Se o contexto for insuficiente, forneça uma mensagem padrão em português: "Não foi possível analisar o erro de configuração. Verifique a sintaxe YAML do seu arquivo."
Entrada (entre ---):
---
%s
---
`
prom_relabel_prompt = `Você é um especialista em Prometheus e Kubernetes.
Responda EXCLUSIVAMENTE em Português do Brasil (pt-BR). Nunca use outro idioma.
Analise as configurações de scrape do Prometheus abaixo e descreva para cada job os labels de serviços e pods, namespaces, portas e containers correspondentes.
Se o contexto for insuficiente, forneça uma mensagem padrão em português: "Não foi possível analisar as configurações de relabel. Verifique o arquivo de configuração do Prometheus."
Entrada (entre ---):
---
%s
---
`
kyverno_prompt = `Você é um especialista em segurança Kubernetes (Kyverno).
Responda EXCLUSIVAMENTE em Português do Brasil (pt-BR). Nunca use outro idioma.
Simplifique o aviso do Kyverno abaixo e forneça o comando kubectl mais provável para corrigir.
Se o contexto for insuficiente, forneça uma mensagem padrão em português: "Não foi possível analisar o aviso do Kyverno. Verifique o PolicyReport para mais detalhes."
Entrada (entre ---):
---
%s
---
`
raw_promt = `{"language": "%s","message": "%s","prompt": "%s"}`
)
var PromptMap = map[string]string{ "raw": raw_promt, "default": default_prompt, "PrometheusConfigValidate": prom_conf_prompt, "PrometheusConfigRelabelReport": prom_relabel_prompt, "PolicyReport": kyverno_prompt, "ClusterPolicyReport": kyverno_prompt, }
Expected behaviour
I expect all analyses to return with a populated details field, containing the AI's response in Portuguese, as configured.
Actual behaviour
Empty Details Field: Many analyses return with the details field in the Result Custom Resource being empty, meaning there is no AI response.
Incorrect Language: Even with my prompts.go file written entirely in Portuguese and the kind: k8sgpt-ai resource configured with the language: portuguese parameter, some analyses are still coming back with the AI's response in English.
I appreciate your help in advance.
Additional Information
Example: The empty field
"spec": { "backend": "google", "details": "", <--------------------------------------------- "error": [ {
Example: analysis in English
Backend: google
Details: Error: The 'file' container has .....................
Solution: 1. Edit the DaemonSet xxxxxxxx. 2. Navigate to the filecontainer spec. 3. Setfiletofalse`.
Source: k8sgpt-ai/k8sgpt