Skip to content
Open
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
29 changes: 1 addition & 28 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,11 @@ jobs:
-var \"storage_nodes_instance_type=m6i.2xlarge\" \
-var \"sec_storage_nodes_instance_type=m6i.2xlarge\" \
-var \"sec_storage_nodes=0\" \
-var \"extra_nodes=1\" \
-var \"extra_nodes_instance_type=m6id.xlarge\" \
-var \"extra_nodes_arch=amd64\" \
-var \"region=us-east-2\" \
-var \"sbcli_cmd=${{ github.event.inputs.sbcli_cmd || 'sbcli-dev' }}\""

if ${{ github.event.inputs.k8s-snode }}; then
TF_CMD="$TF_CMD -var \"snode_deploy_on_k8s=true\""
TF_CMD="$TF_CMD -var \"enable_eks=1\""
fi

TF_CMD="$TF_CMD -out=tfplan"
Expand All @@ -132,25 +129,6 @@ jobs:
env:
SBCLI_CMD: ${{ github.event.inputs.sbcli_cmd || 'sbcli-dev' }}

- name: Bootstrap K3s
run: |
CMD="$GITHUB_WORKSPACE/aws/bootstrap-k3s.sh"
if ${{ github.event.inputs.k8s-snode }}; then
CMD="$CMD --k8s-snode"
fi
echo "Running: $CMD"
eval $CMD
id: bootstrap_k3s

- name: copying Kubeconfig file
run: |
mkdir -p ${HOME}/.kube
scp -o StrictHostKeyChecking=no -i ${{ steps.bootstrap_k3s.outputs.KEY }} ec2-user@${{ steps.bootstrap_k3s.outputs.extra_node_ip }}:/etc/rancher/k3s/k3s.yaml ${HOME}/.kube/config

- name: update .kube/config address
run: |
sed -i "s/127.0.0.1/${{ steps.bootstrap_k3s.outputs.extra_node_ip }}/g" ${HOME}/.kube/config

- name: Checkout code
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -186,11 +164,6 @@ jobs:
chmod +x config-apply.sh
./config-apply.sh

- name: Reboot Workers
if: ${{ github.event.inputs.k8s-snode == 'true' }}
run: |
$GITHUB_WORKSPACE/aws/reboot-worker.sh

- name: Install SIMPLYBLK-CONTROLLER using Helm
if: ${{ github.event.inputs.k8s-snode == 'true' }}
run: |
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
### Introduction

Simplyblock storage solution can be deployed to multiple environments. This repo hosts code to automatically deploy
the setup in AWS and bare metal

### AWS Deployment


29 changes: 0 additions & 29 deletions aws/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ Follow the installation instructions for AWS CLI based on your operating system:

After installing AWS CLI, configure it with your AWS credentials by running the `aws configure` command and providing your Access Key ID, Secret Access Key, region, and output format.

# Intro

Terraform template to set up a simple cluster.

# Deploy Infrastructure

## Change Node Counts
Expand Down Expand Up @@ -62,12 +58,6 @@ terraform plan

## Apply Configurations

### Basic Deployment

```bash
terraform apply -var mgmt_nodes=1 -var storage_nodes=3 --auto-approve
```

### Deploying with EKS

```bash
Expand All @@ -80,26 +70,13 @@ terraform apply -var mgmt_nodes=1 -var storage_nodes=3 -var enable_eks=1 --auto-
terraform apply -var mgmt_nodes=1 -var storage_nodes=3 -var az=us-east-2b --auto-approve
```

### Specifying the Arch type to Deploy

```bash
terraform apply -var mgmt_nodes=1 -var storage_nodes=3 -var extra_nodes_arch=arm64 \
-var extra_nodes_instance_type="m6gd.xlarge" --auto-approve
```

### Specifying Instance Types

```bash
terraform apply -var mgmt_nodes=1 -var storage_nodes=3 \
-var mgmt_nodes_instance_type="m5.large" -var storage_nodes_instance_type="m5.large" --auto-approve
```

### Specifying the Number of EBS Volumes

```bash
terraform apply -var mgmt_nodes=1 -var storage_nodes=3 -var volumes_per_storage_nodes=2 --auto-approve
```

### Specifying the Size of EBS Volumes

```bash
Expand Down Expand Up @@ -172,12 +149,6 @@ chmod +x ./bootstrap-cluster.sh

### Deploy Storage-node to K8s

#### Set Terraform variable snode_deploy_on_k8s to true

```bash
terraform apply -var mgmt_nodes=1 -var storage_nodes=3 -var snode_deploy_on_k8s="true" --auto-approve
```

#### Set cluster argument --k8s-snode

```bash
Expand Down
52 changes: 15 additions & 37 deletions aws/bootstrap-cluster.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
set -euo pipefail

