91 lines
2.9 KiB
Text
91 lines
2.9 KiB
Text
let _presets = (import "schemas/lib/concerns_presets.ncl").presets in
|
|
|
|
{
|
|
cv | default = {
|
|
name | default = "cv",
|
|
namespace | default = "",
|
|
catalog_ref | default = "cv",
|
|
image | default = "",
|
|
image_tag | default = "latest",
|
|
port | default = 8080,
|
|
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",
|
|
pvc_name | default = "cv-home",
|
|
pvc_mount | default = "/home",
|
|
pvc_size | default = "2Gi",
|
|
pvc_class | default = "longhorn-retain",
|
|
config_mount | default = "/config",
|
|
config_filename | default = "config.yaml",
|
|
|
|
requires | default = {
|
|
storage = { size = "2Gi", persistent = true },
|
|
ports = [{ port = 8080, exposure = 'public }],
|
|
credentials = [],
|
|
},
|
|
|
|
provides | default = {
|
|
service = "cv",
|
|
port = 8080,
|
|
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-CV-001",
|
|
}) & {
|
|
backup | force = {
|
|
kind = 'pending,
|
|
reason = "BackupPolicy declared at workspace level for cv-home PVC",
|
|
backlog_ref = "BACKUP-CV-001",
|
|
},
|
|
manifest_hooks = {
|
|
init = { pre = [
|
|
{ action = 'create-cf-secret },
|
|
{ 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 },
|
|
] },
|
|
},
|
|
},
|
|
},
|
|
}
|