Skip to content

Terraform files to deploy dabit-server on a self-hosted k8s

Notifications You must be signed in to change notification settings

dabit-app/dabit-terraform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Terraform files for dabit server

This is the terraform files used to deploy dabit-server on the self-hosted k8s. The API is available at api.dabit.alaanor.dev

Deployment

terraform -chdir=./src/ apply -var-file=../deployments/[insert environment].tfvars

Variables

Connect to k8s

There's 2 way to connect to kubernetes.

  1. Using a kubeconfig file
  2. 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

Deployments options

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

Resources

  • Deployments
    • Habit.API
    • Habit.Worker
    • Identity.API
    • Traefik
  • StatefulSets
    • Event Store
    • Mongo (habit)
    • Mongo (user)
  • ConfigMap
  • Secrets
  • Ingress (traefik)

Rational

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.

About

Terraform files to deploy dabit-server on a self-hosted k8s

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages