Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Multi-stage build for minimal final image
FROM rust:1.89-alpine as builder
FROM rust:1.89-alpine AS builder

# Install build dependencies
RUN apk add --no-cache musl-dev openssl-dev openssl-libs-static pkgconfig
Expand Down
22 changes: 16 additions & 6 deletions crates/redisctl/src/workflows/enterprise/init_cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,22 @@ impl Workflow for InitClusterWorkflow {
.unwrap_or_else(|| "default-db".to_string());
let db_memory_gb = args.get_i64("database_memory_gb").unwrap_or(1);

// Create client
let client = context
.conn_mgr
.create_enterprise_client(context.profile_name.as_deref())
.await
.context("Failed to create Enterprise client")?;
// Create unauthenticated client for bootstrap operations
// Bootstrap doesn't require auth, but we need the URL from the environment/profile
let base_url = std::env::var("REDIS_ENTERPRISE_URL")
.unwrap_or_else(|_| "https://localhost:9443".to_string());
let insecure = std::env::var("REDIS_ENTERPRISE_INSECURE")
.unwrap_or_else(|_| "false".to_string())
.parse::<bool>()
.unwrap_or(false);

let client = redis_enterprise::EnterpriseClient::builder()
.base_url(base_url)
.username("") // Bootstrap doesn't require auth
.password("") // Bootstrap doesn't require auth
.insecure(insecure)
.build()
.context("Failed to create Enterprise client for bootstrap")?;

// Step 1: Check if cluster is already initialized
let needs_bootstrap = check_if_needs_bootstrap(&client).await?;
Expand Down
53 changes: 30 additions & 23 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,36 @@ services:
start_period: 10s

# Auto-initialize Redis Enterprise cluster using our workflow
redis-enterprise-init:
image: joshrotenberg/redisctl:latest
container_name: redis-enterprise-init
depends_on:
redis-enterprise:
condition: service_healthy
networks:
- redisctl-network
environment:
REDIS_ENTERPRISE_URL: "https://redis-enterprise:9443"
REDIS_ENTERPRISE_INSECURE: "true"
command:
[
"enterprise",
"workflow",
"init-cluster",
"--name",
"docker-cluster",
"--username",
"admin@redis.local",
"--password",
"Redis123!",
]
# DISABLED UNTIL v0.5.1: The init-cluster workflow requires unauthenticated bootstrap fix
# which is not in v0.5.0. For now, manually initialize the cluster:
#
# docker exec redis-enterprise /opt/redislabs/bin/rladmin cluster create \
# name docker-cluster username admin@redis.local password Redis123!
#
# Uncomment this block after v0.5.1 is released:
# redis-enterprise-init:
# image: joshrotenberg/redisctl:0.5.1
# container_name: redis-enterprise-init
# depends_on:
# redis-enterprise:
# condition: service_healthy
# networks:
# - redisctl-network
# environment:
# REDIS_ENTERPRISE_URL: "https://redis-enterprise:9443"
# REDIS_ENTERPRISE_INSECURE: "true"
# command:
# [
# "enterprise",
# "workflow",
# "init-cluster",
# "--name",
# "docker-cluster",
# "--username",
# "admin@redis.local",
# "--password",
# "Redis123!",
# ]

networks:
redisctl-network:
Expand Down
Loading