As a DevOps engineer, I’m always looking for tools that streamline Kubernetes troubleshooting. Recently, I built Kubemate a Flask-based chatbot that analyzes your Kubernetes logs, YAML files, Dockerfiles, and offers actionable insights powered by Google’s Gemini language model through LangChain.
In this post, I’ll walk you through what Kubemate does, how to run it locally, containerize with Docker, and deploy it to AWS Elastic Beanstalk all while keeping things beginner-friendly. for a video tutorial checkout https://youtu.be/fa_W5lBjbQw
What is Kubemate?
Kubemate is a simple web app where you can paste or upload Kubernetes-related files. It sends the content to Google Gemini LLM and returns context-aware explanations, helping you debug or optimize configurations.
It supports multi-turn conversations using Flask sessions and Markdown-rendered responses. Plus, it includes basic log anomaly detection, giving you a peek into possible issues.
Local Development & Docker
The project is built with Python 3.10 and Flask. After cloning the repo and installing dependencies:
pip install -r requirements.txt
python main.py
The app will run on localhost:5000
.
For containerization, build the Docker image:
docker build -t kubemate .
docker run -p 5000:5000 kubemate
Deploying on AWS Elastic Beanstalk
I chose AWS Elastic Beanstalk because it lets me deploy Dockerized apps quickly with minimal config perfect for rapid iteration during development.
Steps:
Initialize EB app:
eb init
Choose Docker platform and region.Create environment:
eb create kubemate-env
Set environment variables (like your Gemini API key) via CLI or AWS Console.
Deploy:
eb deploy
Open in browser:
eb open
When done, terminate to avoid charges:
eb terminate kubemate-env
Why Elastic Beanstalk?
Compared to AWS Amplify or ECS, Elastic Beanstalk offers a nice balance of ease and flexibility especially when you have a backend API with Docker. It handles provisioning and scaling your containers automatically with simple commands.
The full source code is on my GitHub repo.
Top comments (0)