Skip to content

Commit c911cb8

Browse files
fix: init-cluster workflow authentication and docker-compose setup (#314)
* fix: remove non-existent workflow command from docker-compose.yml The workflow commands are not yet implemented in the CLI (they're commented out). Updated docker-compose.yml to remove the auto-init container and added manual initialization instructions instead. * fix: use v0.5.0 tag instead of latest in docker-compose.yml The workflow init-cluster command IS implemented and working. The issue was using :latest tag which might not have the latest code. Using explicit v0.5.0 tag ensures the workflow command is available. * fix: init-cluster workflow to work without authentication for bootstrap - Bootstrap API doesn't require authentication initially - Modified init-cluster workflow to create unauthenticated client for bootstrap - Added ARM64 Redis Enterprise image requirement to CLAUDE.md - Fixed docker-compose.yml to build from local Dockerfile for testing - Verified workflow successfully initializes cluster with admin user and database * fix: disable init container until v0.5.1 release The init-cluster workflow fix for unauthenticated bootstrap is not in v0.5.0, so the docker-compose workflow won't work until the next release. Commented out the init container with instructions for manual initialization and notes to re-enable after v0.5.1 is published.
1 parent ccb11b6 commit c911cb8

File tree

3 files changed

+47
-30
lines changed

3 files changed

+47
-30
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Multi-stage build for minimal final image
2-
FROM rust:1.89-alpine as builder
2+
FROM rust:1.89-alpine AS builder
33

44
# Install build dependencies
55
RUN apk add --no-cache musl-dev openssl-dev openssl-libs-static pkgconfig

crates/redisctl/src/workflows/enterprise/init_cluster.rs

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,22 @@ impl Workflow for InitClusterWorkflow {
6262
.unwrap_or_else(|| "default-db".to_string());
6363
let db_memory_gb = args.get_i64("database_memory_gb").unwrap_or(1);
6464

65-
// Create client
66-
let client = context
67-
.conn_mgr
68-
.create_enterprise_client(context.profile_name.as_deref())
69-
.await
70-
.context("Failed to create Enterprise client")?;
65+
// Create unauthenticated client for bootstrap operations
66+
// Bootstrap doesn't require auth, but we need the URL from the environment/profile
67+
let base_url = std::env::var("REDIS_ENTERPRISE_URL")
68+
.unwrap_or_else(|_| "https://localhost:9443".to_string());
69+
let insecure = std::env::var("REDIS_ENTERPRISE_INSECURE")
70+
.unwrap_or_else(|_| "false".to_string())
71+
.parse::<bool>()
72+
.unwrap_or(false);
73+
74+
let client = redis_enterprise::EnterpriseClient::builder()
75+
.base_url(base_url)
76+
.username("") // Bootstrap doesn't require auth
77+
.password("") // Bootstrap doesn't require auth
78+
.insecure(insecure)
79+
.build()
80+
.context("Failed to create Enterprise client for bootstrap")?;
7181

7282
// Step 1: Check if cluster is already initialized
7383
let needs_bootstrap = check_if_needs_bootstrap(&client).await?;

docker-compose.yml

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -21,29 +21,36 @@ services:
2121
start_period: 10s
2222

2323
# Auto-initialize Redis Enterprise cluster using our workflow
24-
redis-enterprise-init:
25-
image: joshrotenberg/redisctl:latest
26-
container_name: redis-enterprise-init
27-
depends_on:
28-
redis-enterprise:
29-
condition: service_healthy
30-
networks:
31-
- redisctl-network
32-
environment:
33-
REDIS_ENTERPRISE_URL: "https://redis-enterprise:9443"
34-
REDIS_ENTERPRISE_INSECURE: "true"
35-
command:
36-
[
37-
"enterprise",
38-
"workflow",
39-
"init-cluster",
40-
"--name",
41-
"docker-cluster",
42-
"--username",
43-
44-
"--password",
45-
"Redis123!",
46-
]
24+
# DISABLED UNTIL v0.5.1: The init-cluster workflow requires unauthenticated bootstrap fix
25+
# which is not in v0.5.0. For now, manually initialize the cluster:
26+
#
27+
# docker exec redis-enterprise /opt/redislabs/bin/rladmin cluster create \
28+
# name docker-cluster username [email protected] password Redis123!
29+
#
30+
# Uncomment this block after v0.5.1 is released:
31+
# redis-enterprise-init:
32+
# image: joshrotenberg/redisctl:0.5.1
33+
# container_name: redis-enterprise-init
34+
# depends_on:
35+
# redis-enterprise:
36+
# condition: service_healthy
37+
# networks:
38+
# - redisctl-network
39+
# environment:
40+
# REDIS_ENTERPRISE_URL: "https://redis-enterprise:9443"
41+
# REDIS_ENTERPRISE_INSECURE: "true"
42+
# command:
43+
# [
44+
# "enterprise",
45+
# "workflow",
46+
# "init-cluster",
47+
# "--name",
48+
# "docker-cluster",
49+
# "--username",
50+
51+
# "--password",
52+
# "Redis123!",
53+
# ]
4754

4855
networks:
4956
redisctl-network:

0 commit comments

Comments
 (0)