This is the terraform files used to deploy dabit-server on the self-hosted k8s. The API is available at api.dabit.alaanor.dev
terraform -chdir=./src/ apply -var-file=../deployments/[insert environment].tfvars
There's 2 way to connect to kubernetes.
- Using a kubeconfig file
- Supplying credentials
In local for development purpose, you would typically use a kubemap. Set the config context through an environment variable TF_VAR_k8s_config_context
and all should works just fine.
name | default |
---|---|
k8s_config_path | ~/.kube/config |
k8s_config_context | null |
k8s_host | null |
k8s_client_certificate | null |
k8s_client_key | null |
k8s_cluster_ca_certificate | null |
name | description | default |
---|---|---|
host | hostname for the ingress | localhost |
namespace | name of kubernetes namespace for all resources deployed | default |
habit_api_replicas | number of replicas for Habit.API | 1 |
identity_api_replicas | number of replicas for Identity.API | 1 |
- Deployments
- Habit.API
- Habit.Worker
- Identity.API
- Traefik
- StatefulSets
- Event Store
- Mongo (habit)
- Mongo (user)
- ConfigMap
- Secrets
- Ingress (traefik)
The reason there's 2 mongodb is because one is built from the event store (Habit.Worker's job, it's a read-only db). Thus mongo-db-habit isn't entirely a true stateful db since its state can be rebuilt from the event store. Which means that theorically we could destroy the db entirely and rebuild (could be how migrations are done in the future), for that reason I prefer separating them.