|
3 | 3 | Read [Talos Kubernetes on Proxmox using OpenTofu](https://blog.stonegarden.dev/articles/2024/08/talos-proxmox-tofu/) for |
4 | 4 | a more thorough explanation of how everything works. |
5 | 5 |
|
6 | | -## Install pre-requisites |
| 6 | +## Install pre-requisites - Pre-installed in devContainer |
7 | 7 |
|
8 | 8 | 1. [tofu](https://opentofu.org/docs/intro/install/) |
9 | 9 | 2. [talosctl](https://www.talos.dev/v1.9/talos-guides/install/talosctl/) |
10 | 10 | 3. [kubectl](https://kubernetes.io/docs/tasks/tools/#kubectl) |
11 | 11 |
|
12 | 12 | ## Initialize tofu |
13 | 13 |
|
14 | | -```shell |
15 | | -tofu init |
16 | | -``` |
17 | | - |
18 | | -## Proxmox |
19 | | - |
20 | | -### Environment variable |
21 | | - |
22 | | -```shell |
23 | | -export TF_VAR_proxmox_api_token="<YOUR_API_TOKEN>" |
24 | | -``` |
25 | | - |
26 | | -### Optional External Secrets Manager / Other methods |
| 14 | +One cluster/state per branch. |
27 | 15 |
|
28 | | -**Bitwarden Secrets Manager** - Name your secret TF_VAR_proxmox_api_token in bws. |
29 | | - |
30 | | -```shell |
31 | | -bws run -- tofu ... |
32 | | -``` |
33 | | - |
34 | | -Note: By default, the shell is sh. Change with --shell if required. |
| 16 | +1. Setup and initialize [remote backend](BACKEND.md). |
| 17 | +1. Keep the environment populated with [required secrets](BACKEND.md) when running `tofu plan/apply`. |
35 | 18 |
|
36 | 19 | ## Sealed-secrets |
37 | 20 |
|
@@ -59,32 +42,12 @@ tofu output -raw talos_config |
59 | 42 |
|
60 | 43 | ## Upgrading Talos and Kubernetes |
61 | 44 |
|
62 | | -[Upgrade](https://blog.stonegarden.dev/articles/2024/08/talos-proxmox-tofu/#upgrading-the-cluster) talos nodes one by |
63 | | -one. |
64 | | - |
65 | | -1. Set talos_image.auto.tfvars -> image -> update_version to the required update version. |
66 | | -2. Set talos_cluster.auto.tfvars -> talos_cluster_config -> kubernetes_version to the required kubernetes version. |
67 | | -3. Set talos_nodes.auto.tfvars -> talos_nodes -> $node_1 -> update = true and run tofu apply. |
68 | | -4. Set talos_nodes.auto.tfvars -> talos_nodes -> $node_2 -> update = true, leave the previous nodes update = true and |
69 | | - run tofu apply. |
70 | | -5. Set talos_nodes.auto.tfvars -> talos_nodes -> $node_3 -> update = true, leave the previous nodes update = true and |
71 | | - run tofu apply. |
72 | | -6. ... |
73 | | -7. Set talos_nodes.auto.tfvars -> talos_nodes -> $node_n -> update = true, leave the previous nodes update = true and |
74 | | - run tofu apply. |
75 | | -8. After upgrading all nodes, Set talos_image.auto.tfvars -> image -> version to match the update version and set |
76 | | - update = false for all nodes. |
77 | | - |
78 | | -## Upgrading Talos Schematic |
79 | | - |
80 | | -1. Create a new schematic file. |
81 | | -2. Same process as above instead of `image.version` and `image.update_version`, change `image.schematic` and |
82 | | - `image.update_schematic`, in `talos_image.auto.tfvars`. |
| 45 | +Follow these [instructions](UPGRADE.md). |
83 | 46 |
|
84 | 47 | ## Reuse machine secrets |
85 | 48 |
|
86 | 49 | ```shell |
87 | 50 | tofu state rm module.talos.talos_machine_secrets.this |
88 | 51 | tofu import module.talos.talos_machine_secrets.this output/talos-machine-secrets.yaml |
89 | 52 | tofu apply --refresh=false |
90 | | -``` |
| 53 | +``` |
0 commit comments