generated from camptocamp/devops-stack-module-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
locals.tf
82 lines (79 loc) · 2.4 KB
/
locals.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
locals {
domain = format("minio.%s", trimprefix("${var.subdomain}.${var.base_domain}", "."))
domain_full = format("minio.%s.%s", trimprefix("${var.subdomain}.${var.cluster_name}", "."), var.base_domain)
self_signed_cert = {
extraVolumeMounts = [
{
name = "certificate"
mountPath = format("/etc/ssl/certs/%s", var.cluster_issuer == "letsencrypt-staging" ? "tls.crt" : "ca.crt")
subPath = var.cluster_issuer == "letsencrypt-staging" ? "tls.crt" : "ca.crt"
},
]
extraVolumes = [
{
name = "certificate"
secret = {
secretName = "minio-tls"
}
}
]
}
oidc_config = var.oidc != null ? merge(
{
oidc = {
enabled = true
configUrl = "${var.oidc.issuer_url}/.well-known/openid-configuration"
clientId = var.oidc.client_id
clientSecret = var.oidc.client_secret
claimName = "policy"
scopes = "openid,profile,email"
redirectUri = format("https://%s/oauth_callback", local.domain_full)
claimPrefix = ""
comment = ""
}
},
var.cluster_issuer != "letsencrypt-prod" ? local.self_signed_cert : null
) : null
helm_values = [{
minio = merge(
{
mode = "standalone" # Set the deployment mode of MinIO to standalone
resources = {
requests = {
memory = "128Mi"
}
}
consoleIngress = {
enabled = true
annotations = {
"cert-manager.io/cluster-issuer" = "${var.cluster_issuer}"
"traefik.ingress.kubernetes.io/router.entrypoints" = "websecure"
"traefik.ingress.kubernetes.io/router.tls" = "true"
}
hosts = [
local.domain,
local.domain_full,
]
tls = [{
secretName = "minio-tls"
hosts = [
local.domain,
local.domain_full,
]
}]
}
metrics = {
serviceMonitor = {
enabled = var.enable_service_monitor
}
}
rootUser = "root"
rootPassword = random_password.minio_root_secretkey.result
users = var.config_minio.users
buckets = var.config_minio.buckets
policies = var.config_minio.policies
},
local.oidc_config
)
}]
}