diff --git a/README.md b/README.md index 7c55ddf..1377d4f 100644 --- a/README.md +++ b/README.md @@ -1 +1,45 @@ -# proxmox-talos-opentofu \ No newline at end of file +# proxmox-talos-opentofu +Proof of concept project using [OpenTofu](https://opentofu.org/) to install a Kubernetes cluster on a Proxmox +hypervisor using [Talos Linux](https://www.talos.dev/). + +## Requirements +You need to have installed on your local machine: +* [OpenTofu](https://opentofu.org/) +* [kubectl](https://kubernetes.io/docs/reference/kubectl/) (for testing and cluster interaction) + +## Provisioning +The project is grouped in two modules: +* proxmox: provisioning of virtual machines, operating systems and Kubernetes cluster +* kubernetes: provisioning of Kubernetes cluster resources + +So you want first to provision the Proxmox part: create a `credentials.auto.tfvars` file based on the example. +```shell +cd proxmox +tofu init +tofu plan +tofu apply +``` + +You can then grab the kube config file for Kubernetes provisioning like so: +```shell +tofu output kubeconfig +``` +and put its contents into your `~/.kube/config`. + +Test if your cluster access works by listing the nodes: +```shell +kubectl get nodes +``` + +Secondly, you can provision the Resources inside the Kubernetes cluster: +```shell +cd kubernetes +tofu init +tofu plan +tofu apply +``` + +## Information Sources +* Terraform providers/modules + * [terraform-provider-proxmox](https://github.com/Telmate/terraform-provider-proxmox) + * [terraform-provider-talos](https://github.com/siderolabs/terraform-provider-talos) diff --git a/proxmox/credentials.auto.tfvars.example b/proxmox/credentials.auto.tfvars.example new file mode 100644 index 0000000..9507064 --- /dev/null +++ b/proxmox/credentials.auto.tfvars.example @@ -0,0 +1,7 @@ +proxmox_api_url = "https://192.168.1.10:8006/api2/json" +proxmox_api_token_id = "root@pam!supersecret" +proxmox_api_token_secret = "js7ej5k9-hd75-hd64-js56-js834jmd732" +proxmox_target_node = "your proxmox node" + +cluster_name = "your cluster name" +cluster_endpoint = "https://192.168.1.100:6443" \ No newline at end of file