Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ujstor/k8s-k3s-multi-node-iac
k8s (kubespray) and k3s multi node deployment on Hetzner Cloud with Terraform and Ansible.
https://github.com/ujstor/k8s-k3s-multi-node-iac
Last synced: 15 days ago
JSON representation
k8s (kubespray) and k3s multi node deployment on Hetzner Cloud with Terraform and Ansible.
- Host: GitHub
- URL: https://github.com/ujstor/k8s-k3s-multi-node-iac
- Owner: Ujstor
- License: mit
- Created: 2024-12-06T20:34:42.000Z (21 days ago)
- Default Branch: master
- Last Pushed: 2024-12-12T19:34:06.000Z (15 days ago)
- Last Synced: 2024-12-12T20:35:39.955Z (15 days ago)
- Language: HCL
- Homepage:
- Size: 6.83 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# k8s/k3s multi node iac on Hetzner
## Terraform
```bash
cd iac/terrafrom/nodes-hetznerterraform init
terraform apply
```## Ansible
```bash
#K3s
docker build -t ansible-k3s-cluster ./iac/ansible/k3sdocker run --rm -it \
-v $(pwd)/iac/ansible/k3s_inventory.yml:/config/inventory.yml \
-v $(pwd)/iac/terraform/nodes-hetzner/.ssh/kube_hetzner_key:/secrets/ssh_key \
-v $(pwd)/iac/terraform/nodes-hetzner/.ssh/kube_hetzner_key.pub:/secrets/ssh_key.pub \
ansible-k3s-clusteransible-playbook k3s_deploy.yml
ansible-playbook prepare_block_dev_rook_ceph.yml#K8s kubespray
docker build -t ansible-k8s-cluster ./iac/ansible/kubespraydocker run --rm -it \
-v $(pwd)/iac/ansible/k8s_kubespray_inventory.yml:/config/inventory.yml \
-v $(pwd)/iac/terraform/nodes-hetzner/.ssh/kube_hetzner_key:/secrets/ssh_key \
-v $(pwd)/iac/terraform/nodes-hetzner/.ssh/kube_hetzner_key.pub:/secrets/ssh_key.pub \
ansible-k8s-clusteransible-playbook k8s_deploy.yml
ansible-playbook prepare_block_dev_rook_ceph.ymlcat kubeconfig
```
or use the [prebuilt](https://hub.docker.com/repository/docker/ujstor/ansible-k3s-cluster-deploy/general) image.## Helm
### Install Cilium in the `kube-system` namespace:
```bash
cd gitops/helm/system/cilium
helm install cilium . -n kube-system
```### Install Argo CD:
```bash
kubectl create namespace gitops
cd gitops/helm/system/argo-cd
helm install argocd . -n gitops
```### Apply `aoa.yaml` in the `gitops` namespace:
```bash
cd gitops/helm
kubectl apply -f aoa.yaml -n gitops
```The cluster will be automatically bootstrapped.