Skip to content

Commit 9dcaf11

Browse files
feat: full Kubernetes deployment with monitoring stack
K8s manifest fixes: - Fixed image to rishabhverma17/hypercache:latest (was wrong name) - Dynamic seed: only seed with node-0, gossip propagates the rest - Simplified init container to wait for seed node only - Updated config to match new defaults (TTL=0, multi-store, max_stores=16) New K8s monitoring stack (k8s/monitoring.yaml): - Elasticsearch StatefulSet + Service - Filebeat DaemonSet with RBAC (auto-ships logs from all pods) - Grafana Deployment with pre-configured datasources New K8s dashboards (k8s/grafana-dashboards.yaml): - Same 3 Grafana dashboards as Docker (Health, Performance, System) - Loaded via ConfigMap — no manual setup needed Makefile targets: - make k8s-up/down/scale/status/logs/dashboard/grafana Usage: kubectl apply -f k8s/ (deploys everything) Scale: make k8s-scale NODES=5 or use Minikube Dashboard UI
1 parent d6ef4fe commit 9dcaf11

5 files changed

Lines changed: 704 additions & 56 deletions

File tree

Makefile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,39 @@ docker-down:
116116
docker-logs:
117117
docker compose -f docker-compose.cluster.yml logs -f --tail=50
118118

119+
## k8s-up: Deploy to Kubernetes (Minikube)
120+
k8s-up:
121+
kubectl apply -f k8s/
122+
@echo "Waiting for pods..."
123+
@kubectl wait --for=condition=ready pod -l app=hypercache -n hypercache --timeout=120s 2>/dev/null || true
124+
@echo "Cluster status:"
125+
@kubectl get pods -n hypercache
126+
127+
## k8s-down: Remove from Kubernetes
128+
k8s-down:
129+
kubectl delete -f k8s/ --ignore-not-found
130+
131+
## k8s-scale: Scale HyperCache replicas (usage: make k8s-scale NODES=5)
132+
k8s-scale:
133+
kubectl scale statefulset hypercache -n hypercache --replicas=$${NODES:-3}
134+
@echo "Scaled to $${NODES:-3} replicas"
135+
136+
## k8s-status: Show K8s cluster status
137+
k8s-status:
138+
@kubectl get pods,svc -n hypercache
139+
140+
## k8s-logs: Tail HyperCache pod logs
141+
k8s-logs:
142+
kubectl logs -f -l app=hypercache -n hypercache --max-log-requests=10 --tail=50
143+
144+
## k8s-dashboard: Open Minikube dashboard
145+
k8s-dashboard:
146+
minikube dashboard &
147+
148+
## k8s-grafana: Open Grafana in browser (Minikube)
149+
k8s-grafana:
150+
minikube service grafana -n hypercache
151+
119152
## deps: Download and verify dependencies
120153
deps:
121154
$(GO) mod download

README.md

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -128,15 +128,30 @@ docker compose -f docker-compose.cluster.yml down
128128

129129
### Kubernetes
130130
```bash
131-
# Deploy a 3-node cluster
132-
kubectl apply -f k8s/hypercache-cluster.yaml
131+
# Prerequisites: minikube (brew install minikube) + kubectl (brew install kubectl)
133132

134-
# Scale to 5 nodes
135-
kubectl scale statefulset hypercache -n hypercache --replicas=5
133+
# Start Minikube
134+
minikube start
136135

137-
# Check cluster
138-
kubectl get pods -n hypercache
139-
kubectl exec -n hypercache hypercache-0 -- wget -qO- http://localhost:9080/health
136+
# Deploy full stack (HyperCache + Elasticsearch + Filebeat + Grafana)
137+
make k8s-up
138+
# or: kubectl apply -f k8s/
139+
140+
# Check cluster status
141+
make k8s-status
142+
143+
# Scale to 5 nodes (or use Minikube Dashboard UI)
144+
make k8s-scale NODES=5
145+
146+
# Open dashboards
147+
make k8s-dashboard # Kubernetes Dashboard (pods, scaling, logs)
148+
make k8s-grafana # Grafana (same dashboards as Docker — admin/admin123)
149+
150+
# View logs
151+
make k8s-logs
152+
153+
# Tear down
154+
make k8s-down
140155
```
141156

142157
### 📊 Access Points
@@ -259,6 +274,13 @@ make fmt Format code
259274
make docker-build Build Docker image
260275
make docker-up Start Docker stack
261276
make docker-down Stop Docker stack
277+
make k8s-up Deploy to Kubernetes (full stack)
278+
make k8s-down Remove from Kubernetes
279+
make k8s-scale NODES=5 Scale to N replicas
280+
make k8s-status Show K8s pod/service status
281+
make k8s-dashboard Open Minikube dashboard
282+
make k8s-grafana Open Grafana (K8s)
283+
make k8s-logs Tail HyperCache pod logs
262284
make deps Download and tidy dependencies
263285
```
264286

0 commit comments

Comments
 (0)