Giter Site home page Giter Site logo

kbcbals / terraform-k8s-hcloud Goto Github PK

View Code? Open in Web Editor NEW

This project forked from solidnerd/terraform-k8s-hcloud

0.0 0.0 0.0 29 KB

A simple project to spin your k8s cluster with terraform, kubeadm on hcloud

License: MIT License

Shell 36.26% HCL 63.74%

terraform-k8s-hcloud's Introduction

Terraform Kubernetes on Hetzner Cloud

This repository will help to setup an opionated Kubernetes Cluster with kubeadm on Hetzner Cloud.

Usage

$ git clone https://github.com/solidnerd/terraform-k8s-hcloud.git
$ terraform init
$ terraform apply

Example

$ terraform init
$ terraform apply
$ KUBECONFIG=secrets/admin.conf kubectl get nodes
$ KUBECONFIG=secrets/admin.conf kubectl apply -f https://docs.projectcalico.org/archive/v3.15/manifests/calico.yaml
$ KUBECONFIG=secrets/admin.conf kubectl get pods --namespace=kube-system -o wide
$ KUBECONFIG=secrets/admin.conf kubectl run nginx --image=nginx
$ KUBECONFIG=secrets/admin.conf kubectl expose deploy nginx --port=80 --type NodePort

Variables

Name Default Description Required
hcloud_token `` API Token that will be generated through your hetzner cloud project https://console.hetzner.cloud/projects Yes
master_count 1 Amount of masters that will be created No
master_image ubuntu-20.04 Predefined Image that will be used to spin up the machines (Currently supported: ubuntu-20.04, ubuntu-18.04) No
master_type cx11 Machine type for more types have a look at https://www.hetzner.de/cloud No
node_count 1 Amount of nodes that will be created No
node_image ubuntu-20.04 Predefined Image that will be used to spin up the machines (Currently supported: ubuntu-20.04, ubuntu-18.04) No
node_type cx11 Machine type for more types have a look at https://www.hetzner.de/cloud No
ssh_private_key ~/.ssh/id_ed25519 Private Key to access the machines No
ssh_public_key ~/.ssh/id_ed25519.pub Public Key to authorized the access for the machines No
docker_version 19.03 Docker CE version that will be installed No
kubernetes_version 1.18.6 Kubernetes version that will be installed No
feature_gates `` Add your own Feature Gates for Kubeadm No
calico_enabled false Installs Calico Network Provider after the master comes up No

All variables cloud be passed through environment variables or a tfvars file.

An example for a tfvars file would be the following terraform.tfvars

# terraform.tfvars
hcloud_token = "<yourgeneratedtoken>"
master_type = "cx21"
master_count = 1
node_type = "cx31"
node_count = 2
kubernetes_version = "1.18.6"
docker_version = "19.03"

Or passing directly via Arguments

$ terraform apply \
  -var hcloud_token="<yourgeneratedtoken>" \
  -var docker_version=19.03 \
  -var kubernetes_version=1.18.6 \
  -var master_type=cx21 \
  -var master_count=1 \
  -var node_type=cx31 \
  -var node_count=2

Contributing

Bug Reports & Feature Requests

Please use the issue tracker to report any bugs or file feature requests.

Tested with

terraform-k8s-hcloud's People

Contributors

anon6789 avatar fogs avatar solidnerd avatar splattael avatar tillepille avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.