Transcript for:
Introduction to Kubectl AI Agent

Hello everyone, my name is Abhishek and welcome back to my channel. So Google launched cubectl AI agent and you should definitely try it. So imagine you're learning Kubernetes. A lot of times you go to chat GPT or other AI assistants to get cubectl commands. Maybe you want to get the cubectl command which can create enginex deployment for you or maybe you want to get a cubectl command that can scale up the replicas of your deployment. Now you don't have to do it because cubectl AI agent. So you can just ask this agent to do the task and it can actually perform the task on your Kubernetes cluster. So you can just tell this AI agent, hey agent, create engineext deployment in the default name space and it will provide you the command and also it will execute the command on your behalf. You can just tell this AI agent to scale up the replicas and it will do the exact same thing. Let's see how simple is to use this AI agent. All that we need to do is set up this AI agent on our local machine which is just a binary and we need to provide access to a large language model because end of the day AI agents need large language models. So I'll show you how you can do both of it for absolutely free of cost. So as a first step we will just download this plug-in or the binary. So you need to go to the release notes steps are provided in the documentation. So this readme file just scroll down head to the quick start. So it says download the latest release from the release page. So in the release page the latest version is 0.0.7 according to the architecture. So they have different architectures. for example. So if you're on Windows, let's say with x86, so you can use this zip file. I'm on Mac x86, sorry, ARM processor. So I'll just download this particular thing. So click on it. You will have a zip file in your downloads location. Head to your terminal and extract the tar file. Perfect. So I'm on my terminal cd downloads tar. You can also get these commands from the quick start. So you don't have to you know search for this command. It's also provided in the quick start. Okay. So now it is extracted. Then you need to grant permissions chod provide the execute permissions and just move it to the path so that every time you don't have to you know use this binary from the downloads. So I'll just move it to user local bin. Perfect. So now I have my executable in the path. Now that we have this agent or the binary, we need to grant it with permissions to large language model. Of course, you can use Olama and you can run your own large language model locally or choice of your large language model. But for the purpose of demonstration and even if you want to learn Kubernetes, I would recommend use a Gemini model from Google AI studio. In the past, I explained you about Google AI Studio. It is very good for learning and you can create API token for absolutely free of cost. Anyways, the choice is yours. If you want to use a local RS language model, you can still do it. So, get the API key. If you have already created a project, it shows you list of projects. And from this list of projects, you can select one. And as soon as you select, you have API key created for you. I already have the API key. Once you have the API key, you are almost done. So you just need to export the API key, right? So if you scroll up, we are using Google AI studio. So I just need to export it using the export command. And once you do it, you just need to use the agent. Let me verify if cubectl AI works. Okay, it says uh on my Mac it is not trusted. So I'll just head to the system settings. You might also face this if you're using it for the first time. Okay, I'll just head to privacy and settings. Scroll down in the privacy and settings. Cubectl AI was blocked. I'll say allow anyways. Now when I run cubectl AI open anyway grant the permissions. Perfect. We are good. It says hey there what can I help you with today? So I'll just ask it create enginex deployment in the default name space. I'm not talking about creating a Kubernetes cluster. So it says please pass valid API key. Okay. It looks like my Gemini API key is expired. Let me quickly create one more. Okay. So, create API key. I'll choose the project. Great. So, I have my API key. I'll just export it one more time. I'll delete this API key as soon as I'm done with the video. And I would also recommend you to do it. Great. So now let me try it one more time. Create engineext deployment in the default name space. Okay. So it looks like it's working. Do you want to proceed? Yes. Yes. And don't ask me again. I would recommend you to go with one instead of two so that you know every time it asks your permission. So it says okay I have created enginex deployment in the default name space. Let's see if it actually did it. Cubectl get pods. Great. So it has created engineext deployment. Okay. So now let's ask it to create in a different name space. So I'll just say create a name space called enginex and deploy enginex pod through kubernetes deployment in the enginix name space. Okay. So this is a little complicated instruction. It has to create namespace and it also has to create engineext deployment within the nameace. Okay. One. So it first says I will create a namespace and then it said I will create the deployment. If you don't want to see this again and again, you can just press two. But the version of this AI agent is still 0.0.7. So it's too early to completely trust this AI agent. I wouldn't recommend it or I wouldn't recommend using it in the production yet because I would at least wait for cubectl AI version one. Okay. Anyways, now let's see step one. Did it create the nameace? Cubectl get NS. Okay. There is a name space called engineext. cubectl get pods hyphen n engine enginex. Awesome. So it performed multiple instructions for us. Now finally let's test it by asking it to scale up the replicas. So again I'll just say cubectl AI increase the replicas of enginex deployment or scale up the enginex deployment to three replicas. So increase the replicas of engineext deployment in engineext name space to three. Okay. So it should provide us with a command first one and tada. So it actually created or it actually scaled the engineext deployment to three replicas. Cubectl get pods hyphen n engineext. Awesome. So this is especially very useful for learners like you don't have to switch between multiple tabs. you have your Kubernetes cluster and at the same place where you are connected to your Kubernetes cluster, you can actually use this agent and learn things at the same time. Great. So I would recommend you to try this cubectl AI agent on your dev servers or on your local machines but not yet on the production. As I told you, it's too early. The version of this is 0.0.7. I would at least wait for version one that is V 1.0.0. I hope you found this video interesting. Let me know in the comment section if you're interested in learning any such interesting things like AI agents on Kubernetes, Terraform. I would be happy to do videos. See you all in the next one. Take care. Bye-bye.