KEY="$HOME/.ssh/simplyblock-ohio.pem"
KEY="${KEY:-$HOME/.ssh/id_ed25519}"

print_help() {
echo "Usage: $0 [options]"
Expand Down Expand Up @@ -32,6 +32,8 @@ print_help() {
echo " --disable-ha-jm Disable HA JM for distrib creation (optional)"
echo " --data-nics Set Storage network interface name(s). Can be more than one. (optional)"
echo " --id-device-by-nqn Use device nqn to identify it instead of serial number. (optional)"
echo " --max-lvol Set Maximum lvols (optional)"
echo " --number-of-devices <value> Set number of devices (optional)"
echo " --help Print this help message"
exit 0
}
Expand Down Expand Up @@ -70,6 +72,14 @@ HA_JM_COUNT=""
while [[ $# -gt 0 ]]; do
arg="$1"
case $arg in
--max-lvol)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This parameter is required during sn configure which is done as part of terraform setup

MAX_LVOL="$2"
shift
;;
--number-of-devices)
NO_DEVICE="$2"
shift
;;
--max-snap)
MAX_SNAPSHOT="$2"
shift
Expand Down Expand Up @@ -184,37 +194,14 @@ while [[ $# -gt 0 ]]; do
shift
done

SECRET_VALUE=$(terraform output -raw secret_value)
KEY_NAME=$(terraform output -raw key_name)
echo "reading terraform outputs..."
BASTION_IP=$(terraform output -raw bastion_public_ip)
GRAFANA_ENDPOINT=$(terraform output -raw grafana_invoke_url)

ssh_dir="$HOME/.ssh"

if [ ! -d "$ssh_dir" ]; then
mkdir -p "$ssh_dir"
echo "Directory $ssh_dir created."
else
echo "Directory $ssh_dir already exists."
fi

if [[ -n "$SECRET_VALUE" ]]; then
KEY="$HOME/.ssh/$KEY_NAME"
if [ -f "$HOME/.ssh/$KEY_NAME" ]; then
echo "the ssh key: ${KEY} already exits on local"
else
echo "$SECRET_VALUE" >"$KEY"
chmod 400 "$KEY"
fi
else
echo "Failed to retrieve secret value. Falling back to default key."
fi

mnodes=$(terraform output -raw mgmt_private_ips)
storage_private_ips=$(terraform output -raw storage_private_ips)

echo "mgmt_private_ips: ${mnodes}"
IFS=' ' read -ra mnodes <<<"$mnodes"
storage_private_ips=$(terraform output -raw storage_private_ips)
sec_storage_private_ips=$(terraform output -raw sec_storage_private_ips)

echo "bootstrapping cluster..."

Expand All @@ -241,7 +228,7 @@ echo ""
echo "Deploying management node..."
echo ""

command="sudo docker swarm leave --force ; ${SBCLI_CMD} --dev -d cluster create"
command="${SBCLI_CMD} --dev -d cluster create"
if [[ -n "$LOG_DEL_INTERVAL" ]]; then
command+=" --log-del-interval $LOG_DEL_INTERVAL"
fi
Expand Down Expand Up @@ -400,15 +387,6 @@ else
echo "add node command: \${add_node_command}"
\$add_node_command
sleep 3
done

for node in ${sec_storage_private_ips}; do
echo ""
echo "joining secondary node \${node}"
add_node_command=\"${command} --is-secondary-node ${CLUSTER_ID} \${node}:5000 eth0\"
echo "add node command: \${add_node_command}"
\$add_node_command
sleep 3
done"

echo ""
Expand Down
4 changes: 0 additions & 4 deletions aws/data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ data "aws_availability_zones" "available" {
state = "available"
}

data "aws_secretsmanager_secret_version" "simply" {
secret_id = local.selected_key_name
}

data "aws_ami" "rhel9" {
most_recent = true
owners = ["309956199498"] # Red Hat
Expand Down
4 changes: 0 additions & 4 deletions aws/dev.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ region = "us-east-1"
sbcli_cmd = "sbcli-dev"
mgmt_nodes = 1
storage_nodes = 3
extra_nodes = 0
mgmt_nodes_instance_type = "m5.large"
storage_nodes_instance_type = "m5.large"
extra_nodes_instance_type = "m6id.large"
volumes_per_storage_nodes = 1
enable_apigateway = 0
env = "dev"
23 changes: 0 additions & 23 deletions aws/efs.tf

This file was deleted.

Loading