Development - Kubernetes

This guide covers deploying Watcher to Kubernetes using Helm charts for local development.

Prerequisites

Before deploying Watcher to Kubernetes for local development, ensure you have the following installed:

  1. Docker Desktop with Kubernetes enabled

  2. kubectl - Kubernetes command-line tool

  3. Helm - Kubernetes package manager

Note

Kubernetes Cluster Required: Make sure Docker Desktop’s Kubernetes cluster is running. You can enable it in Docker Desktop settings under “Kubernetes” and ensure the cluster is started.

Installation Steps

Install kubectl

brew install kubectl

Install Helm

curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash

Verify Installation

kubectl version --client
helm version

Deploy to Kubernetes

Access Your Application

After running make dev-kube, you can access:

Note

NodePort Service: The service is exposed directly on port 8000, so no port forwarding or external IP needed!

Stop the Development Environment

To stop the development environment:

# In a new terminal window
make dev-kube-stop

This will:

  • Remove the Helm deployment

  • Stop all dependencies

  • Clean up resources

Manual Development Setup - Alternative

If you prefer to run commands manually for development:

Start Dependencies

Start PostgreSQL and Redis using docker-compose:

docker-compose up -d postgres redis

Verify services are running:

docker-compose ps

Build Docker Image

Build the Watcher Docker image:

docker build -t watcher:latest .

Deploy with Helm

Deploy using Helm:

helm install watcher ./watcher

Check deployment status:

kubectl get pods
kubectl get services

Access the Application

With NodePort service configured, access the application via:

Note

NodePort Service: The service is exposed directly on port 8000, making it simple to access for development.

Cleanup

Remove the Deployment

helm uninstall watcher
docker-compose down

Note

Don’t forget to stop the Kubernetes cluster in Docker Desktop!