init: copy from lawndale-infra

This commit is contained in:
2022-05-26 01:29:23 +02:00
commit 478b173c7b
11 changed files with 343 additions and 0 deletions

32
README.md Normal file
View File

@@ -0,0 +1,32 @@
# Terraform config for drone
Drone is a self-hosted Continuous Integration platform. This terraform root module will create a Gitea OAuth2 application, a persistent volume for Drone and installs Drone to a Kubernetes namespace on Lawndale.
**This module assumes Lawndale as the hosting environment!**
## Provider configurations
The following providers are used and should be configured before calling `init` or `apply`.
### AWS
AWS is only used for state backend. Check out [AWS Provider config](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#authentication-and-configuration).
### Gitea
Either `GITEA_TOKEN` or `GITEA_USERNAME` and `GITEA_PASSWORD` must be set for authentication.
### Kubernetes / Helm
Drone is provisioned with Helm on a kubernetes cluster.
Helm is using the same environment variables as the Kubernetes provider.
Set `KUBE_CONFIG_PATH` to use a kubeconfig file, and `KUBE_CTX` to use a different context than set in the kubeconfig.
For token auth, set `KUBE_TOKEN` and `KUBE_HOST` environment vars.
A PEM-encoded root certificates bundle for TLS authentication can be sourced by setting
`KUBE_CLUSTER_CA_CERT_DATA`.
Sources:
[Kubernetes](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs#argument-reference)
[Helm](https://registry.terraform.io/providers/hashicorp/helm/latest/docs)
## Persistent volume
Persistence is supported by [terraform-modules//9p-persistent-volume](git.thomasklein.me/thomasklein/terraform-modules/9p-persistent-volume).