Skip to content

Add Kubernetes deployment manifests (Deployment, Service, ConfigMap, Secret) #14

@treblereel

Description

@treblereel

Context

Part of epic #1 — Build production-ready REST microservice with k8s deployment on top of casehub-engine. After Docker image is built (issue #13), need Kubernetes manifests for deploying the service with proper configuration, health checks, and resource management.

What

Create Kubernetes deployment manifests:

  • Deployment manifest with liveness/readiness probes, resource limits, multiple replicas
  • Service manifest (ClusterIP or LoadBalancer)
  • ConfigMap for non-sensitive configuration
  • Secret example for database credentials
  • PostgreSQL deployment example (StatefulSet or external DB reference)

Acceptance Criteria

  • Deployment manifest includes liveness probe pointing to /q/health/live
  • Deployment manifest includes readiness probe pointing to /q/health/ready
  • Resource requests and limits defined (e.g., CPU: 500m/1000m, memory: 512Mi/1Gi)
  • Deployment supports multiple replicas (default: 2) for stateless operation
  • ConfigMap contains non-sensitive env vars (DB_HOST, DB_PORT, DLQ_ENABLED, etc.)
  • Secret example shows secure credential injection (DB_USERNAME, DB_PASSWORD)
  • Service manifest exposes port 8080 for HTTP traffic
  • PostgreSQL StatefulSet or external database connection example provided
  • All manifests valid and deployable with kubectl apply -f k8s/

Notes

  • Manifests should go in k8s/ or deploy/k8s/ directory
  • Use environment variables from ConfigMap/Secret (issue Add production configuration profile with environment variables #9)
  • Graceful shutdown: set terminationGracePeriodSeconds appropriately
  • Consider adding HorizontalPodAutoscaler example (can be follow-up)
  • PostgreSQL can be external managed service or in-cluster StatefulSet for dev
  • File paths: k8s/deployment.yaml, k8s/service.yaml, k8s/configmap.yaml, k8s/secret-example.yaml, k8s/postgres.yaml

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions