-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Alexander Troppmann
committed
May 25, 2021
1 parent
85ee26c
commit 9cdce64
Showing
69 changed files
with
2,723 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
install: install-ansible-dependencies install-hcloud-servers install-k8s-cluster | ||
|
||
install-ansible-dependencies: | ||
ansible-galaxy collection install community.kubernetes | ||
ansible-galaxy collection install hetzner.hcloud | ||
|
||
install-hcloud-servers: | ||
ansible-playbook create-hcloud-infrastructure.yaml -e "state=present" | ||
sleep 300 | ||
|
||
install-k8s-cluster: | ||
ansible-playbook create-kubernetes-cluster.yaml -i env/inventory --private-key ~/.ssh/talexdev_rsa | ||
ansible-playbook deploy-db-prometheus.yaml | ||
ansible-playbook deploy-db-pg.yaml | ||
ansible-playbook deploy-app-termine.yaml | ||
ansible-playbook deploy-ingress.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
```bash | ||
ansible-galaxy collection install community.kubernetes | ||
ansible-galaxy collection install hetzner.hcloud | ||
|
||
ansible-playbook create-hcloud-infrastructure.yaml -e "state=present" | ||
ansible-playbook create-kubernetes-cluster.yaml -i env/inventory --private-key ~/.ssh/talexdev_rsa | ||
ansible-playbook deploy-db-prometheus.yaml | ||
ansible-playbook deploy-db-pg.yaml | ||
ansible-playbook deploy-app-termine.yaml | ||
ansible-playbook deploy-ingress.yaml | ||
``` | ||
|
||
install: htpasswd, openssl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
[defaults] | ||
vault_password_file = ~/.ansible-vault-pass | ||
host_key_checking = False | ||
inventory = inventory | ||
deprecation_warnings = False | ||
interpreter_python = auto_legacy_silent | ||
|
||
[ssh_connection] | ||
pipelining = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
- name: create hosts and network infrastructure on Hetzner Cloud | ||
hosts: localhost | ||
gather_facts: false | ||
become: false | ||
vars_files: | ||
- "env/credentials.yaml" | ||
- "env/setup.yaml" | ||
- "env/hcloud.yaml" | ||
- "env/app.yaml" | ||
roles: | ||
- { role: tf-infrastructure, tags: tf-infrastructure } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
- name: install Kubernetes control plane on first master node | ||
hosts: master[0] | ||
gather_facts: yes | ||
remote_user: k8s | ||
become: yes | ||
vars_files: | ||
- "env/credentials.yaml" | ||
- "env/setup.yaml" | ||
- "env/hcloud.yaml" | ||
- "env/app.yaml" | ||
- "env/ips.yaml" | ||
vars: | ||
kubeconfig: "{{ kube_dir }}/{{ kube_config }}" | ||
roles: | ||
- { role: kube-prepare, tags: kube-prepare } | ||
- { role: kube-master, tags: kube-master } | ||
- { role: kube-config, tags: kube-config } | ||
|
||
- name: join Kubernetes control plane with other master nodes | ||
hosts: master[1:] | ||
gather_facts: yes | ||
remote_user: k8s | ||
become: yes | ||
vars_files: | ||
- "env/setup.yaml" | ||
- "env/hcloud.yaml" | ||
roles: | ||
- { role: kube-prepare, tags: kube-prepare } | ||
- { role: kube-join-master, tags: kube-join-master } | ||
|
||
- name: join Kubernetes cluster with worker nodes | ||
hosts: worker | ||
gather_facts: yes | ||
remote_user: k8s | ||
become: yes | ||
vars_files: | ||
- "env/setup.yaml" | ||
- "env/hcloud.yaml" | ||
roles: | ||
- { role: kube-prepare, tags: kube-prepare } | ||
- { role: kube-join-worker, tags: kube-join-worker } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# | ||
# PRESETS: DO NOT CHANGE UNLESS YOU KNOW WHY :) | ||
# | ||
|
||
# Kubernetes cluster cert | ||
kube_dir: ~/.kube | ||
kube_config: kubernetes-admin-covid-test-station | ||
|
||
# Time-to-live for DNS entries | ||
dns_ttl: 300 | ||
|
||
# Managed SSL certs | ||
managed_cert_name: k8s-tls-managed-cert-covidts | ||
|
||
# Kubernetes Namespaces | ||
namespace: | ||
prometheusOperator: monitoring | ||
postgres: postgres | ||
ldap: ldap | ||
externalDNS: traefik | ||
traefik: traefik | ||
|
||
# Helm chart version pinning | ||
helm_chart_version: | ||
prometheusOperator: 15.4.6 | ||
postgres: 10.3.13 | ||
externalDNS: 5.0.0 | ||
traefik: 9.19.1 | ||
|
||
docker_image_version: | ||
hcloudCCM: v1.10.0 | ||
|
||
# Parameters for Traefik setup | ||
traefik: | ||
dashboard: | ||
user: "admin" | ||
password: "DKL-3K2-Ld2-Dhg" | ||
|
||
# Helm chart values for Prometheus-Operator | ||
prometheusOperator: | ||
deploy: true | ||
grafana: | ||
user: "admin" | ||
password: "DKL-3K2-Ld2-Dhg" | ||
persistentConfig: true | ||
|
||
# Helm chart values for Postgres database | ||
postgres: | ||
port: 5432 | ||
volumeSize: 10Gi | ||
database: "termine" | ||
password: "termine_pw!" | ||
metrics: true | ||
|
||
# Docker ENV parameters for 389DS LDAP server | ||
ldap: | ||
port: 389 | ||
tlsPort: 636 | ||
volumeSize: 10Gi | ||
password: "secret" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Hetzner Cloud project API token | ||
hetzner_api_token: <CREATE_PROJECT_AND_API_TOKEN_IN_YOU_HCLOUD_ACCOUNT> | ||
|
||
# Hetzner DNS Console API token | ||
hetzner_dns_token: <CREATE_API_TOKEN_IN_YOU_DNS_CONSOLE_ACCOUNT> | ||
|
||
# Public SSH keys to connect hosts | ||
ssh_authorized_keys: | ||
- ssh-rsa XZY [email protected] | ||
- ssh-rsa ZXY [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# | ||
# PRESETS FOR HETZNER CLOUD: DO NOT CHANGE UNLESS YOU KNOW WHY :) | ||
# | ||
|
||
# Hetzner Cloud servers | ||
master_count: 1 | ||
worker_count: 2 | ||
|
||
# Hetzner datacenter location name: | ||
# nbg1= Nuremberg DC Park 1 | ||
ds_location: nbg1 | ||
|
||
# Kubernetes version: | ||
# this setup works for v1.19.x | ||
kubernetes_version: 1.19.11 | ||
|
||
# Kubernetes config | ||
pod_subnet: 10.96.0.0/16 | ||
service_subnet: 10.244.0.0/16 | ||
dns_domain: cluster.local | ||
|
||
# Docker-CE package version: | ||
# this setup works for v19.x | ||
docker_version: 5:19.03.15~3-0~ubuntu-focal | ||
|
||
# Hetzner Linux image: | ||
# this setup expects Ubuntu v20 as Linux host system | ||
os_image: ubuntu-20.04 | ||
|
||
# Hetzner Cloud server types for cluster master node(s) | ||
master_server_type: cx11 | ||
|
||
# Hetzner Cloud server types for cluster worker node(s) | ||
worker_server_type: cx21 | ||
|
||
# Loadbalancer | ||
subnet_master_lb_ip: 10.0.1.1 | ||
subnet_worker_lb_ip: 10.0.2.1 | ||
|
||
# Private network settings | ||
network_name: kubernetes | ||
network_ip_range: 10.0.0.0/8 | ||
|
||
# Master nodes | ||
subnet_master_ip_range: 10.0.1.0/24 | ||
subnet_master_ip: 10.0.1 | ||
|
||
# Worker nodes | ||
subnet_worker_ip_range: 10.0.2.0/24 | ||
subnet_worker_ip: 10.0.2 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# | ||
# CONFIGURATION: CHANGE DOMAIN SETTINGS AND OTHER STUFF HERE | ||
# | ||
# Kubernetes control plane API host: control_plane.subdomain.domain | ||
# Traefik Ingress Controller dashboard: traefik_dashboard.subdomain.domain | ||
# COVID Test-Station URL: application.subdomain.domain | ||
|
||
# Internal name of Kubernetes cluster | ||
cluster_name: roanapur | ||
|
||
# Naming (DNS) for master and worker nodes | ||
domain: roanapur.space | ||
subdomain: k8s | ||
|
||
# Naming (DNS) for hosts | ||
hostname: | ||
control_plane: api | ||
traefik_dashboard: ingress | ||
application: covid-test-station |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.