-
Notifications
You must be signed in to change notification settings - Fork 12
Description
[RFC] Docker Support for Valkey Admin
Summary
This RFC proposes adding Docker support to Valkey Admin, enabling deployment as a containerized web application. The primary use case is running Valkey Admin in Kubernetes clusters to connect to in-cluster Valkey nodes, replacing Redis Insights as the cluster management interface.
Motivation
We need to deploy Valkey Admin in our Kubernetes environment to connect to in-cluster Valkey nodes. This will replace our current Redis Insights deployment, providing a modern web-based interface for managing Valkey clusters directly from within the cluster.
Design Proposal
Architecture
The Docker implementation will provide the web-based subset of Valkey Admin features (as mentioned in the README, some features like hotkeys and commandlogs require Electron). The container will run:
- WebSocket Server (port 8080): The backend server that handles Valkey connections
- Frontend Server (port 5173): Static file server for the React frontend
Technical Approach
Multi-Stage Docker Build
The Dockerfile will use a multi-stage build pattern for optimal image size and build efficiency:
Stage 1: Builder
- Base:
node:22-bookworm-slim - Copies package files first (for better layer caching)
- Installs all dependencies via
npm ci - Copies source code
- Builds all components using
npm run build:all
Stage 2: Production
- Base:
node:22-bookworm-slim(minimal runtime) - Installs
serveglobally for static file serving - Copies only built artifacts from builder stage:
apps/server/dist(server bundle)apps/frontend/dist(frontend build)apps/metrics/dist(metrics build)apps/metrics/config.yml(metrics config)
- Copies only necessary runtime dependencies:
@valkey/*(Valkey client libraries)ws(WebSocket library)long,protobufjs,@protobufjs(protobuf dependencies)p-limit,ramda(utility dependencies)
Entrypoint Script
A shell script (docker-entrypoint.sh) will:
- Start the WebSocket server in the background
- Start the frontend static file server in the background
- Handle graceful shutdown via signal trapping (TERM, INT)
- Wait for both processes and clean up on exit
Docker Best Practices
.dockerignorefile to exclude unnecessary files from build context- Optimized layer caching (package files copied before source)
- Minimal production image (only runtime dependencies)
- Proper signal handling for graceful container shutdown
- Non-root user consideration (can be added in future if needed)
Files to Add
Dockerfile: Multi-stage build configurationdocker-entrypoint.sh: Startup and signal handling script.dockerignore: Exclude patterns for build context optimizationREADME.docker.md(optional): Docker-specific documentation
Usage Example
# Build the image
docker build -t valkey-admin .
# Run the container
docker run -d \
--name valkey-admin \
-p 8080:8080 \
-p 5173:5173 \
valkey-admin
# Access the web interface
open http://localhost:5173Kubernetes Deployment
The containerized version is designed to run in Kubernetes, connecting to in-cluster Valkey nodes via their service endpoints. This enables cluster operators to manage Valkey instances without requiring desktop application access.
Ports
- 8080: WebSocket server (backend)
- 5173: Frontend web server
Limitations
As noted in the README, the web version provides a subset of features. The following Electron-specific features will not be available:
- Hotkeys
- Commandlogs
- Full desktop integration
This is expected and documented behavior.
Impact
Positive
- ✅ Enables Kubernetes deployment for in-cluster Valkey management
- ✅ Replaces Redis Insights with a modern Valkey-native interface
- ✅ No breaking changes to existing functionality
Considerations
⚠️ Web version has limited features (already documented - no hotkeys/commandlogs)⚠️ Additional maintenance for Docker-related files⚠️ Need to keep Dockerfile in sync with build process changes
Implementation Plan
- Create
Dockerfilewith multi-stage build - Create
docker-entrypoint.shfor process management - Create
.dockerignorefor build optimization - Test build and runtime behavior
- Update documentation (if needed)
Questions for Review
- Should we add health check endpoints for Kubernetes liveness/readiness probes?
- Should we support environment variables for configuration (e.g., default connection endpoints)?