Hands-on demonstration of K8sGPT, an AI assistant for Kubernetes diagnostics and remediation, covering authentication, cluster analysis, and common deployment errors.
Welcome to a hands-on demonstration of K8sGPT, your AI assistant for Kubernetes diagnostics and remediation. In this lesson, we’ll:
Authenticate with your AI backend
Scan and explain cluster issues
Filter results by namespace and resource type
Review common NGINX deployment errors and solutions
Before using K8sGPT, add your OpenAI (or Hugging Face) API key:
Copy
Ask AI
k8sgpt auth add
Sample output:
Copy
Ask AI
ollama@Bakugo:~/demo-k8sgpt$ k8sgpt auth addWarning: backend input is empty, will use the default value: openaiWarning: model input is empty, will use the default value: gpt-3.5-turboEnter openai Key:
K8sGPT supports multiple backends (e.g., OpenAI and Hugging Face). If you don’t specify, it defaults to OpenAI’s gpt-3.5-turbo.
15: Pod kube-system/etcd-docker-desktop/etcd() - Error: {"level":"warn","ts":"2024-08-12T22:31:30.352021Z",...}17: Pod kube-system/kube-controller-manager-docker-desktop/kube-controller-manager() - Error: serviceaccount "k8sgpt" not found19: Pod default/nginx/nginx() - Error: no such file or directory20: Pod k8sgpt/nginx-deployment-6f596f9bb9-8mw6m/nginx(Deployment/nginx-deployment) - Error: The server rejected our request for an unknown reason (get pods nginx-deployment-6f596f9bb9-8mw6m)
K8sGPT delivers natural-language diagnostics for Kubernetes. Use it to troubleshoot Pods, Deployments, Services, and more. Head into your lab environment and let AI power your Kubernetes operations!