-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.tf
77 lines (73 loc) · 1.96 KB
/
deploy.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
terraform {
backend "s3" {
endpoint = "https://objectstore.nyc1.civo.com"
bucket = "states"
key = "api.tfstate"
region = "NYC1"
skip_region_validation = true
skip_credentials_validation = true
skip_metadata_api_check = true
force_path_style = true
}
}
variable "environnment" {}
variable "name" {}
variable "tag" {}
variable "host" {}
variable "token" {}
variable "openai_api_key" {}
variable "db_hostname" {}
variable "db_port" {}
variable "db_username" {}
variable "db_password" {}
variable "rabbitmq_uri" {}
provider "kubernetes" {
host = var.host
token = var.token
insecure = true
}
locals {
settings = {
name = var.name
namespace = "convictionsai"
type = "backend"
version = var.tag
resources = {
replicas = 1
requests = {
cpu = "500m"
memory = "500Mi"
}
limits = {
cpu = "500m"
memory = "500Mi"
}
}
networking = {
ingress = {
hostname = "api.convictions.ai"
path = "/"
}
ports = [
{
name = "http"
port = 8080
}
]
}
env = {
ENVIRONMENT = var.environnment
PORT = 8080
DB_HOSTNAME = var.db_hostname
DB_PORT = var.db_port
DB_USERNAME = var.db_username
DB_PASSWORD = var.db_password
RABBITMQ_URI = var.rabbitmq_uri
OPENAI_API_KEY = var.openai_api_key
}
}
}
module "deploy" {
source = "github.com/convictionsai/terraform-kubernetes-deployment.git?ref=0.0.2"
settings = local.settings
}