Skip to content

Commit

Permalink
fix: adds SSL_ENABLED flag to start scylla cluster in ssl only mode
Browse files Browse the repository at this point in the history
This adds SSL_ENABLED flag to Makefile, so that when you run
SSL_ENABLED=true make start-dev-env the scylla cluster will be created
with ssl_only config.
  • Loading branch information
VAveryanov8 committed Nov 15, 2024
1 parent 18103e0 commit c2e2bb1
Show file tree
Hide file tree
Showing 5 changed files with 662 additions and 26 deletions.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ SCYLLA_VERSION?=scylla:6.0.1
IP_FAMILY?=IPV4
RAFT_SCHEMA?=none
TABLETS?=enabled
# if true starts the scylla cluster with ssl only config
SSL_ENABLED?=false

MANAGER_CONFIG := testing/scylla-manager/scylla-manager.yaml
PUBLIC_NET := 192.168.200.
Expand Down Expand Up @@ -171,7 +173,7 @@ start-dev-env: .testing-up deploy-agent build-cli

.PHONY: .testing-up
.testing-up:
@IPV6=$(IPV6) SCYLLA_VERSION=$(SCYLLA_VERSION) RAFT_SCHEMA=$(RAFT_SCHEMA) TABLETS=$(TABLETS) make -C testing build down up
@IPV6=$(IPV6) SCYLLA_VERSION=$(SCYLLA_VERSION) RAFT_SCHEMA=$(RAFT_SCHEMA) TABLETS=$(TABLETS) SSL_ENABLED=$(SSL_ENABLED) make -C testing build down up

.PHONY: dev-env-status
dev-env-status: ## Checks status of docker containers and cluster nodes
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ for IPv6 environment:
IPV6=true make start-dev-env
```

for SSL scylla cluster:
```bash
SSL_ENABLED=true make start-dev-env
```

This command will:
1. Build custom Scylla Docker image (testing/scylla)
2. Compile server, agent and sctool binaries
Expand Down
10 changes: 10 additions & 0 deletions testing/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,15 @@ up:
@echo "==> Generating encryption files"
@cd scylla/certs && ./generate.sh
@echo "==> Generating Scylla configuration"

ifeq ($(SSL_ENABLED),true)
@cp scylla/config/scylla-ssl.yaml scylla/scylla.yaml
@cp scylla/config/cqlshrc-ssl scylla/cqlshrc
else
@cp scylla/config/scylla.yaml scylla/scylla.yaml
@cp scylla/config/cqlshrc scylla/cqlshrc
endif

ifeq ($(RAFT_SCHEMA),enabled)
@$(YQ) write -i scylla/scylla.yaml 'consistent_cluster_management' true
endif
Expand Down Expand Up @@ -108,6 +115,9 @@ endif
@until [ 1 -le $$($(SM_NODETOOL) status | grep -c "UN") ]; do echo -n "."; sleep 2; done ; echo ""

@./nodes_exec "rm /root/.cqlshrc || true"
@./nodes_exec "mkdir -p /root/.cassandra"
@./nodes_cp "scylla/cqlshrc" "/root/.cassandra/cqlshrc"

@echo "==> Adding Minio user"
./minio/add_user.sh || true
@echo "==> Initialising cluster"
Expand Down
24 changes: 0 additions & 24 deletions testing/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ services:
- type: bind
source: ./scylla/certs/
target: /etc/scylla/certs
- type: bind
source: ./scylla/cqlshrc
target: /root/.cassandra/cqlshrc
networks:
public:
second:
Expand All @@ -32,9 +29,6 @@ services:
- type: bind
source: ./scylla/certs/
target: /etc/scylla/certs
- type: bind
source: ./scylla/cqlshrc
target: /root/.cassandra/cqlshrc
networks:
public:
second:
Expand All @@ -52,9 +46,6 @@ services:
- type: bind
source: ./scylla/certs/
target: /etc/scylla/certs/
- type: bind
source: ./scylla/cqlshrc
target: /root/.cassandra/cqlshrc
networks:
public:
second:
Expand All @@ -72,9 +63,6 @@ services:
- type: bind
source: ./scylla/certs/
target: /etc/scylla/certs
- type: bind
source: ./scylla/cqlshrc
target: /root/.cassandra/cqlshrc
networks:
public:
second:
Expand All @@ -92,9 +80,6 @@ services:
- type: bind
source: ./scylla/certs/
target: /etc/scylla/certs
- type: bind
source: ./scylla/cqlshrc
target: /root/.cassandra/cqlshrc
networks:
public:
second:
Expand All @@ -112,9 +97,6 @@ services:
- type: bind
source: ./scylla/certs/
target: /etc/scylla/certs
- type: bind
source: ./scylla/cqlshrc
target: /root/.cassandra/cqlshrc
networks:
public:
second:
Expand All @@ -132,9 +114,6 @@ services:
- type: bind
source: ./scylla/certs/
target: /etc/scylla/certs
- type: bind
source: ./scylla/cqlshrc
target: /root/.cassandra/cqlshrc
networks:
public:
second:
Expand All @@ -152,9 +131,6 @@ services:
- type: bind
source: ./scylla/certs/
target: /etc/scylla/certs
- type: bind
source: ./scylla/cqlshrc
target: /root/.cassandra/cqlshrc
networks:
public:
second:
Expand Down
Loading

0 comments on commit c2e2bb1

Please sign in to comment.