Skip to content

Commit

Permalink
Merge pull request #7 from GlueOps/feature/configure-node-machine-id
Browse files Browse the repository at this point in the history
Feature/configure node machine
  • Loading branch information
fernandoataoldotcom authored May 15, 2024
2 parents 4388707 + 094b4e7 commit c682f84
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,39 @@
# k3d

## Requirements

## Requirements:
### You need a Server/VM

### You need a Server/VM:
- Option #1 - A cloud server that is either debian/ubuntu. You can use [AWS](https://cde.glueops.dev) or [Hetzner](https://www.hetzner.com/) or any other cloud. It's recommended you have at least 16GB of RAM but 32-64GB would be optimal.
- Option #2 - Proxmox. (Recommended)

### Getting setup

- Login to your server using whatever method you like (SSH or password is fine) but you must login with a root or a user that has sudo access.
- Run:

```bash
#If you are using proxmox you will not be able to do copy/paste in the web ssh console.
bash <(curl -sL setup.glueops.dev)
```

- Once you finish following the prompts and the server reboots, you will need to connect to it using your private ssh key with the `glueops` username. If you are using proxmox the username is `root` and you will need to switch to `glueops` using: `su - glueops`
- Once logged in as the `glueops` user, type `cd` so that you are in `/home/glueops` and then just run `dev` and select the version you want (newest is recommended) and go ahead and get started to get a code tunnel/space going.



### Creating your cluster.
### Creating your cluster

- `cd` into your _captain_ directory
- Run:

```bash
curl https://raw.githubusercontent.com/GlueOps/k3d/main/k3d-config.yaml -o k3d-config.yaml && k3d cluster create --config k3d-config.yaml
curl https://raw.githubusercontent.com/GlueOps/k3d/main/k3d-config.yaml -o k3d-config.yaml && k3d cluster create --config k3d-config.yaml && bash <(curl -sL https://raw.githubusercontent.com/GlueOps/k3d/main/add-machineid.sh)
```

- Using our **lightsail AWS account** run this from a cloudshell session:

```bash
bash <(curl -s https://raw.githubusercontent.com/GlueOps/development-only-utilities/main/tools/aws/lightsail.sh)
```

- Take the output from the lightsail creation and run it against your k3s cluster.
- Continue with the rest of the docs in your captain README.md
12 changes: 12 additions & 0 deletions add-machineid.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

# k3d nodes don't have machine id and it must be added
containers=$(docker ps --filter "name=k3d" --format "{{.Names}}")

for container in $containers; do
echo "Setting /etc/machine-id for $container..."
unique_id=$(openssl rand -hex 16)
docker exec $container sh -c "echo $unique_id > /etc/machine-id"
done

echo "Done."

0 comments on commit c682f84

Please sign in to comment.