"description":"Parameters to instantiate an agent collecting logs and metrics",
"type":"object",
"additionalProperties":false,
"unevaluatedProperties":false,
"$defs":{
"type":{
"description":"Type of the application. With `SlapOS` type, some metrics are collected from supervisor and from some known partition types (for example: ERP5's mariadb or ERP5's zopes). With `system` type, only log files are ingested.",
"type":"string",
"default":"SlapOS",
"enum":[
"SlapOS",
"system"
]
},
"name":{
"description":"Name of this application",
"type":"string"
},
"urls":{
"description":"URLs to monitor for availability and certificate lifetime",
"type":"array",
"items":{
"type":"string"
}
},
"log-file-patterns":{
"type":"array",
"items":{
"type":"string"
},
"description":"Glob patterns for watched log files."
},
"static-tags":{
"type":"object",
"description":"Static tags for this partition",
"examples":[
{
"service-level":"production",
"data-center":"abc123"
}
]
}
},
"required":[
"applications",
"influxdb",
"loki"
],
"properties":{
"applications":{
"description":"Applications to monitor",
"type":"array",
"items":{
"oneOf":[
{
"type":"object",
"additionalProperties":false,
"description":"Configuration for SlapOS type application",
"description":"Type of the partition. Known types have metrics and logs collected",
"enum":[
"erp5/mariadb",
"erp5/balancer",
"erp5/zope-activity",
"erp5/zope-front",
"erp5/zeo",
"mariadb",
"default"
],
"default":"default"
},
"log-file-patterns":{
"$ref":"#/$defs/log-file-patterns",
"description":"Glob pattern for log files to watch. This mostly makes sense for `default` partition type. `{partition_root_directory}` python `.format`-style substitution variable is supported."
},
"static-tags":{
"$ref":"#/$defs/static-tags"
}
},
"allOf":[
{
"if":{
"properties":{
"type":{
"enum":[
"mariadb",
"erp5/mariadb"
]
}
}
},
"then":{
"properties":{
"dbname":{
"type":"string",
"description":"Database name"
},
"username":{
"type":"string",
"description":"Username to connect to database"
}
}
}
}
],
"examples":[
{
"name":"zope-backoffice",
"type":"erp5/zope-front",
"reference":"slappart1",
"static-tags":{
"instance":"instance-name"
}
},
{
"name":"mariadb",
"type":"erp5/mariadb",
"reference":"slappart2"
},
{
"name":"Theia",
"type":"default",
"log-file-patterns":[
"{partition_root_directory}/.slappart*log"
]
}
]
}
}
}
},
{
"type":"object",
"additionalProperties":false,
"description":"Configuration for `system` type application",
"required":[
"type",
"name"
],
"properties":{
"type":{
"$ref":"#/$defs/type",
"const":"system"
},
"name":{
"$ref":"#/$defs/name"
},
"urls":{
"$ref":"#/$defs/urls"
},
"partitions":{
"type":"array",
"items":{
"type":"object",
"additionalProperties":false,
"properties":{
"name":{
"type":"string",
"description":"Friendly name of the partition",
"examples":[
"syslog",
"email"
]
},
"log-file-patterns":{
"$ref":"#/$defs/log-file-patterns"
},
"static-tags":{
"$ref":"#/$defs/static-tags"
}
},
"examples":[
{
"name":"syslog",
"log-file-patterns":[
"/var/log/syslog"
]
},
{
"name":"kernel",
"log-file-patterns":[
"/var/log/kern.log",
"/var/log/messages"
]
},
{
"name":"re6stnet",
"log-file-patterns":[
"/var/log/re6stnet/*.log"
]
}
]
}
}
}
}
]
}
},
"influxdb":{
"description":"Connection information for influxdb",
"type":"object",
"additionalProperties":false,
"required":[
"url",
"database",
"username",
"password"
],
"properties":{
"url":{
"description":"IPv6 URL of influxdb HTTP endpoint",
"description":"Values returned by agent instantiation",
"additionalProperties":false,
"properties":{
"telegraf-extra-config-dir":{
"description":"Directory in telegraf partition where extra configuration file will be loaded. These files must match *.conf pattern",
"type":"string"
},
"promtail-url":{
"description":"URL of embedded server from promtail",
"format":"uri",
"type":"string"
},
"facl-script":{
"description":"Path of a generated script to set ACL for the agent to access files and sockets. This might be needed depending on how slapos partitions were formatted",
"description":"Parameters to instantiate Grafana",
"type":"object",
"additionalProperties":false,
"properties":{
"email":{
"type":"object",
"description":"Email configuration",
"additionalProperties":false,
"properties":{
"smtp-server":{
"description":"SMTP server used by Grafana to send emails (in host:port format). Leaving this empty will disable email sending.",
"type":"string"
},
"smtp-username":{
"description":"Username to connect to SMTP server",
"type":"string"
},
"smtp-password":{
"description":"Password to connect to SMTP server",
"type":"string"
},
"smtp-verify-ssl":{
"description":"Verify certificate of SMTP server",
"type":"boolean",
"default":true
},
"email-from-address":{
"description":"Email address used in `From:` header of emails",
"type":"string"
},
"email-from-name":{
"description":"Name used in `From:` header of emails",
"default":"Grafana",
"type":"string"
}
}
},
"frontend":{
"type":"object",
"additionalProperties":false,
"properties":{
"custom-domain":{
"description":"Custom domain to use when requesting a rapid-cdn frontend",
"type":"string",
"format":"hostname"
}
}
},
"caucase":{
"type":"object",
"description":"Caucase configuration. To connect external agents, it's required to approve their client certificates, either using an external caucase referenced as `external-caucase-url` or registering a user with `user-auto-approve-count`",
"additionalProperties":false,
"properties":{
"external-caucase-url":{
"description":"URL of a caucase instance to manage all server and clients certificates, to use instead of embedding caucase",
"type":"string",
"format":"uri"
},
"user-auto-approve-count":{
"description":"Number of users to automatically approve in the embedded caucase",
"type":"integer",
"default":0
}
}
},
"influxdb":{
"description":"Fine tuning influxdb parameters",
"type":"object",
"additionalProperties":false,
"properties":{
"default-retention-policy-days":{
"description":"Number of days to keep metrics data",
"description":"Values returned by Grafana instantiation",
"description":"Values returned by Grafana instantiation",
"additionalProperties":false,
"properties":{
"properties":{
"url":{
"url":{
"description":"Shared frontend for this Grafana instance",
"description":"Shared frontend for this Grafana instance",
"pattern":"^https://",
"format":"uri",
"type":"string"
"type":"string"
},
},
"grafana-username":{
"grafana-username":{
...
@@ -18,12 +17,12 @@
...
@@ -18,12 +17,12 @@
},
},
"grafana-url":{
"grafana-url":{
"description":"IPv6 URL to access grafana",
"description":"IPv6 URL to access grafana",
"pattern":"^https://",
"format":"uri",
"type":"string"
"type":"string"
},
},
"influxdb-url":{
"influxdb-url":{
"description":"IPv6 URL of influxdb HTTP endpoint",
"description":"IPv6 URL of influxdb HTTP endpoint",
"pattern":"^https://",
"format":"uri",
"type":"string"
"type":"string"
},
},
"influxdb-database":{
"influxdb-database":{
...
@@ -38,8 +37,23 @@
...
@@ -38,8 +37,23 @@
"description":"password for influxdb user",
"description":"password for influxdb user",
"type":"string"
"type":"string"
},
},
"telegraf-extra-config-dir":{
"loki-url":{
"description":"Directory in telegraf partition where extra configuration file will be loaded. These files must match *.conf pattern",
"description":"Base URL of Loki",
"format":"uri",
"type":"string"
},
"loki-caucase-url":{
"description":"URL caucase service used by Loki",
"format":"uri",
"type":"string"
},
"agent-promtail-url":{
"description":"URL of embedded server from promtail",
"format":"uri",
"type":"string"
},
"agent-facl-script":{
"description":"Path of a generated script to set ACL for the agent to access files and sockets. This might be needed depending on how slapos partitions were formatted",
{{ influx_bin }} -username ${influxdb:auth-username} -password ${influxdb:auth-password} -socket ${influxdb:unix-socket} -execute "CREATE USER ${influxdb:auth-username} WITH PASSWORD '${influxdb:auth-password}' WITH ALL PRIVILEGES"
"description":"Parameters to instantiate Grafana",
"type":"object",
"additionalProperties":false,
"properties":{
"smtp-server":{
"description":"SMTP server used by grafana to send emails (in host:port format). Leaving this empty will disable email sending.",
"type":"string"
},
"smtp-username":{
"description":"Username to connect to SMTP server",
"type":"string"
},
"smtp-password":{
"description":"Password to connect to SMTP server",
"type":"string"
},
"smtp-verify-ssl":{
"description":"Verify SSL certificate of SMTP server",
"type":"string",
"enum":[
"true",
"false"
]
},
"email-from-address":{
"description":"Email address used in From: header of emails",
"type":"string"
},
"email-from-name":{
"description":"Name used in From: header of emails",
"default":"Grafana",
"type":"string"
},
"promtail-extra-scrape-config":{
"description":"Raw promtail config (experimental parameter, see https://github.com/grafana/loki/blob/v0.3.0/docs/promtail.md#scrape-configs for detail)",
{{ influx_bin }} -username ${influxdb:auth-username} -password ${influxdb:auth-password} -socket ${influxdb:unix-socket} -execute "CREATE USER ${influxdb:auth-username} WITH PASSWORD '${influxdb:auth-password}' WITH ALL PRIVILEGES"
"description":"hostname (or IP) of the NBD server containing the boot image.",
"type":"string",
"format":"internet-address"
},
"nbd-port":{
"title":"NBD port",
"description":"Port of the NBD server containing the boot image.",
"type":"integer",
"default":1024,
"minimum":1,
"maximum":65535
},
"virtual-hard-drive-url":{
"virtual-hard-drive-url":{
"title":"Existing disk image URL",
"title":"Existing disk image URL",
"description":"If specified, will download an existing disk image (qcow2, raw, ...), and will use it as main virtual hard drive. Can be used to download and use an already installed and customized virtual hard drive.",
"description":"If specified, will download an existing disk image (qcow2, raw, ...), and will use it as main virtual hard drive. Can be used to download and use an already installed and customized virtual hard drive.",
...
@@ -446,84 +432,31 @@
...
@@ -446,84 +432,31 @@
"type":"boolean",
"type":"boolean",
"default":false
"default":false
},
},
"boot-image-url-list":{
"title":"Boot image list",
"description":"The list shall be list of direct URLs to images, followed by hash (#), then by image MD5SUM. Each image shall appear on newline, like: \"https://example.com/image.iso#06226c7fac5bacfa385872a19bb99684<newline>https://example.com/another-image.iso#31b40d58b18e038498ddb46caea1361c\". They will be provided in KVM image list according to the order on the list. After updating the list, the instance has to be restarted to refresh it. Amount of images is limited to 4, and one image can be maximum 20GB. Image will be downloaded and checked against its MD5SUM 4 times, then it will be considered as impossible to download with given MD5SUM. Each image has to be downloaded in time shorter than 4 hours, so in case of very slow images to access, it can take up to 16 hours to download all of them. Note: The instance has to be restarted in order to update the list of available images in the VM. Note: Maximum 3 ISOs are supported.",
"type":"string",
"textarea":true
},
"boot-image-url-select":{
"boot-image-url-select":{
"title":"Boot image",
"title":"Boot image",
"type":"array",
"type":"string",
"oneOf":[
"description":"Selectable list of provided ISO images.",
"title":"SUSE Linux Enterprise Server 15 SP6 x86_64"
}
]
]
},
},
"boot-image-url-list":{
"title":"[EXPERT] Boot image list",
"description":"The list shall be list of direct URLs to images, followed by hash (#), then by image MD5SUM. Each image shall appear on newline, like: \"https://example.com/image.iso#06226c7fac5bacfa385872a19bb99684<newline>https://example.com/another-image.iso#31b40d58b18e038498ddb46caea1361c\". They will be provided in KVM image list according to the order on the list. Maximum images: 4. Maximum image size: 20GB. Download tires: 4. Maximum download time: 4h.",
"type":"string",
"textarea":true
},
"whitelist-domains":{
"whitelist-domains":{
"title":"Whitelist domains",
"title":"Whitelist domains",
"description":"List of whitelisted domain names to be accessed from the VM. They will be resolved to IPs depending on where the VM end up. IPs can be used too.",
"description":"List of whitelisted domain names to be accessed from the VM. They will be resolved to IPs depending on where the VM end up. IPs can be used too.",
"description":"hostname (or IP) of the NBD server containing the boot image.",
"type":"string",
"format":"internet-address"
},
"nbd-port":{
"title":"NBD port",
"description":"Port of the NBD server containing the boot image.",
"type":"integer",
"default":1024,
"minimum":1,
"maximum":65535
},
"nbd2-host":{
"title":"Second NBD hostname",
"description":"hostname (or IP) of the second NBD server (containing drivers for example).",
"type":"string",
"format":"internet-address"
},
"nbd2-port":{
"title":"Second NBD port",
"description":"Port of the second NBD server containing the boot image.",
"type":"integer",
"minimum":1,
"maximum":65535
},
"virtual-hard-drive-url":{
"virtual-hard-drive-url":{
"title":"Existing disk image URL",
"title":"Existing disk image URL",
"description":"If specified, will download an existing disk image (qcow2, raw, ...), and will use it as main virtual hard drive. Can be used to download and use an already installed and customized virtual hard drive.",
"description":"If specified, will download an existing disk image (qcow2, raw, ...), and will use it as main virtual hard drive. Can be used to download and use an already installed and customized virtual hard drive.",
"description":"The list shall be list of direct URLs to images, followed by hash (#), then by image MD5SUM. Each image shall appear on newline, like: \"https://example.com/image.iso#06226c7fac5bacfa385872a19bb99684<newline>https://example.com/another-image.iso#31b40d58b18e038498ddb46caea1361c\". They will be provided in KVM image list according to the order on the list. After updating the list, the instance has to be restarted to refresh it. Amount of images is limited to 4, and one image can be maximum 20GB. Image will be downloaded and checked against its MD5SUM 4 times, then it will be considered as impossible to download with given MD5SUM. Each image has to be downloaded in time shorter than 4 hours, so in case of very slow images to access, it can take up to 16 hours to download all of them. Note: The instance has to be restarted in order to update the list of available images in the VM. Note: Maximum 3 ISOs are supported.",
"type":"string",
"textarea":true
},
"boot-image-url-select":{
"boot-image-url-select":{
"title":"Boot image",
"title":"Boot image",
"type":"array",
"description":"Selectable list of provided ISO images.",
"title":"SUSE Linux Enterprise Server 15 SP6 x86_64"
}
]
]
},
},
"boot-image-url-list":{
"title":"[EXPERT] Boot image list",
"description":"The list shall be list of direct URLs to images, followed by hash (#), then by image MD5SUM. Each image shall appear on newline, like: \"https://example.com/image.iso#06226c7fac5bacfa385872a19bb99684<newline>https://example.com/another-image.iso#31b40d58b18e038498ddb46caea1361c\". They will be provided in KVM image list according to the order on the list. Maximum images: 4. Maximum image size: 20GB. Download tires: 4. Maximum ownload time: 4h.",
"type":"string",
"textarea":true
},
"whitelist-domains":{
"whitelist-domains":{
"title":"Whitelist domains",
"title":"Whitelist domains",
"description":"List of whitelisted domain names to be accessed from the VM. They will be resolved to IPs depending on where the VM end up. IPs can be used too.",
"description":"List of whitelisted domain names to be accessed from the VM. They will be resolved to IPs depending on where the VM end up. IPs can be used too.",
{% set whitelist_domains = slapparameter_dict.get('whitelist-domains', '') -%}
{% set whitelist_domains = slapparameter_dict.get('whitelist-domains', '') -%}
{% set virtual_hard_drive_url_enabled = 'virtual-hard-drive-url' in slapparameter_dict %}
{% set virtual_hard_drive_url_enabled = 'virtual-hard-drive-url' in slapparameter_dict %}
{% set virtual_hard_drive_url_gzipped = slapparameter_dict.get('virtual-hard-drive-gzipped', False) %}
{% set virtual_hard_drive_url_gzipped = slapparameter_dict.get('virtual-hard-drive-gzipped', False) %}
{% set boot_image_url_list_enabled = 'boot-image-url-list' in slapparameter_dict %}
{% if 'boot-image-url-select' not in slapparameter_dict and ('boot-image-url-list' in slapparameter_dict or 'nbd-host' in slapparameter_dict or 'nbd2-host' in slapparameter_dict or virtual_hard_drive_url_enabled)%}
{% set boot_image_url_select_enabled = 'boot-image-url-select' in slapparameter_dict %}
{% set boot_image_url_select_default = '' %}
{% else %}
{% set boot_image_url_select_default = 'Debian Bookworm 12 netinst x86_64' %}
{% endif %}
{% set bootstrap_script_url = slapparameter_dict.get('bootstrap-script-url') -%}
{% set bootstrap_script_url = slapparameter_dict.get('bootstrap-script-url') -%}
{% set cpu_max_count = dumps(slapparameter_dict.get('cpu-max-count', int(slapparameter_dict.get('cpu-count', 2)) + 1)) %}
{% set cpu_max_count = dumps(slapparameter_dict.get('cpu-max-count', int(slapparameter_dict.get('cpu-count', 2)) + 1)) %}
{% set ram_max_size = dumps(slapparameter_dict.get('ram-max-size', int(slapparameter_dict.get('ram-size', 4096)) + 512)) %}
{% set ram_max_size = dumps(slapparameter_dict.get('ram-max-size', int(slapparameter_dict.get('ram-size', 4096)) + 512)) %}
"Ubuntu Noble 24.04 Live Server x86_64" : "https://shacache.nxdcdn.com/3d518612aabbdb77fd6b49cb55b824fed11e40540e4af52f5f26174257715c93740f83079ea618b4d933081f0b1bc69d32b7885b7c75bc90da5ad3fe1814cfd4#c53b2d7c3269c3b91a2d941ceaa8ab9b",
"Ubuntu Jammy 22.04 Live Server x86_64" : "https://shacache.nxdcdn.com/8017c532ed74586b718662d8b11cf8c34fa638b0affd0413ed38623989b8f98ffd0bcb475246e279ea2f3c194a3e33c55e0f376a9727de13e4bfd87e75e47b5d#e8d2a77c51b599c10651608a5d8c286f",
"Ubuntu Focal 20.04 Live Server x86_64": "https://shacache.nxdcdn.com/302c990c6d69575ff24c96566e5c7e26bf36908abb0cd546e22687c46fb07bf8dba595bf77a9d4fd9ab63e75c0437c133f35462fd41ea77f6f616140cd0e5e6a#f3a306f40e4a313fb5a584d73b3dee8f",
"openSUSE Leap 15 NET x86_64" : "https://shacache.nxdcdn.com/6635269a7eb6fbd6b85fda40cd94f14a27bf53cb1fc82ffcce9fe386a025a43e1ab681db7e8cec50416bfbfc90262f0d95273686a101c74b3f17646f0a34c85b#3708a59af6cf820a95cafe0ae73ac399",
"Arch Linux 2020.09.01 x86_64" : "https://shacache.nxdcdn.com/fc17e8c6ae0790162f4beb8fa6226d945cff638429588999b3a08493ff27b280dc2939fba825ae04be1d9082ea8d7c3c002c5e4c39fbbcf88b8ab5104619e28a#ebcdb2223a77f098af3923fe1fa180aa",
"Fedora Server 32 netinst x86_64" : "https://shacache.nxdcdn.com/c5a511f349a1146b615e6fab9c24f9be4362046adcf24f0ff82c470d361fac5f6628895e2110ebf8ff87db49d4c413a0a332699da6b1bec64275e0c17a15b999#ca7a1e555c04b4d9a549065fa2ddf713",
"SUSE Linux Enterprise Server 15 SP6 x86_64": "https://shacache.nxdcdn.com/e72e03bbcc4c54ce4b8d5f360b47dab9ee514d754e8d78c403626cf000d6ae98d808b3bcff2201e3cf49c1be1b0f308f1cb5ed81676adcb1837dfc811d2451ac",
} -%}
{%- if boot_image_url_select %}
{#- Fail in the promise if bad boot-image-url-select is set -#}
{%- set boot_image = IMAGE_URL_MAPPING.get(boot_image_url_select, boot_image_url_select) %}
{%- else %}
{#- Use default ONLY if no boot-image-url-select is set -#}
{%- set boot_image = IMAGE_URL_MAPPING.get(boot_image_url_select_default) %}