forked from tinkerbell/playground
-
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.
This gets the Tinkerbell Sandbox up and running with Terraform on Equinix Metal. Signed-off-by: Jacob Weinstock <[email protected]>
- Loading branch information
1 parent
d6af9a4
commit afc878a
Showing
14 changed files
with
362 additions
and
200 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
This file was deleted.
Oops, something went wrong.
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,47 @@ | ||
# Quick-Starts | ||
|
||
The following quick-start guides will walk you through standing up the Tinkerbell stack. | ||
There are a few options for this. | ||
Pick the one that works best for you. | ||
|
||
## Options | ||
|
||
- [Vagrant and VirtualBox](docs/quickstarts/VAGRANTVBOX.md) | ||
- [Vagrant and Libvirt](docs/quickstarts/VAGRANTLVIRT.md) | ||
- [Docker Compose](docs/quickstarts/COMPOSE.md) | ||
- [Terraform and Equinix Metal](docs/quickstarts/TERRAFORMEM.md) | ||
- [Kubernetes](docs/quickstarts/KUBERNETES.md) | ||
- [Multipass](docs/quickstarts/MULTIPASS.md) | ||
|
||
## Next Steps | ||
|
||
Now that you have a Tinkerbell stack up and running, you can start provisioning machines. | ||
Tinkerbell.org has a [list of guides](https://docs.tinkerbell.org/deploying-operating-systems/the-deployment/) for provisioning machines. | ||
You can also create your own. | ||
The following docs will help you get started. | ||
|
||
1. [Create Hardware Data](https://docs.tinkerbell.org/setup/local-vagrant/#creating-the-workers-hardware-data) | ||
2. [Create a Template](https://docs.tinkerbell.org/setup/local-vagrant/#creating-a-template) | ||
3. [Create a Workflow](https://docs.tinkerbell.org/setup/local-vagrant/#creating-the-workflow) | ||
|
||
### In the Sandbox | ||
|
||
1. Create your own templates | ||
|
||
```bash | ||
docker exec -i compose_tink-cli_1 tink template create < ./custom-template.yaml | ||
``` | ||
|
||
2. Upload any container images you want to use in the templates to the internal registry | ||
|
||
```bash | ||
docker run -it --rm quay.io/containers/skopeo copy --all --dest-tls-verify=false --dest-creds="admin":"Admin1234" docker://hello-world docker://192.168.50.4/hello-world | ||
``` | ||
|
||
3. Create a workflow | ||
|
||
```bash | ||
docker exec -i compose_tink-cli_1 tink workflow create -t <TEMPLATE ID> -r '{"device_1":"08:00:27:00:00:01"}') | ||
``` | ||
|
||
4. Restart the machine to provision (if using the vagrant sandbox test machine this is done by running vagrant destroy -f machine1 && vagrant up machine1 |
16 changes: 8 additions & 8 deletions
16
deploy/terraform/hardware_data.tpl → ...ests/hardware/hardware-equinix-metal.json
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
91 changes: 91 additions & 0 deletions
91
deploy/compose/manifests/template/ubuntu-equinix-metal.yaml
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,91 @@ | ||
version: "0.1" | ||
name: debian_Focal | ||
global_timeout: 1800 | ||
tasks: | ||
- name: "os-installation" | ||
worker: "{{.device_1}}" | ||
volumes: | ||
- /dev:/dev | ||
- /dev/console:/dev/console | ||
- /lib/firmware:/lib/firmware:ro | ||
actions: | ||
- name: "stream-ubuntu-image" | ||
image: image2disk:v1.0.0 | ||
timeout: 600 | ||
environment: | ||
DEST_DISK: /dev/sda | ||
IMG_URL: "http://192.168.50.4:8080/focal-server-cloudimg-amd64.raw.gz" | ||
COMPRESSED: true | ||
- name: "grow-partition" | ||
image: cexec:v1.0.0 | ||
timeout: 90 | ||
environment: | ||
BLOCK_DEVICE: /dev/sda1 | ||
FS_TYPE: ext4 | ||
CHROOT: y | ||
DEFAULT_INTERPRETER: "/bin/sh -c" | ||
CMD_LINE: "growpart /dev/sda 1 && resize2fs /dev/sda1" | ||
- name: "fix-serial" | ||
image: cexec:v1.0.0 | ||
timeout: 90 | ||
pid: host | ||
environment: | ||
BLOCK_DEVICE: /dev/sda1 | ||
FS_TYPE: ext4 | ||
CHROOT: y | ||
DEFAULT_INTERPRETER: "/bin/sh -c" | ||
CMD_LINE: "sed -e 's|ttyS0|ttyS1,115200|g' -i /etc/default/grub.d/50-cloudimg-settings.cfg ; update-grub" | ||
- name: "install-openssl" | ||
image: cexec:v1.0.0 | ||
timeout: 90 | ||
environment: | ||
BLOCK_DEVICE: /dev/sda1 | ||
FS_TYPE: ext4 | ||
CHROOT: y | ||
DEFAULT_INTERPRETER: "/bin/sh -c" | ||
CMD_LINE: "apt -y update && apt -y install openssl" | ||
- name: "create-user" | ||
image: cexec:v1.0.0 | ||
timeout: 90 | ||
environment: | ||
BLOCK_DEVICE: /dev/sda1 | ||
FS_TYPE: ext4 | ||
CHROOT: y | ||
DEFAULT_INTERPRETER: "/bin/sh -c" | ||
CMD_LINE: "useradd -p $(openssl passwd -1 tink) -s /bin/bash -d /home/tink/ -m -G sudo tink" | ||
- name: "enable-ssh" | ||
image: cexec:v1.0.0 | ||
timeout: 90 | ||
environment: | ||
BLOCK_DEVICE: /dev/sda1 | ||
FS_TYPE: ext4 | ||
CHROOT: y | ||
DEFAULT_INTERPRETER: "/bin/sh -c" | ||
CMD_LINE: "ssh-keygen -A; systemctl enable ssh.service; sed -i 's/^PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config" | ||
- name: "disable-apparmor" | ||
image: cexec:v1.0.0 | ||
timeout: 90 | ||
environment: | ||
BLOCK_DEVICE: /dev/sda1 | ||
FS_TYPE: ext4 | ||
CHROOT: y | ||
DEFAULT_INTERPRETER: "/bin/sh -c" | ||
CMD_LINE: "systemctl disable apparmor; systemctl disable snapd" | ||
- name: "write-netplan" | ||
image: writefile:v1.0.0 | ||
timeout: 90 | ||
environment: | ||
DEST_DISK: /dev/sda1 | ||
FS_TYPE: ext4 | ||
DEST_PATH: /etc/netplan/config.yaml | ||
CONTENTS: | | ||
network: | ||
version: 2 | ||
renderer: networkd | ||
ethernets: | ||
enp1s0f0: | ||
dhcp4: true | ||
UID: 0 | ||
GID: 0 | ||
MODE: 0644 | ||
DIRMODE: 0755 |
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 |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
terraform.tfstate | ||
terraform.tfstate.backup | ||
terraform.tfvars | ||
.terraform.lock.hcl |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.