Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/s4l1h/hetzner-k3s-terraform
- Owner: s4l1h
- Created: 2021-02-03T22:24:21.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-02-03T22:36:14.000Z (almost 4 years ago)
- Last Synced: 2024-11-05T23:32:22.521Z (about 2 months ago)
- Topics: hetzner, hetzner-cloud, k3s, k3s-cluster, terraform
- Language: HCL
- Homepage:
- Size: 4.88 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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
```