-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenwebui.tf
99 lines (88 loc) · 2.65 KB
/
openwebui.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
resource "helm_release" "openwebui" {
name = "openwebui"
repository = "https://helm.openwebui.com/"
chart = "open-webui"
namespace = kubernetes_namespace.chat-stack.metadata[0].name
values = [
yamlencode({
ollama = { enabled = false }
pipelines = { enabled = false }
tika = { enabled = false }
clusterDomain = "cluster.local"
annotations = {}
podAnnotations = {}
replicaCount = var.openwebui_replicas
image = {
repository = "ghcr.io/open-webui/open-webui"
tag = "main"
pullPolicy = "IfNotPresent"
}
resources = {
requests = {
cpu = "1"
memory = "1Gi"
}
}
ingress = {
enabled = true
class = "nginx"
annotations = {
"nginx.ingress.kubernetes.io/affinity" = "cookie"
"nginx.ingress.kubernetes.io/session-cookie-name" = "podmap"
"nginx.ingress.kubernetes.io/session-cookie-expires" = "10800"
"nginx.ingress.kubernetes.io/session-cookie-max-age" = "10800"
}
host = "${var.subdomain}.${var.domain}"
tls = false
}
persistence = {
enabled = true
existingClaim = kubernetes_persistent_volume_claim.pvc.metadata[0].name
}
topologySpreadConstraints = [
{
maxSkew = 1
topologyKey = "kubernetes.io/hostname"
whenUnsatisfiable = "ScheduleAnyway"
labelSelector = {
matchLabels = {
"app.kubernetes.io/component" = "open-webui"
}
}
}
]
service = {
type = "NodePort"
annotations = {}
port = 80
containerPort = 8080
nodePort = ""
labels = {}
loadBalancerClass = ""
}
openaiBaseApiUrl = "http://${kubernetes_service.litellm_service.metadata.0.name}.${kubernetes_service.litellm_service.metadata.0.namespace}.svc.cluster.local:4000"
extraEnvVars = [
{
name = "OPENAI_API_KEY"
value = local.litellm_master_key
},
{
name = "WEBUI_NAME"
value = var.webui_name
},
{
name = "DATABASE_URL"
value = "postgresql://postgres:${google_sql_database_instance.pg.root_password}@${google_sql_database_instance.pg.private_ip_address}/openwebui"
},
{
name = "JWT_EXPIRES_IN"
value = "1d"
},
{
name = "AIOHTTP_CLIENT_TIMEOUT"
value = "60"
}
]
})
]
}