docs: digital rebar docs

Digital rebar docs in the guide section.

Signed-off-by: Patatman <git@jeursen.nl>
This commit is contained in:
Patatman 2020-06-16 18:17:39 +02:00 committed by talos-bot
parent 686dcc6743
commit 90acb01a4e
9 changed files with 313 additions and 0 deletions

View File

@ -76,6 +76,10 @@
"title": "Arges",
"path": "v0.6/en/guides/metal/arges"
},
{
"title": "Digital Rebar",
"path": "v0.6/en/guides/metal/digitalrebar"
},
{
"title": "Matchbox",
"path": "v0.6/en/guides/metal/matchbox"

View File

@ -0,0 +1,158 @@
---
title: "Digital Rebar"
---
## Prerequisites
- 3 nodes (please see [hardware requirements](https://www.talos.dev/docs/v0.6/en/guides/getting-started#system-requirements))
- Loadbalancer
- Digital Rebar Server
- Talosctl access (see [talosctl setup](https://www.talos.dev/docs/v0.6/en/guides/getting-started/talosctl))
## Creating a Cluster
In this guide we will create an Kubernetes cluster with 1 worker node, and 2 controlplane nodes.
We assume an existing digital rebar deployment, and some familiarity with iPXE.
We leave it up to the user to decide if they would like to use static networking, or DHCP.
The setup and configuration of DHCP will not be covered.
### Create the Machine Configuration Files
#### Generating Base Configurations
Using the DNS name of the load balancer, generate the base configuration files for the Talos machines:
```bash
$ talosctl gen config talos-k8s-metal-tutorial https://<load balancer IP or DNS>:<port>
created init.yaml
created controlplane.yaml
created join.yaml
created talosconfig
```
>The loadbalancer is used to distribute the load across multiple controlplane nodes.
>This isn't covered in detail, because we asume some loadbalancing knowledge before hand.
>If you think this should be added to the docs, please [create a issue](https://github.com/talos-systems/talos/issues).
At this point, you can modify the generated configs to your liking.
#### Validate the Configuration Files
```bash
$ talosctl validate --config init.yaml --mode metal
init.yaml is valid for metal mode
$ talosctl validate --config controlplane.yaml --mode metal
controlplane.yaml is valid for metal mode
$ talosctl validate --config join.yaml --mode metal
join.yaml is valid for metal mode
```
#### Publishing the Machine Configuration Files
Digital Rebar has a build-in fileserver, which means we can use this feature to expose the talos configuration files.
We will place `init.yaml`, `controlplane.yaml`, and `worker.yaml` into Digital Rebar file server by using the `drpcli` tools.
Copy the generated files from the step above into your Digital Rebar installation.
```bash
drpcli file upload <file>.yaml as <file>.yaml
```
Replacing `<file>` with init, controlplane or worker.
### Download the boot files
Download a recent version of `boot.tar.gz` from [github.](https://github.com/talos-systems/talos/releases/)
Upload to DRB:
```bash
$ drpcli isos upload boot.tar.gz as talos-0.6.tar.gz
{
"Path": "talos-0.6.tar.gz",
"Size": 96470072
}
```
We have some Digital Rebar [example files](https://github.com/talos-systems/talos/tree/master/hack/test/digitalrebar/) in the Git repo you can use to provision Digital Rebar with drpcli.
To apply these configs you need to create them, and then apply them as follow:
```bash
$ drpcli bootenvs create talos-0.6
{
"Available": true,
"BootParams": "",
"Bundle": "",
"Description": "",
"Documentation": "",
"Endpoint": "",
"Errors": [],
"Initrds": [],
"Kernel": "",
"Meta": {},
"Name": "talos-0.6",
"OS": {
"Codename": "",
"Family": "",
"IsoFile": "",
"IsoSha256": "",
"IsoUrl": "",
"Name": "",
"SupportedArchitectures": {},
"Version": ""
},
"OnlyUnknown": false,
"OptionalParams": [],
"ReadOnly": false,
"RequiredParams": [],
"Templates": [],
"Validated": true
}
```
```bash
drpcli bootenvs update talos-0.6 - < bootenv.yaml
```
> You need to do this for all files in the example directory.
> If you don't have access to the `drpcli` tools you can also use the webinterface.
It's important to have a corresponding SHA256 hash matching the boot.tar.gz
#### Bootenv BootParams
We're using some of Digital Rebar build in templating to make sure the machine gets the correct role assigned.
`talos.platform=metal talos.config={{ .ProvisionerURL }}/files/{{.Param \"talos/role\"}}.yaml"`
This is why we also include a `params.yaml` in the example directory to make sure the role is set to one of the following:
- controlplane
- init
- worker
The `{{.Param \"talos/role\"}}` then gets populated with one of the above roles.
### Boot the Machines
In the UI of Digital Rebar you need to select the machines you want te provision.
Once selected, you need to assign to following:
- Profile
- Workflow
This will provision the Stage and Bootenv with the talos values.
Once this is done, you can boot the machine.
To understand the boot process, we have a higher level overview located at [metal overview.](https://www.talos.dev/docs/v0.6/en/guides/metal/overview)
### Retrieve the `kubeconfig`
Once everything is running we can retrieve the admin `kubeconfig` by running:
```bash
talosctl --talosconfig talosconfig config endpoint <control plane 1 IP>
talosctl --talosconfig talosconfig kubeconfig .
```

View File

@ -0,0 +1,52 @@
Validated: true
Available: true
Errors: []
ReadOnly: false
Meta:
color: "yellow"
feature-flags: "change-stage-v2"
icon: "linux"
title: "Talos"
Endpoint: ""
Bundle: ""
Name: "talos-0.6"
Description: "talos-0.6"
Documentation: ""
OS:
Name: "talos-0.6"
Family: "talos"
Codename: ""
Version: "0.6"
IsoFile: "talos-0.6.tar.gz"
IsoSha256: "401ec26cef179e0a66d44f020dad47f7322f4cfc84826242e9c83d6cce4f2547"
IsoUrl: "https://github.com/talos-systems/talos/releases/download/v0.6.0/boot.tar.gz"
SupportedArchitectures: {}
Templates:
- Name: "pxelinux"
Path: "pxelinux.cfg/{{.Machine.HexAddress}}"
ID: "default-pxelinux.tmpl"
Contents: ""
Meta: {}
- Name: "ipxe"
Path: "{{.Machine.Address}}.ipxe"
ID: "default-ipxe.tmpl"
Contents: ""
Meta: {}
- Name: "pxelinux-mac"
Path: "pxelinux.cfg/{{.Machine.MacAddr \"pxelinux\"}}"
ID: "default-pxelinux.tmpl"
Contents: ""
Meta: {}
- Name: "ipxe-mac"
Path: "{{.Machine.MacAddr \"ipxe\"}}.ipxe"
ID: "default-ipxe.tmpl"
Contents: ""
Meta: {}
Kernel: "vmlinuz"
Initrds:
- "initramfs.xz"
BootParams: "console=tty0 ip=dhcp modules=loop,squashfs nomodeset page_poison=1 slab_nomerge slub_debug=P pti=on ima_template=ima-ng ima_appraise=fix ima_hash=sha512 talos.platform=metal talos.config={{ .ProvisionerURL }}/files/{{.Param \"talos/role\"}}.yaml"
RequiredParams: []
OptionalParams:
- "talos/role"
OnlyUnknown: false

View File

@ -0,0 +1,16 @@
Validated: true
Available: true
Errors: []
ReadOnly: false
Meta:
color: "black"
icon: "tags"
title: "Talos role"
Endpoint: ""
Bundle: ""
Name: "talos/role"
Description: "Role of node"
Documentation: ""
Secure: false
Schema:
type: "string"

View File

@ -0,0 +1,23 @@
Validated: true
Available: true
Errors: []
ReadOnly: false
Meta:
color: "yellow"
icon: "spinner"
title: "talos"
Endpoint: ""
Bundle: ""
Name: "Talos"
Description: "Talos"
Documentation: ""
Templates: []
RequiredParams:
- "talos/role"
OptionalParams: []
Params: {}
BootEnv: "talos-0.6"
Tasks: []
Profiles: []
Reboot: false
RunnerWait: true

View File

@ -0,0 +1,15 @@
Validated: true
Available: true
Errors: []
ReadOnly: false
Meta:
color: "black"
icon: "tags"
title: "Talos-controlplane"
Endpoint: ""
Bundle: ""
Name: "talos-controlplane"
Description: "Talos controlplane"
Documentation: ""
Params:
talos/role: "controlplane"

View File

@ -0,0 +1,15 @@
Validated: true
Available: true
Errors: []
ReadOnly: false
Meta:
color: "black"
icon: "tags"
title: "Talos-init"
Endpoint: ""
Bundle: ""
Name: "talos-init"
Description: "Talos init"
Documentation: ""
Params:
talos/role: "init"

View File

@ -0,0 +1,15 @@
Validated: true
Available: true
Errors: []
ReadOnly: false
Meta:
color: "black"
icon: "tags"
title: "Talos-worker"
Endpoint: ""
Bundle: ""
Name: "talos-worker"
Description: "Talos worker"
Documentation: ""
Params:
talos/role: "worker"

View File

@ -0,0 +1,15 @@
Validated: true
Available: true
Errors: []
ReadOnly: false
Meta:
color: "Yellow"
icon: "linux"
title: "Talos"
Endpoint: ""
Bundle: ""
Name: "Talos"
Description: "Talos"
Documentation: ""
Stages:
- "Talos"