Terraform Module to deploy a Kubernetes Cluster using RKE Provider in Hetzner Cloud.
See test/main.tf
for example usage of the module.
You might want to include the CSI driver for automatic provisioning of volumes by adding https://raw.githubusercontent.com/hetznercloud/csi-driver/v1.2.3/deploy/kubernetes/hcloud-csi.yml
to addons_include
variable. (Note: A configmap containing the api key needs to be added as well.)
Name | Version |
---|---|
hcloud | ~> 1.14 |
rke | ~> 0.14 |
Name | Description | Type | Default | Required |
---|---|---|---|---|
addons_include | List of URLs to yaml resources to include eg. install Kubernetes Dashboard | list(string) |
[ |
no |
docker_version | Docker version to install on the nodes | string |
"18.06.2" |
no |
image | Image | string |
"ubuntu-16.04" |
no |
nodes | Map of node objects including their name, role and server_type | map(object({ |
{ |
no |
ssh_private_key_path | SSH private key path | string |
"~/.ssh/id_rsa" |
no |
ssh_public_key_path | SSH public key path | string |
"~/.ssh/id_rsa.pub" |
no |
Name | Description |
---|---|
api_server_url | RKE k8s cluster api server url |
ca_cert | RKE k8s cluster CA certificate |
client_cert | RKE k8s cluster client certificate |
client_key | RKE k8s cluster client key |
kube_config_yaml | RKE k8s cluster kube config yaml |
this | List of node objects |
After deploying your Kubernetes Cluster you can login to the Kubernetes Dashboard using the following steps:
- Get Kubernetes Dashboard token
kubectl --kubeconfig kube_config_cluster.yml -n kube-system describe secret $(kubectl --kubeconfig kube_config_cluster.yml -n kube-system get secret | grep admin-user | awk '{print $1}') | grep ^token: | awk '{ print $2 }'
- Set up kubectl proxy
kubectl --kubeconfig kube_config_cluster.yml proxy"
- Login with the token copied in the step before at http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/
We encourage you to contribute to this project in whatever way you like!
Report bugs/feature requests in the issues section.
When contributing to this repository, please first discuss the change you wish to make via issue with the owners of this repository before making a change.
In a nutshell:
Given a version number MAJOR.MINOR.PATCH, increment the:
- MAJOR version when you make incompatible API changes,
- MINOR version when you add functionality in a backwards-compatible manner, and
- PATCH version when you make backwards-compatible bug fixes.
Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.