k8sGPT - ChatGPT for kubernetes Cluster
Shivam Agnihotri
Senior DevOps Engineer @ Infilect | Top Voice 2024 | 21K+ followers | Ex- Ravity, Nokia | Helping Freshers and Professionals
Have you tried chatting with ChatGPT and been blown away by its incredible responses? ChatGPT for your K8s platform is provided by K8sGPT. It allows the user to analyze issues in the cluster and report back with suggestions on how to resolve the issue. I used this to quickly check for K8s clusters, and it works well even in its initial release. The setup is very simple, and we'll go over it quickly. We will see some very appealing features in future releases.
Steps to setup k8sGPT
wget https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.1.1/k8sgpt_Linux_x86_64.tar.gz
tar -zxvf k8sgpt_Linux_x86_64.tar.gz
2. Move downloaded extracted binary code to bin directory.
root@shivam-agnihotri:/# mv k8sgpt /usr/local/bin/k8sgpt
3. It must obtain an API key from the OpenAI website or use the command below to generate one. OpenAI is currently the default AI backend provider.
root@shivam-agnihotri:/# k8sgpt generate
Opening: https://beta.openai.com/account/api-keys to generate a key for openai
Please copy the generated key and run `k8sgpt auth` to add it to your config filee
4. After getting the API key, we can add it to the config file using the below command
领英推荐
root@shivam-agnihotri:/# k8sgpt auth
Enter openai Key: key added
5. There are currently a few inbuilt analysers available for k8sGPT, with more planned for future releases. In other words, k8sGPT can currently detect issues in Kubernetes objects such as Pod, Persistent Volume, Replicaset, and Services.
Let's see few k8sGPT commands.
// analyze full kuberetes cluster?
k8sgpt analyze --explain
// filter by namespace
k8sgpt analyze --explain --filter=Pod --namespace=default
// filter on resource
k8sgpt analyze --explain --filter=Service --output=json
Definitely this can be very useful tool in future which helps in initial troubleshooting, thereby improving the Ops experience and making DevOps life better. Expecting more in this space and that’s all for now. You can check official k88GPT GitHub page for further release notes.
In case of any queries, please feel free to connect with me via LinkedIN
References:
Ingénieur DevOps orientée OPS | Platform Engineer
1 年Yanis KESRAOUI
Senior Cloud Engineer - Nagarro | Google Cloud Certified {"CDI, ACE , PCA, PDE}|Cloud DevOps Specialist | 5x GCP , Azure Certified | Devops | Linux | Docker | Terraform | Jenkins CI/CD | Kubernetes
1 年Finding this useful ?? Shivam Agnihotri
DevOps Engineer | Linux System Administrator | Self-proclaimed Linux Ninja
1 年That's true, you're absolutely right.