-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from GlueOps/feature/configure-node-machine-id
Feature/configure node machine
- Loading branch information
Showing
2 changed files
with
23 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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." |