106 lines
3.8 KiB
Text
106 lines
3.8 KiB
Text
|
|
let _presets = (import "schemas/lib/concerns_presets.ncl").presets in
|
||
|
|
|
||
|
|
{
|
||
|
|
twenty | default = {
|
||
|
|
name | default = "twenty",
|
||
|
|
namespace | default = "twenty",
|
||
|
|
catalog_ref | default = "twenty",
|
||
|
|
image | default = "twentycrm/twenty",
|
||
|
|
image_tag | default = "v2.8.3",
|
||
|
|
http_port | default = 3000,
|
||
|
|
domain | default = "",
|
||
|
|
dns_zone | default = "",
|
||
|
|
acme_email | default = "",
|
||
|
|
cluster_issuer | default = "letsencrypt-prod",
|
||
|
|
gateway_fip | default = "",
|
||
|
|
gateway_name | default = "libre-wuji",
|
||
|
|
gateway_ns | default = "kube-system",
|
||
|
|
valkey_image | default = "valkey/valkey",
|
||
|
|
valkey_image_tag | default = "9-alpine",
|
||
|
|
valkey_storage_class | default = "longhorn-retain",
|
||
|
|
valkey_storage_size | default = "500Mi",
|
||
|
|
db_host | default = "",
|
||
|
|
db_port | default = 5432,
|
||
|
|
db_name | default = "twenty",
|
||
|
|
db_user | default = "twenty",
|
||
|
|
|
||
|
|
# Service-class contract (step 2). Catalog declares the envelope because the
|
||
|
|
# container image lives here; a workspace component may keep or override these.
|
||
|
|
class | default = 'app_server,
|
||
|
|
resources | default = {
|
||
|
|
cpu = { request = "200m", limit = "2000m" },
|
||
|
|
memory = { request = "1Gi", limit = "4Gi" },
|
||
|
|
},
|
||
|
|
placement | default = { node_class = ['general], mode = 'prefer },
|
||
|
|
probes | default = {
|
||
|
|
liveness = { type = 'http, path = "/healthz", port = 3000, initial_delay = 240, period = 30, failure_threshold = 6 },
|
||
|
|
readiness = { type = 'http, path = "/healthz", port = 3000, initial_delay = 60, period = 15, failure_threshold = 10 },
|
||
|
|
},
|
||
|
|
|
||
|
|
requires | default = {
|
||
|
|
storage = { size = "500Mi", persistent = true },
|
||
|
|
ports = [{ port = 3000, exposure = 'public }],
|
||
|
|
credentials = ["TWENTY_DB_PASSWORD", "APP_SECRET"],
|
||
|
|
},
|
||
|
|
|
||
|
|
provides | default = {
|
||
|
|
service = "twenty",
|
||
|
|
port = 3000,
|
||
|
|
endpoints = [],
|
||
|
|
},
|
||
|
|
|
||
|
|
operations | default = {
|
||
|
|
install = true,
|
||
|
|
update = true,
|
||
|
|
delete = true,
|
||
|
|
health = true,
|
||
|
|
},
|
||
|
|
|
||
|
|
live_check | default = {
|
||
|
|
strategy = 'k8s_pods,
|
||
|
|
scope = 'cp_only,
|
||
|
|
},
|
||
|
|
|
||
|
|
concerns | default =
|
||
|
|
let _name = name in
|
||
|
|
let _domain = domain in
|
||
|
|
let _dns_zone = dns_zone in
|
||
|
|
let _acme_email = acme_email in
|
||
|
|
let _cluster_issuer = cluster_issuer in
|
||
|
|
(_presets.tls_endpoint_with_acme {
|
||
|
|
tls_secret = "%{_name}-tls",
|
||
|
|
cluster_issuer = _cluster_issuer,
|
||
|
|
hostnames = [_domain],
|
||
|
|
dns_internal = [],
|
||
|
|
dns_zone = _dns_zone,
|
||
|
|
acme_server = "https://acme-v02.api.letsencrypt.org/directory",
|
||
|
|
acme_email = _acme_email,
|
||
|
|
cert_secret_ref = "",
|
||
|
|
cert_provider = 'cloudflare,
|
||
|
|
backup_backlog_ref = "BACKUP-TWENTY-001",
|
||
|
|
}) & {
|
||
|
|
backup | force = {
|
||
|
|
kind = 'pending,
|
||
|
|
reason = "Valkey queue is ephemeral; PostgreSQL database holds all CRM state",
|
||
|
|
backlog_ref = "BACKUP-TWENTY-001",
|
||
|
|
},
|
||
|
|
manifest_hooks = {
|
||
|
|
init = { pre = [
|
||
|
|
{ file = "certificate", action = 'apply, skip_if_exists = true },
|
||
|
|
{ file = "referencegrant", action = 'apply },
|
||
|
|
{ action = 'patch-gateway-https },
|
||
|
|
] },
|
||
|
|
update = { pre = [
|
||
|
|
{ file = "certificate", action = 'apply, skip_if_exists = true },
|
||
|
|
{ file = "referencegrant", action = 'apply },
|
||
|
|
{ action = 'patch-gateway-https },
|
||
|
|
] },
|
||
|
|
delete = { pre = [
|
||
|
|
{ action = 'remove-gateway-https },
|
||
|
|
{ file = "referencegrant", action = 'delete },
|
||
|
|
] },
|
||
|
|
},
|
||
|
|
},
|
||
|
|
},
|
||
|
|
}
|