103 lines
3.5 KiB
Text
103 lines
3.5 KiB
Text
|
|
let _presets = (import "schemas/lib/concerns_presets.ncl").presets in
|
||
|
|
|
||
|
|
{
|
||
|
|
wordpress_site | default = {
|
||
|
|
name | default = "wordpress",
|
||
|
|
namespace | default = "",
|
||
|
|
image | default = "",
|
||
|
|
image_tag | default = "latest",
|
||
|
|
nginx_image | default = "nginx:1.27-alpine",
|
||
|
|
domain | default = "",
|
||
|
|
domains_extra | 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",
|
||
|
|
registry_secret | default = "regcred",
|
||
|
|
fpm_pool_extra | default = "",
|
||
|
|
wp_cron_enabled | default = false,
|
||
|
|
wp_cron_schedule | default = "*/5 * * * *",
|
||
|
|
storage_class | default = "longhorn-retain",
|
||
|
|
storage_size | default = "10Gi",
|
||
|
|
db_host | default = "mariadb.core-data.svc.libre-wuji.local",
|
||
|
|
db_name | default = "",
|
||
|
|
db_user | default = "wordpress",
|
||
|
|
db_table_prefix | default = "wp_",
|
||
|
|
smtp_host | default = "mail.librecloud.online",
|
||
|
|
smtp_port | default = 587,
|
||
|
|
smtp_from | default = "",
|
||
|
|
smtp_from_name | default = "",
|
||
|
|
wordpress_home | default = "",
|
||
|
|
wordpress_siteurl | default = "",
|
||
|
|
|
||
|
|
requires | default = {
|
||
|
|
storage = { size = "10Gi", persistent = true },
|
||
|
|
ports = [{ port = 80, exposure = 'public }],
|
||
|
|
credentials = ["WORDPRESS_DB_PASSWORD", "SMTP_USER", "SMTP_PASS"],
|
||
|
|
},
|
||
|
|
|
||
|
|
provides | default = {
|
||
|
|
service = "wordpress",
|
||
|
|
port = 80,
|
||
|
|
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-WP-001",
|
||
|
|
}) & {
|
||
|
|
backup | force = {
|
||
|
|
kind = 'pending,
|
||
|
|
reason = "BackupPolicy required — WordPress uploads PVC must be included in backup group",
|
||
|
|
backlog_ref = "BACKUP-WP-001",
|
||
|
|
},
|
||
|
|
manifest_hooks = {
|
||
|
|
init = { pre = [
|
||
|
|
{ action = 'create-cf-secret },
|
||
|
|
{ file = "clusterissuer", action = 'apply, skip_if_exists = true },
|
||
|
|
{ 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 },
|
||
|
|
] },
|
||
|
|
},
|
||
|
|
},
|
||
|
|
},
|
||
|
|
}
|