AI Summary
This video demonstrates how to use K8sgpt, an AI-powered CLI tool, integrated with Ollama (a local LLM) to quickly analyze and fix Kubernetes errors. The setup ensures private, secure, and free debugging without sending cluster logs to external services.
Chapters
K8sgpt is a CLI AI analysis tool for Kubernetes that scans cluster resources, catches errors, and explains how to fix them.
The tool identified an image pull authorization failure and provided a solution: check Docker Hub credentials, verify Kubernetes secrets, and update configuration.
Ollama is a free, private, local LLM that runs on your machine. The video uses Llama 3 model pulled via Ollama.
Connecting K8sgpt to Ollama keeps all data within your local network, avoiding sending logs to external services like OpenAI, which is important for enterprise security policies.
Install K8sgpt CLI, then configure the backend (Ollama or other providers like OpenAI). For Ollama, pull a model using 'ollama pull <model>'.
Use 'k8sgpt auth list' to see supported backends: OpenAI, Azure OpenAI, Amazon Bedrock, Google Gemini, Hugging Face, Ollama, etc.
Commands: 'k8sgpt auth add -b ollama' to add Ollama, 'k8sgpt auth default -p ollama' to set it as default.
After correcting the image name in the deployment YAML, the pods ran successfully, and K8sgpt confirmed no errors.
K8sgpt with Ollama provides a fast, private, and free way to debug Kubernetes errors using local AI models, making it ideal for enterprise environments with strict security requirements.
Clickbait Check
95% Legit"Title accurately describes the content: using K8sgpt and Ollama to fix Kubernetes errors quickly and privately."
Mentioned in this Video
Tutorial Checklist
Study Flashcards (7)
What is K8sgpt?
easy
Click to reveal answer
What is K8sgpt?
A CLI AI analysis tool for Kubernetes that scans cluster resources, catches errors, and explains how to fix them.
00:28
What is Ollama?
easy
Click to reveal answer
What is Ollama?
A free, private, local LLM that runs on your machine, providing multiple open-source models.
01:53
Why is using Ollama with K8sgpt beneficial for enterprises?
medium
Click to reveal answer
Why is using Ollama with K8sgpt beneficial for enterprises?
It keeps all data within your local network, avoiding sending logs to external services, which is important for security policies.
02:53
What command adds Ollama as a backend in K8sgpt?
medium
Click to reveal answer
What command adds Ollama as a backend in K8sgpt?
k8sgpt auth add -b ollama
05:48
What command sets Ollama as the default backend?
medium
Click to reveal answer
What command sets Ollama as the default backend?
k8sgpt auth default -p ollama
07:42
What command runs the analysis with explanation in K8sgpt?
easy
Click to reveal answer
What command runs the analysis with explanation in K8sgpt?
k8sgpt analyze --explain
00:44
Name three backends supported by K8sgpt besides Ollama.
hard
Click to reveal answer
Name three backends supported by K8sgpt besides Ollama.
OpenAI, Azure OpenAI, Amazon Bedrock (or Google Gemini, Hugging Face, etc.)
05:06
💡 Key Takeaways
Error and solution displayed
The tool instantly shows both the error and the exact fix, demonstrating its practical value.
01:10Privacy pitch
Emphasizes that everything stays local, addressing a key enterprise concern about data security.
02:53Error resolved after fix
After correcting the image name, the pods run successfully, validating the tool's effectiveness.
08:33Full Transcript
[00:00] Hi everyone welcome back to the DevOps bucket. Look at my terminal screen right now. If you are a DevOps engineer or any student that do or learning Kubernetes you might face these kind of issues in Kubernetes in every single day.
[00:12] Usually we spend hours of kubectl describe output for this and checking logs and then searching it into the open source like Google or any of the AI tools like chatgbt you will paste there and you will understand something and you will get back to here and we will make some changes.
[00:28] look at what will happen if I run a simple command to get the analysis of this yes I am using a tool called k8sgpt which is an cli ai analysis tool for kubernetes let me first run the command and
[00:44] let's discuss it so k8sgpt if I write analyze hyphen xplain okay first it will check my cluster
[00:57] resources that I am creating here, scan our cluster, caught the error and explained exactly how to fix it in a simple image. If you see this, if you see this, the error and the solution.
[01:10] What the error is sufficient scope for pulling image due to authorization failures. And what's the solution? Check if you have a valid Docker Hub and login credentials, verify your Kubernetes first to access, update your configuration or rollout or restart to deployment. That means
[01:26] it's identifying that our image is wrong or may be referenced differently because if you see the error back of pulling image error fail to pull the image because of
[01:38] another is that says this is how we can get this kind of explanation from the creator GPT tool in the best part I am not using any of open UI or philanthropic or any costly tools that I can need to pay for per second or per
[01:53] token web I am not paying any single rupee for this because this is LLM model which is running in my local machine it is completely free and it is private to me and I am using my own machine it is called olama it is called olama olama is a
[02:10] chart model that will provide us in multiple LLM models to open source okay so what I have made is I have created this olama like downloaded olama and pulled one of the ulama LLM this is my ulama if you are able to see this so we have these many lot of models that are available open in the open source that we can use free of cost Currently I have downloaded the lama 3 model and lama 3 model so I am using those models
[02:39] directly. So this is how it is working in the backend. So before we look at the setup how to do this let us understand why this matter for your So usually AI tools send your private cluster logs to external service like OpenAI but in
[02:53] 2026 enterprise companies are strictly forbid this due to the security policies. By connecting KDA GPT to O-LAMA everything stays inside your local mission and it is free of cost stays within your private network or local mission network only.
[03:07] So KDA GPT uses its built-in analyzer to extract the error, passes it to your local model like or whatever model that we are using and gives you the solution instantly and it is 100%
[03:19] private secure and free. So let me explain how to do this. So first as I said there is a tool called K8S GPT. So this K8S GPT is in wrapper which will analyze our cluster resources and send to one LLM
[03:33] to get the information about the error or issue or whatever the cluster state we are having. Currently we are using this as OLAMA as a local model. You can also use OpenAI, Anthropic, anything.
[03:45] How to set up this? First you need to install the KITLGPT in your local CLI. Ok after installing it you have two commands to run. First one is to download any model from Olama.
[03:57] If you are using OpenAI or Anthropic no need to do this but you need to create an API key in their website and add that API key to this KITLGPT. So let me show you how you can set up this.
[04:10] For installation purpose you need to open this website I will show you in the link in the description below. So after this as per your operating system like you are using macOS or linux or windows as per your operating system just download this.
[04:24] Copy the comment here and paste it in your terminal. Once you install it you can able to see the ktlgpt is available if you type ktlgpt it will show you all the help commands that were available.
[04:36] So currently if you are seeing the available command these are available commands that I have currently used this analyze this command will find the problems within your kubernetes cluster and here we are interested now for the setup for that just use the auth so auth command is gives is helps you to authenticate with your chosen backend backend is basically one LLM currently I am using the kvdn gpt with olama so let me show you how I am using olama so let type kvdn gpt auth and list
[05:06] it will show the list of available backends that you can connect with the kvdn gpt see these are all the available items so you can use openai you can use azure openai amazon bedrock or amazon bedrock converse
[05:19] save maker google new api hugging face and drop etc everything you can use oci as well so i am using olama so how to activate or how to make it default okay for that you can type create a gpt
[05:33] auth add hyphen b is a backend and type olama because i have already created with olama So provider with same name is already existed for saying but you can add this k-auth add-d olama.
[05:48] Okay and also how to set default. To set default use auth-help for the first time. If you see the options available add is to add a new provider. Default is to set to default a backend provider.
[06:00] Remove 1 removing it. Let me remove and show you how to add in live. Okay auth remove olama hyphen d olama. Okay. ok olama is deleted from the backend just let me do offlist comment ok so now the default sets to
[06:18] open ai why because everything will start with open ai in the kata gpt if you want any other items to be added as a backend you can just need to run the comment so now if i run kata gpt again
[06:30] it analyze it will hyphen as an explain it will just give me an error to add an ai key ok because the AI provider is not specified in the configuration because my
[06:43] there are new active open ads keys or any of the model if I have to use this I need to activate right so ktgpt auth add I can be olama ok olama is added and the
[06:59] model input is empty so it will use it is using GPT 4O from the olama itself now let me add a default so let me first see the list of list ok now it is active if I use this let me explain if I use this it will show me the error ok because open ai is still using because it a default one so how to change the default one let me type ktgpt auth hyphen
[07:29] hyphen help again to show you what's the command to use so default default is a another command so let's type ktgpt auth default ulama and so here for the setting default we need to
[07:42] use hyphen p olama okay now default is set to olama because p is a name of the provider okay while while setting up you need to use hyphen p that is the back end and now after activating it you need to use hyphen p option to provide what name that you want to make
[07:58] the default so now if i run this ktlgbt list now see olama is default olama is active now it will work fine okay that's it now so these are the steps that you have to do to add anything
[08:16] okay let me rerun the deployment msl by updating it properly then do this so this is my deployment msl i have intentionally made this image name as wrong let me remove this and put only nginx because it will take the latest by default let me qhtml let me apply this deployment.ml
[08:33] ok now it is configured so Qtcd will get pods ok now those are coming as running state ok now those are running let me run the same command as analyze fnfnxp
[08:45] see now the error that it was showing previously was not there here the actual issue that was showing previously was solved so this is how you need to use this kdgpt for a quick error check and to understand what the issue is going on
[09:01] so before running it you need to download the olama model if you are not using it already because if your first time you are using it you need to install the olama right for that i will provide another link in the discussion to install it so for installing it just run olama
[09:17] pull the model name let's say lama3 ok then it will pull it was already available in my So it's 4.57 GPT is already there.
[09:29] So it uses a cache and showed me success. So like this you need to pull one model and you need to use this. So this is how we need to use this lama. Try setting up olama with k.gp.t in your system.
[09:41] Let me know in the comments below and like this video to support the devs bucket and I will see you in the next practical deployment.