move hackmd to mysql and increase replicase as it is now stateless [ci skip]
This commit is contained in:
parent
6c1e2b752f
commit
54b543e142
1 changed files with 45 additions and 42 deletions
|
|
@ -23,7 +23,7 @@ resource "kubernetes_deployment" "hackmd" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
spec {
|
spec {
|
||||||
replicas = 1
|
replicas = 3
|
||||||
strategy {
|
strategy {
|
||||||
type = "Recreate"
|
type = "Recreate"
|
||||||
}
|
}
|
||||||
|
|
@ -40,49 +40,49 @@ resource "kubernetes_deployment" "hackmd" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
spec {
|
spec {
|
||||||
container {
|
# container {
|
||||||
image = "postgres:11.6-alpine"
|
# image = "postgres:11.6-alpine"
|
||||||
name = "postgres"
|
# name = "postgres"
|
||||||
image_pull_policy = "IfNotPresent"
|
# image_pull_policy = "IfNotPresent"
|
||||||
env {
|
# env {
|
||||||
name = "POSTGRES_USER"
|
# name = "POSTGRES_USER"
|
||||||
value = "codimd"
|
# value = "codimd"
|
||||||
}
|
# }
|
||||||
env {
|
# env {
|
||||||
name = "POSTGRES_PASSWORD"
|
# name = "POSTGRES_PASSWORD"
|
||||||
value = var.hackmd_db_password
|
# value = var.hackmd_db_password
|
||||||
}
|
# }
|
||||||
env {
|
# env {
|
||||||
name = "POSTGRES_DB"
|
# name = "POSTGRES_DB"
|
||||||
value = "codimd"
|
# value = "codimd"
|
||||||
}
|
# }
|
||||||
resources {
|
# resources {
|
||||||
limits = {
|
# limits = {
|
||||||
cpu = "1"
|
# cpu = "1"
|
||||||
memory = "1Gi"
|
# memory = "1Gi"
|
||||||
}
|
# }
|
||||||
requests = {
|
# requests = {
|
||||||
cpu = "1"
|
# cpu = "1"
|
||||||
memory = "1Gi"
|
# memory = "1Gi"
|
||||||
}
|
# }
|
||||||
}
|
# }
|
||||||
port {
|
# port {
|
||||||
container_port = 80
|
# container_port = 80
|
||||||
}
|
# }
|
||||||
volume_mount {
|
# volume_mount {
|
||||||
name = "data"
|
# name = "data"
|
||||||
mount_path = "/var/lib/postgresql/data"
|
# mount_path = "/var/lib/postgresql/data"
|
||||||
sub_path = "postgres"
|
# sub_path = "postgres"
|
||||||
}
|
# }
|
||||||
}
|
# }
|
||||||
|
|
||||||
container {
|
container {
|
||||||
name = "codumd"
|
name = "codimd"
|
||||||
image = "nabo.codimd.dev/hackmdio/hackmd:latest"
|
image = "hackmdio/hackmd"
|
||||||
image_pull_policy = "IfNotPresent"
|
|
||||||
env {
|
env {
|
||||||
name = "CMD_DB_URL"
|
name = "CMD_DB_URL"
|
||||||
value = format("%s%s%s", "postgres://codimd:", var.hackmd_db_password, "@localhost/codimd")
|
# value = format("%s%s%s", "postgres://codimd:", var.hackmd_db_password, "@localhost/codimd")
|
||||||
|
value = format("%s%s%s", "mysql://codimd:", var.hackmd_db_password, "@mysql.dbaas.svc.cluster.local/codimd")
|
||||||
}
|
}
|
||||||
env {
|
env {
|
||||||
name = "CMD_USECDN"
|
name = "CMD_USECDN"
|
||||||
|
|
@ -146,7 +146,10 @@ resource "kubernetes_ingress_v1" "hackmd" {
|
||||||
name = "hackmd-ingress"
|
name = "hackmd-ingress"
|
||||||
namespace = "hackmd"
|
namespace = "hackmd"
|
||||||
annotations = {
|
annotations = {
|
||||||
"kubernetes.io/ingress.class" = "nginx"
|
"kubernetes.io/ingress.class" = "nginx"
|
||||||
|
"nginx.ingress.kubernetes.io/affinity" = "cookie"
|
||||||
|
"nginx.ingress.kubernetes.io/affinity-mode" = "persistent"
|
||||||
|
"nginx.ingress.kubernetes.io/session-cookie-name" = "_sa_nginx"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue