Kubemate is a Flask-based AI-powered chatbot designed for Kubernetes DevOps practitioners to analyze logs, YAMLs, Dockerfiles, and provide troubleshooting insights using Google Gemini via LangChain. It also includes a simple anomaly detection capability for logs.
This project demonstrates a full DevOps workflow:
- Local development with Python and Flask
- Containerization with Docker
- Cloud deployment on AWS Elastic Beanstalk with Docker support
- Environment variable management
- Session-based multi-turn chat memory
- Paste logs or upload files (log, YAML, Dockerfile) to analyze
- Uses Google Gemini LLM through LangChain for context-aware DevOps assistance
- Maintains chat history per session
- Clear chat history button
- Containerized for easy deployment
- Deployable to AWS Elastic Beanstalk with Docker
- Basic anomaly detection on logs (can be extended)
-
Python 3.10+
-
Docker installed
-
AWS CLI installed and configured
-
EB CLI installed (
pip install awsebcli) -
AWS Account (Free tier supported)
-
.envfile containing:GEMINI_API_KEY=your_google_gemini_api_key_here
git clone https://github.com/yourusername/kubemate.git
cd kubemate
pip install -r requirements.txtpython main.pyAccess the app: http://localhost:5000
docker build -t kubemate .docker run -p 5000:5000 kubemateeb init- Select your region
- Choose existing app or create new
- Platform: Docker running on 64bit Amazon Linux 2023
- SSH setup: optional
eb create kubemate-envSet your Gemini API key:
Via AWS CLI:
aws elasticbeanstalk update-environment \
--environment-name kubemate-env \
--option-settings Namespace=aws:elasticbeanstalk:application:environment,OptionName=GEMINI_API_KEY,Value=your_api_key_here \
--region your_aws_regionOr via AWS Console: Elastic Beanstalk → kubemate-env → Configuration → Software → Environment Properties
eb deployeb openeb logsTo stop all resources and avoid charges:
eb terminate kubemate-envTo remove application and all environments entirely:
eb terminate kubemate-env --all- Add a
/healthroute in Flask for Elastic Beanstalk health checks:
@app.route("/health")
def health():
return "OK", 200- Make sure your
Dockerfileis correctly formatted:
FROM python:3.10-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
EXPOSE 5000
CMD ["python3", "main.py"]- For multi-turn chat persistence, Flask sessions are used; no external DB required.