Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/s4l1h/hetzner-k3s-terraform

K3S - Hetzner Cloud - Terraform
https://github.com/s4l1h/hetzner-k3s-terraform

hetzner hetzner-cloud k3s k3s-cluster terraform

Last synced: 10 days ago
JSON representation

K3S - Hetzner Cloud - Terraform

Awesome Lists containing this project

README

        

# K3S - Hetzner Cloud - Terraform

It is tested on Terraform v0.14.5

## How to use?

Copy **terraform.tfvars** from **sample** and fill all variables in **terraform.tfvars**

```
cp terraform.tfvars.sample terraform.tfvars
```

### Initalize and apply

These commands will create [k3s](https://k3s.io/) cluster.

```
terraform init
terraform plan
terraform apply
```

After these commands. Terraform will download these files.

**/etc/rancher/k3s/k3s.yaml** to **./data/k3s.yaml** and **/var/lib/rancher/k3s/server/node-token** to **./data/node-token**

```
export KUBECONFIG=`pwd`/data/k3s.yaml
kubectl get nodes
kubectl get pods --all-namespaces
```

You can be able to see details via this command.

```
terraform output
```

### DNS module

if you want to use **cloudflare dns** module.
Please uncomment all lines related to Cloudflare in **dns.tf** and **terraform.tfvars** files.

### Create SSH key (or you can use your own key)

This command will create **id_rsa** and **id_rsa.pub** file in **./data** directory.

```
sh files/create_ssh_key.sh
```