Lab 0: Setup
Lab 000 - Environment Setup
- Welcome to
K-AgentLabs! - In this first lab, you’ll set up your development environment with all the tools needed for the
K-Agentinfrastructure. - This lab covers
Docker,Kubernetes, and theK-Agentlabs environment container.
What you’ll learn in this workshop:
- Install and configure required tools (Docker, kubectl, Helm, Ollama, MCP Inspector, K-Agent etc.)
- Build and run the K-Agent labs environment (Docker container or locally)
- Verify Kubernetes cluster connectivity
- Prepare the MCP server setup
01. Prerequisites Installation
π³ Docker Installation
# Set up the repository
sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
# Install Docker
sudo yum install -y docker-ce docker-ce-cli containerd.io
# Start Docker
sudo systemctl start docker
# Add user to docker group
sudo usermod -aG docker $USER
# Restart session or run:
newgrp docker
βΈοΈ kubectl Installation
β Helm Installation
π Git Installation
π Python3 Installation
π¦ Node.js Installation
π€ Ollama Installation
π MCP Inspector Installation
Kubernetes Cluster Setup (minikube)
Kubernetes Cluster Setup (kind)
02. Verify Tools Installation
- Verify that all the tools are installed
# Verify Docker
docker --version
# Verify kubectl
kubectl version --client
# Verify Helm
helm version
# Verify Git
git --version
# Verify Python3
python3 --version
# Verify Node.js
node --version
# Verify Ollama (if installed)
ollama --version
# Verify MCP Inspector
mcp-inspector --version
# Verify Kind (if installed)
kind --version
# Verify Minikube (if installed)
minikube version
# Verify Cluster Info (if cluster is running)
kubectl cluster-info
03. Install the K-Agent
- The
K-Agentlabs environment is the fundamental building block for all labs. - Its an Open Source framework to write MCP tools and interact with Kubernetes clusters.
Verify K-Agent Installation
04. Ollama Setup
- Ollama will be used as our LLM model for the labs.
- Ollama is a local LLM server that allows you to run large language models on your machine.
- Ollama supports various models, for example: Qwen and Llama.
- We will use the
qwen3-codermodel which is optimized for coding tasks or thellama2model.
Pulling Models (Ollama)
_ Pulling models can take a while depending on your internet speed and system performance. _ You can skip this step and return to it later when needed.
Setup Ollama models
# Start Ollama service
ollama serve
# In a new terminal, pull the qwen3-coder model (optimized for coding tasks)
ollama pull qwen3-coder:30b
# Alternatively, pull the gpt-oos model
ollama pull gpt-oos:7b
# Verify
ollama list
Pull a Model
# In a new terminal, pull the qwen3-coder model (optimized for coding tasks)
ollama pull qwen3-coder:30b
# Verify
ollama list
07. Verify Setup
- Let’s verify your setup by running a simple test.
Task 01: Check Cluster Information
Exercise 2: Test Container Environment
# Start labs environment if not running
cd labs-environment
docker compose up -d
# Execute commands in container
docker exec kagent-controller bash -c "
echo '=== Environment Check ==='
echo 'Node.js:' \$(node --version)
echo 'Python:' \$(python --version)
echo 'kubectl:' \$(kubectl version --client --short)
echo 'Helm:' \$(helm version --short)
echo '========================='
"
Expected Output:
=== Environment Check ===
Node.js: v18.x.x
Python: Python 3.10.x
kubectl: Client Version: v1.28.x
Helm: v3.13.x
=========================
08. Troubleshooting
Container Won’t Start
If the container fails to start, check:
Kubectl Not Working in Container
If kubectl commands fail in the container: