Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

Commit

Permalink
add config node
Browse files Browse the repository at this point in the history
  • Loading branch information
AnatoleAM committed Dec 6, 2023
1 parent 20e2031 commit c37997e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
1 change: 1 addition & 0 deletions terraform/config.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ mongo:
db: ${mongo_database}
username: ${mongo_username}
password: ${mongo_password}
hedged_reads: ${mongo_hedged_reads}

meilisearch:
host: ${meili_url}
Expand Down
13 changes: 5 additions & 8 deletions terraform/deployment.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ resource "kubernetes_secret" "app" {
mongo_username = local.infra.mongodb_user_app.username
mongo_password = local.infra.mongodb_user_app.password
mongo_database = "7tv"
mongo_hedged_reads = var.mongo_use_hedged_reads
meili_url = "http://meilisearch.database.svc.cluster.local:7700"
meili_key = var.meilisearch_key
meili_index = "emotes"
Expand All @@ -56,15 +57,11 @@ resource "kubernetes_deployment" "app" {
metadata {
name = "api"
namespace = data.kubernetes_namespace.app.metadata[0].name
labels = {
labels = {
app = "api"
}
}

lifecycle {
replace_triggered_by = [kubernetes_secret.app]
}

timeouts {
create = "4m"
update = "5m"
Expand Down Expand Up @@ -261,8 +258,8 @@ resource "kubernetes_service" "app" {

resource "kubernetes_ingress_v1" "app" {
metadata {
name = "api"
namespace = data.kubernetes_namespace.app.metadata[0].name
name = "api"
namespace = data.kubernetes_namespace.app.metadata[0].name
annotations = {
"kubernetes.io/ingress.class" = "nginx"
"external-dns.alpha.kubernetes.io/target" = local.infra.cloudflare_tunnel_hostname.regular
Expand Down Expand Up @@ -335,7 +332,7 @@ resource "kubernetes_horizontal_pod_autoscaler_v2" "api" {
name = kubernetes_deployment.app.metadata[0].name
}

min_replicas = 2
min_replicas = local.infra.production ? 5 : 1
max_replicas = 14

metric {
Expand Down

0 comments on commit c37997e

Please sign in to comment.