Skip to content

Commit

Permalink
feat: add an example for Talos on OCI
Browse files Browse the repository at this point in the history
adds example Terraform code and documentation to deploy Talos on Oracle Cloud

Signed-off-by: Andrey Smirnov <[email protected]>
Signed-off-by: Caleb Woodbine <[email protected]>
  • Loading branch information
BobyMCbobs authored and smira committed Sep 27, 2024
1 parent 1be5874 commit 9cd1e1c
Show file tree
Hide file tree
Showing 17 changed files with 1,055 additions and 9 deletions.
4 changes: 2 additions & 2 deletions examples/terraform/aws/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@
| <a name="input_ccm"></a> [ccm](#input\_ccm) | Whether to deploy aws cloud controller manager | `bool` | `false` | no |
| <a name="input_cluster_name"></a> [cluster\_name](#input\_cluster\_name) | Name of cluster | `string` | `"talos-aws-example"` | no |
| <a name="input_config_patch_files"></a> [config\_patch\_files](#input\_config\_patch\_files) | Path to talos config path files that applies to all nodes | `list(string)` | `[]` | no |
| <a name="input_control_plane"></a> [control\_plane](#input\_control\_plane) | Info for control plane that will be created | <pre>object({<br> instance_type = optional(string, "c5.large")<br> ami_id = optional(string, null)<br> num_instances = optional(number, 3)<br> config_patch_files = optional(list(string), [])<br> tags = optional(map(string), {})<br> })</pre> | `{}` | no |
| <a name="input_control_plane"></a> [control\_plane](#input\_control\_plane) | Info for control plane that will be created | <pre>object({<br/> instance_type = optional(string, "c5.large")<br/> ami_id = optional(string, null)<br/> num_instances = optional(number, 3)<br/> config_patch_files = optional(list(string), [])<br/> tags = optional(map(string), {})<br/> })</pre> | `{}` | no |
| <a name="input_extra_tags"></a> [extra\_tags](#input\_extra\_tags) | Extra tags to add to the cluster cloud resources | `map(string)` | `{}` | no |
| <a name="input_kubernetes_api_allowed_cidr"></a> [kubernetes\_api\_allowed\_cidr](#input\_kubernetes\_api\_allowed\_cidr) | The CIDR from which to allow to access the Kubernetes API | `string` | `"0.0.0.0/0"` | no |
| <a name="input_kubernetes_version"></a> [kubernetes\_version](#input\_kubernetes\_version) | Kubernetes version to use for the cluster, if not set the k8s version shipped with the talos sdk version will be used | `string` | `null` | no |
| <a name="input_talos_api_allowed_cidr"></a> [talos\_api\_allowed\_cidr](#input\_talos\_api\_allowed\_cidr) | The CIDR from which to allow to access the Talos API | `string` | `"0.0.0.0/0"` | no |
| <a name="input_talos_version_contract"></a> [talos\_version\_contract](#input\_talos\_version\_contract) | Talos API version to use for the cluster, if not set the the version shipped with the talos sdk version will be used | `string` | `null` | no |
| <a name="input_vpc_cidr"></a> [vpc\_cidr](#input\_vpc\_cidr) | The IPv4 CIDR block for the VPC. | `string` | `"172.16.0.0/16"` | no |
| <a name="input_worker_groups"></a> [worker\_groups](#input\_worker\_groups) | List of node worker node groups to create | <pre>list(object({<br> name = string<br> instance_type = optional(string, "c5.large")<br> ami_id = optional(string, null)<br> num_instances = optional(number, 1)<br> config_patch_files = optional(list(string), [])<br> tags = optional(map(string), {})<br> }))</pre> | <pre>[<br> {<br> "name": "default"<br> }<br>]</pre> | no |
| <a name="input_worker_groups"></a> [worker\_groups](#input\_worker\_groups) | List of node worker node groups to create | <pre>list(object({<br/> name = string<br/> instance_type = optional(string, "c5.large")<br/> ami_id = optional(string, null)<br/> num_instances = optional(number, 1)<br/> config_patch_files = optional(list(string), [])<br/> tags = optional(map(string), {})<br/> }))</pre> | <pre>[<br/> {<br/> "name": "default"<br/> }<br/>]</pre> | no |

## Outputs

Expand Down
4 changes: 2 additions & 2 deletions examples/terraform/azure/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,14 @@ Getting the kubeconfig and talosconfig for this cluster can be done with `terraf
| <a name="input_azure_location"></a> [azure\_location](#input\_azure\_location) | Azure location to use | `string` | `"West Europe"` | no |
| <a name="input_cluster_name"></a> [cluster\_name](#input\_cluster\_name) | Name of cluster | `string` | `"talos-azure-example"` | no |
| <a name="input_config_patch_files"></a> [config\_patch\_files](#input\_config\_patch\_files) | Path to talos config path files that applies to all nodes | `list(string)` | `[]` | no |
| <a name="input_control_plane"></a> [control\_plane](#input\_control\_plane) | Info for control plane that will be created | <pre>object({<br> vm_size = optional(string, "Standard_B2s")<br> vm_os_id = optional(string, "/subscriptions/7f739b7d-f399-4b97-9a9f-f1962309ee6e/resourceGroups/SideroGallery/providers/Microsoft.Compute/galleries/SideroLabs/images/talos-x64/versions/latest")<br> num_instances = optional(number, 3)<br> config_patch_files = optional(list(string), [])<br> tags = optional(map(string), {})<br> })</pre> | `{}` | no |
| <a name="input_control_plane"></a> [control\_plane](#input\_control\_plane) | Info for control plane that will be created | <pre>object({<br/> vm_size = optional(string, "Standard_B2s")<br/> vm_os_id = optional(string, "/subscriptions/7f739b7d-f399-4b97-9a9f-f1962309ee6e/resourceGroups/SideroGallery/providers/Microsoft.Compute/galleries/SideroLabs/images/talos-x64/versions/latest")<br/> num_instances = optional(number, 3)<br/> config_patch_files = optional(list(string), [])<br/> tags = optional(map(string), {})<br/> })</pre> | `{}` | no |
| <a name="input_extra_tags"></a> [extra\_tags](#input\_extra\_tags) | Extra tags to add to the cluster cloud resources | `map(string)` | `{}` | no |
| <a name="input_kubernetes_api_allowed_cidr"></a> [kubernetes\_api\_allowed\_cidr](#input\_kubernetes\_api\_allowed\_cidr) | The CIDR from which to allow to access the Kubernetes API | `string` | `"0.0.0.0/0"` | no |
| <a name="input_kubernetes_version"></a> [kubernetes\_version](#input\_kubernetes\_version) | Kubernetes version to use for the cluster, if not set the k8s version shipped with the talos sdk version will be used | `string` | `null` | no |
| <a name="input_talos_api_allowed_cidr"></a> [talos\_api\_allowed\_cidr](#input\_talos\_api\_allowed\_cidr) | The CIDR from which to allow to access the Talos API | `string` | `"0.0.0.0/0"` | no |
| <a name="input_talos_version_contract"></a> [talos\_version\_contract](#input\_talos\_version\_contract) | Talos API version to use for the cluster, if not set the the version shipped with the talos sdk version will be used | `string` | `null` | no |
| <a name="input_vnet_cidr"></a> [vnet\_cidr](#input\_vnet\_cidr) | The IPv4 CIDR block for the Virtual Network. | `string` | `"172.16.0.0/16"` | no |
| <a name="input_worker_groups"></a> [worker\_groups](#input\_worker\_groups) | List of node worker node groups to create | <pre>list(object({<br> name = string<br> vm_size = optional(string, "Standard_B2s")<br> vm_os_id = optional(string, "/subscriptions/7f739b7d-f399-4b97-9a9f-f1962309ee6e/resourceGroups/SideroGallery/providers/Microsoft.Compute/galleries/SideroLabs/images/talos-x64/versions/latest")<br> num_instances = optional(number, 1)<br> config_patch_files = optional(list(string), [])<br> tags = optional(map(string), {})<br> }))</pre> | <pre>[<br> {<br> "name": "default"<br> }<br>]</pre> | no |
| <a name="input_worker_groups"></a> [worker\_groups](#input\_worker\_groups) | List of node worker node groups to create | <pre>list(object({<br/> name = string<br/> vm_size = optional(string, "Standard_B2s")<br/> vm_os_id = optional(string, "/subscriptions/7f739b7d-f399-4b97-9a9f-f1962309ee6e/resourceGroups/SideroGallery/providers/Microsoft.Compute/galleries/SideroLabs/images/talos-x64/versions/latest")<br/> num_instances = optional(number, 1)<br/> config_patch_files = optional(list(string), [])<br/> tags = optional(map(string), {})<br/> }))</pre> | <pre>[<br/> {<br/> "name": "default"<br/> }<br/>]</pre> | no |
## Outputs
Expand Down
2 changes: 1 addition & 1 deletion examples/terraform/basic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ No modules.
|------|-------------|------|---------|:--------:|
| <a name="input_cluster_endpoint"></a> [cluster\_endpoint](#input\_cluster\_endpoint) | The endpoint for the Talos cluster | `string` | n/a | yes |
| <a name="input_cluster_name"></a> [cluster\_name](#input\_cluster\_name) | A name to provide for the Talos cluster | `string` | n/a | yes |
| <a name="input_node_data"></a> [node\_data](#input\_node\_data) | A map of node data | <pre>object({<br> controlplanes = map(object({<br> install_disk = string<br> hostname = optional(string)<br> }))<br> workers = map(object({<br> install_disk = string<br> hostname = optional(string)<br> }))<br> })</pre> | <pre>{<br> "controlplanes": {<br> "10.5.0.2": {<br> "install_disk": "/dev/sda"<br> },<br> "10.5.0.3": {<br> "install_disk": "/dev/sda"<br> },<br> "10.5.0.4": {<br> "install_disk": "/dev/sda"<br> }<br> },<br> "workers": {<br> "10.5.0.5": {<br> "hostname": "worker-1",<br> "install_disk": "/dev/nvme0n1"<br> },<br> "10.5.0.6": {<br> "hostname": "worker-2",<br> "install_disk": "/dev/nvme0n1"<br> }<br> }<br>}</pre> | no |
| <a name="input_node_data"></a> [node\_data](#input\_node\_data) | A map of node data | <pre>object({<br/> controlplanes = map(object({<br/> install_disk = string<br/> hostname = optional(string)<br/> }))<br/> workers = map(object({<br/> install_disk = string<br/> hostname = optional(string)<br/> }))<br/> })</pre> | <pre>{<br/> "controlplanes": {<br/> "10.5.0.2": {<br/> "install_disk": "/dev/sda"<br/> },<br/> "10.5.0.3": {<br/> "install_disk": "/dev/sda"<br/> },<br/> "10.5.0.4": {<br/> "install_disk": "/dev/sda"<br/> }<br/> },<br/> "workers": {<br/> "10.5.0.5": {<br/> "hostname": "worker-1",<br/> "install_disk": "/dev/nvme0n1"<br/> },<br/> "10.5.0.6": {<br/> "hostname": "worker-2",<br/> "install_disk": "/dev/nvme0n1"<br/> }<br/> }<br/>}</pre> | no |

## Outputs

Expand Down
4 changes: 2 additions & 2 deletions examples/terraform/equinix-metal/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ No modules.
|------|-------------|------|---------|:--------:|
| <a name="input_cluster_name"></a> [cluster\_name](#input\_cluster\_name) | Name of cluster | `string` | `"talos-em"` | no |
| <a name="input_config_patch_files"></a> [config\_patch\_files](#input\_config\_patch\_files) | Path to talos config path files that applies to all nodes | `list(string)` | `[]` | no |
| <a name="input_control_plane"></a> [control\_plane](#input\_control\_plane) | Info for control plane that will be created | <pre>object({<br> plan = optional(string, "c3.small.x86")<br> ipxe_script_url = optional(string, "https://pxe.factory.talos.dev/pxe/376567988ad370138ad8b2698212367b8edcb69b5fd68c80be1f2ec7d603b4ba/v1.7.0/equinixMetal-amd64")<br> install_image = optional(string, "ghcr.io/talos-systems/installer:v1.7.0")<br> num_instances = optional(number, 3)<br> config_patch_files = optional(list(string), [])<br> tags = optional(list(string), [])<br> })</pre> | `{}` | no |
| <a name="input_control_plane"></a> [control\_plane](#input\_control\_plane) | Info for control plane that will be created | <pre>object({<br/> plan = optional(string, "c3.small.x86")<br/> ipxe_script_url = optional(string, "https://pxe.factory.talos.dev/pxe/376567988ad370138ad8b2698212367b8edcb69b5fd68c80be1f2ec7d603b4ba/v1.7.0/equinixMetal-amd64")<br/> install_image = optional(string, "ghcr.io/talos-systems/installer:v1.7.0")<br/> num_instances = optional(number, 3)<br/> config_patch_files = optional(list(string), [])<br/> tags = optional(list(string), [])<br/> })</pre> | `{}` | no |
| <a name="input_em_api_token"></a> [em\_api\_token](#input\_em\_api\_token) | API token for Equinix Metal | `string` | n/a | yes |
| <a name="input_em_project_id"></a> [em\_project\_id](#input\_em\_project\_id) | Equinix Metal project ID | `string` | n/a | yes |
| <a name="input_em_region"></a> [em\_region](#input\_em\_region) | Equinix Metal region to use | `string` | `"dc"` | no |
| <a name="input_extra_tags"></a> [extra\_tags](#input\_extra\_tags) | Extra tags to add to the cluster cloud resources | `list(string)` | `[]` | no |
| <a name="input_kubernetes_version"></a> [kubernetes\_version](#input\_kubernetes\_version) | Kubernetes version to use for the cluster, if not set the k8s version shipped with the talos sdk version will be used | `string` | `null` | no |
| <a name="input_talos_version_contract"></a> [talos\_version\_contract](#input\_talos\_version\_contract) | Talos API version to use for the cluster, if not set the the version shipped with the talos sdk version will be used | `string` | `null` | no |
| <a name="input_worker_groups"></a> [worker\_groups](#input\_worker\_groups) | List of node worker node groups to create | <pre>list(object({<br> name = string<br> plan = optional(string, "c3.small.x86")<br> ipxe_script_url = optional(string, "https://pxe.factory.talos.dev/pxe/376567988ad370138ad8b2698212367b8edcb69b5fd68c80be1f2ec7d603b4ba/v1.7.0/equinixMetal-amd64")<br> install_image = optional(string, "ghcr.io/talos-systems/installer:v1.7.0")<br> num_instances = optional(number, 1)<br> config_patch_files = optional(list(string), [])<br> tags = optional(list(string), [])<br> }))</pre> | <pre>[<br> {<br> "name": "default"<br> }<br>]</pre> | no |
| <a name="input_worker_groups"></a> [worker\_groups](#input\_worker\_groups) | List of node worker node groups to create | <pre>list(object({<br/> name = string<br/> plan = optional(string, "c3.small.x86")<br/> ipxe_script_url = optional(string, "https://pxe.factory.talos.dev/pxe/376567988ad370138ad8b2698212367b8edcb69b5fd68c80be1f2ec7d603b4ba/v1.7.0/equinixMetal-amd64")<br/> install_image = optional(string, "ghcr.io/talos-systems/installer:v1.7.0")<br/> num_instances = optional(number, 1)<br/> config_patch_files = optional(list(string), [])<br/> tags = optional(list(string), [])<br/> }))</pre> | <pre>[<br/> {<br/> "name": "default"<br/> }<br/>]</pre> | no |

## Outputs

Expand Down
4 changes: 2 additions & 2 deletions examples/terraform/gcp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@
|------|-------------|------|---------|:--------:|
| <a name="input_cluster_name"></a> [cluster\_name](#input\_cluster\_name) | Name of cluster | `string` | `"talos-gcp-example"` | no |
| <a name="input_config_patch_files"></a> [config\_patch\_files](#input\_config\_patch\_files) | Path to talos config path files that applies to all nodes | `list(string)` | `[]` | no |
| <a name="input_control_plane"></a> [control\_plane](#input\_control\_plane) | Info for control plane that will be created | <pre>object({<br> instance_type = optional(string, "e2-standard-2")<br> image = optional(string, null)<br> num_instances = optional(number, 3)<br> config_patch_files = optional(list(string), [])<br> tags = optional(map(string), {})<br> })</pre> | `{}` | no |
| <a name="input_control_plane"></a> [control\_plane](#input\_control\_plane) | Info for control plane that will be created | <pre>object({<br/> instance_type = optional(string, "e2-standard-2")<br/> image = optional(string, null)<br/> num_instances = optional(number, 3)<br/> config_patch_files = optional(list(string), [])<br/> tags = optional(map(string), {})<br/> })</pre> | `{}` | no |
| <a name="input_kubernetes_version"></a> [kubernetes\_version](#input\_kubernetes\_version) | Kubernetes version to use for the cluster, if not set the k8s version shipped with the talos sdk version will be used | `string` | `null` | no |
| <a name="input_project"></a> [project](#input\_project) | The GCP project to deploy resources to | `string` | n/a | yes |
| <a name="input_region"></a> [region](#input\_region) | The GCP region to deploy resources to | `string` | n/a | yes |
| <a name="input_talos_api_allowed_cidr"></a> [talos\_api\_allowed\_cidr](#input\_talos\_api\_allowed\_cidr) | The CIDR from which to allow to access the Talos API | `string` | `"0.0.0.0/0"` | no |
| <a name="input_talos_version_contract"></a> [talos\_version\_contract](#input\_talos\_version\_contract) | Talos API version to use for the cluster, if not set the the version shipped with the talos sdk version will be used | `string` | `null` | no |
| <a name="input_vpc_cidr"></a> [vpc\_cidr](#input\_vpc\_cidr) | The IPv4 CIDR block for the VPC. | `string` | `"172.16.0.0/16"` | no |
| <a name="input_worker_groups"></a> [worker\_groups](#input\_worker\_groups) | List of node worker node groups to create | <pre>list(object({<br> name = string<br> instance_type = optional(string, "e2-standard-2")<br> image = optional(string, null)<br> num_instances = optional(number, 1)<br> config_patch_files = optional(list(string), [])<br> tags = optional(map(string), {})<br> }))</pre> | <pre>[<br> {<br> "name": "default"<br> }<br>]</pre> | no |
| <a name="input_worker_groups"></a> [worker\_groups](#input\_worker\_groups) | List of node worker node groups to create | <pre>list(object({<br/> name = string<br/> instance_type = optional(string, "e2-standard-2")<br/> image = optional(string, null)<br/> num_instances = optional(number, 1)<br/> config_patch_files = optional(list(string), [])<br/> tags = optional(map(string), {})<br/> }))</pre> | <pre>[<br/> {<br/> "name": "default"<br/> }<br/>]</pre> | no |
| <a name="input_zone"></a> [zone](#input\_zone) | The GCP zone to deploy resources to | `string` | n/a | yes |

## Outputs
Expand Down
Loading

0 comments on commit 9cd1e1c

Please sign in to comment.