provisioning-catalog/components/web_app/nickel/contracts.ncl

81 lines
2.5 KiB
Text
Raw Permalink Normal View History

let _concerns_lib = import "schemas/lib/concerns.ncl" in
let _context_lib = import "schemas/catalog/context.ncl" in
{
WebApp = {
context | _context_lib.ComponentContext | optional,
name | String,
namespace | String,
catalog_ref | String | optional,
# nginx frontend — always present
image | String | default = "nginx",
image_tag | String | default = "1.27-alpine",
http_port | Number | default = 80,
# Optional backend application container.
# When app_image is set, a second container is added to the same Pod.
# nginx and the app share the data PVC; nginx serves frontend, app runs alongside.
app_image | String | optional,
app_image_tag | String | default = "latest",
app_port | Number | optional,
app_command | Array String | optional,
# Mount path for the app container — defaults to data_dir if not set.
app_data_dir | String | optional,
domain | String,
domains_extra | Array String | default = [],
dns_zone | String,
acme_email | String,
cluster_issuer | String,
gateway_fip | String,
gateway_name | String | default = "libre-wuji",
gateway_ns | String | default = "kube-system",
storage_class | String | default = "longhorn-retain",
storage_size | String | default = "2Gi",
data_dir | String | default = "/usr/share/nginx/html",
nginx_conf_extra | String | default = "",
auth_paths | Array {
path | String,
slug | String,
realm | String | default = "Restricted",
} | default = [],
requires | {
storage | { size | String, persistent | Bool } | optional,
ports | Array {
port | Number,
exposure | [| 'public, 'private, 'internal |] | default = 'public,
} | default = [],
credentials | Array String | default = [],
} | default = {},
provides | {
service | String | optional,
port | Number | optional,
endpoints | Array String | default = [],
} | default = {},
operations | {
install | Bool | default = true,
update | Bool | default = true,
delete | Bool | default = true,
health | Bool | default = true,
} | default = {},
live_check | {
strategy | [| 'k8s_pods, 'http_get |] | default = 'k8s_pods,
scope | [| 'cp_only, 'all_nodes |] | default = 'cp_only,
} | default = {},
concerns | _concerns_lib.ServiceConcerns | optional,
..
},
}