Skip to content

Commit

Permalink
Merge branch 'master' into ix-app-v2
Browse files Browse the repository at this point in the history
  • Loading branch information
stavros-k authored Dec 5, 2024
2 parents 9aee556 + 1ce3e50 commit cecb1fc
Show file tree
Hide file tree
Showing 208 changed files with 17,897 additions and 4,236 deletions.
6 changes: 3 additions & 3 deletions ix-dev/stable/netdata/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ keywords:
- alerting
- metric
- monitoring
lib_version: 1.1.7
lib_version_hash: d05e43e25b7dc1736be6cc1efa4b9255368aa346e3e7a4350a38440f29b73186
lib_version: 2.0.32
lib_version_hash: 4a0bf69cccda322e191eab36ab81ca6d0c8e5d64a0b2fa117c609804b55b86c6
maintainers:
- email: [email protected]
name: truenas
Expand All @@ -58,4 +58,4 @@ sources:
- https://github.com/netdata/netdata
title: Netdata
train: stable
version: 1.1.22
version: 1.2.0
38 changes: 38 additions & 0 deletions ix-dev/stable/netdata/questions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ groups:
description: Configure Network for Netdata
- name: Storage Configuration
description: Configure Storage for Netdata
- name: Labels Configuration
description: Configure Labels for Netdata
- name: Resources Configuration
description: Configure Resources for Netdata

Expand Down Expand Up @@ -453,6 +455,42 @@ questions:
description: The domain to use for the SMB share.
schema:
type: string
- variable: labels
label: ""
group: Labels Configuration
schema:
type: list
default: []
items:
- variable: label
label: Label
schema:
type: dict
attrs:
- variable: key
label: Key
schema:
type: string
required: true
- variable: value
label: Value
schema:
type: string
required: true
- variable: containers
label: Containers
description: Containers where the label should be applied
schema:
type: list
items:
- variable: container
label: Container
schema:
type: string
required: true
enum:
- value: netdata
description: netdata
- variable: resources
label: ""
group: Resources Configuration
Expand Down
85 changes: 28 additions & 57 deletions ix-dev/stable/netdata/templates/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,62 +1,33 @@
{# Stores storage items that contains info for volumes, vol mounts, perms dirs and perms mounts #}
{% set storage_items = namespace(items=[]) %}
{# Stores the top level volumes #}
{% set volumes = namespace(items={}) %}
{# Stores the container volume mounts #}
{% set volume_mounts = namespace(items=[]) %}

{% do storage_items.items.append(ix_lib.base.storage.storage_item(data=dict(values.storage.config, **{"mount_path": "/etc/netdata"}), values=values)) %}
{% do storage_items.items.append(ix_lib.base.storage.storage_item(data=dict(values.storage.cache, **{"mount_path": "/var/cache/netdata"}), values=values)) %}
{% do storage_items.items.append(ix_lib.base.storage.storage_item(data=dict(values.storage.lib, **{"mount_path": "/var/lib/netdata"}), values=values)) %}
{% do storage_items.items.append(ix_lib.base.storage.storage_item(data={"type": "host_path", "mount_path": "/host/etc/os-release", "read_only": true, "host_path_config": {"path": "/etc/os-release", "create_host_path": false} })) %}
{% do storage_items.items.append(ix_lib.base.storage.storage_item(data={"type": "host_path", "mount_path": "/host/sys", "read_only": true, "host_path_config": {"path": "/sys", "create_host_path": false} })) %}
{% do storage_items.items.append(ix_lib.base.storage.storage_item(data={"type": "host_path", "mount_path": "/host/proc", "read_only": true, "host_path_config": {"path": "/proc", "create_host_path": false} })) %}
{% do storage_items.items.append(ix_lib.base.storage.storage_item(data={"type": "host_path", "mount_path": "/host/etc/passwd", "read_only": true, "host_path_config": {"path": "/etc/passwd", "create_host_path": false} })) %}
{% do storage_items.items.append(ix_lib.base.storage.storage_item(data={"type": "host_path", "mount_path": "/host/etc/group", "read_only": true, "host_path_config": {"path": "/etc/group", "create_host_path": false} })) %}
{% do storage_items.items.append(ix_lib.base.storage.storage_item(data={"type": "host_path", "mount_path": "/var/run/docker.sock", "read_only": true, "host_path_config": {"path": "/var/run/docker.sock", "create_host_path": false} })) %}
{% do storage_items.items.append(ix_lib.base.storage.storage_item(data={"type":"anonymous", "mount_path": "/tmp"})) %}
{% set tpl = ix_lib.base.render.Render(values) %}

{% set c1 = tpl.add_container(values.consts.netdata_container_name, "image") %}

{% do c1.add_caps(["CHOWN", "FOWNER", "DAC_OVERRIDE", "SETGID", "SETUID", "SYS_PTRACE"]) %}
{% do c1.remove_security_opt("no-new-privileges") %}
{% do c1.add_security_opt("apparmor=unconfined") %}

{% do c1.healthcheck.set_custom_test("/usr/sbin/health.sh") %}

{% do c1.environment.add_env("NETDATA_LISTENER_PORT", values.network.web_port) %}
{% do c1.environment.add_user_envs(values.netdata.additional_envs) %}

{% do c1.ports.add_port(values.network.web_port, values.network.web_port) %}

{% do c1.add_docker_socket() %}
{% do c1.add_storage("/host/etc/os-release", {"type": "host_path", "read_only": true, "host_path_config": {"path": "/etc/os-release"}}) %}
{% do c1.add_storage("/host/sys", {"type": "host_path", "read_only": true, "host_path_config": {"path": "/sys"}}) %}
{% do c1.add_storage("/host/proc", {"type": "host_path", "read_only": true, "host_path_config": {"path": "/proc"}}) %}
{% do c1.add_storage("/host/etc/passwd", {"type": "host_path", "read_only": true, "host_path_config": {"path": "/etc/passwd"}}) %}
{% do c1.add_storage("/host/etc/group", {"type": "host_path", "read_only": true, "host_path_config": {"path": "/etc/group"}}) %}

{% do c1.add_storage("/etc/netdata", values.storage.config) %}
{% do c1.add_storage("/var/cache/netdata", values.storage.cache) %}
{% do c1.add_storage("/var/lib/netdata", values.storage.lib) %}

{% for store in values.storage.additional_storage %}
{% do storage_items.items.append(ix_lib.base.storage.storage_item(data=store, values=values)) %}
{% do c1.add_storage(store.mount_path, store) %}
{% endfor %}

{# Add each item to the above lists #}
{% for item in storage_items.items %}
{% if item.vol and volumes.items.update(item.vol) %}{% endif %}
{% if item.vol_mount and volume_mounts.items.append(item.vol_mount) %}{% endif %}
{% endfor %}
{% do tpl.portals.add_portal({"port": values.network.web_port}) %}

{# Containers #}
services:
{{ values.consts.netdata_container_name }}:
image: {{ ix_lib.base.utils.get_image(images=values.images, name="image") }}
restart: unless-stopped
deploy:
resources: {{ ix_lib.base.resources.resources(values.resources) | tojson }}
devices: {{ ix_lib.base.resources.get_devices(values.resources) | tojson }}
{% if values.network.host_network %}
network_mode: host
{% endif %}
{% set caps = ix_lib.base.security.get_caps(add=["CHOWN", "FOWNER", "DAC_OVERRIDE", "SETGID", "SETUID", "SYS_PTRACE"]) %}
cap_add: {{ caps.add | tojson }}
cap_drop: {{ caps.drop | tojson }}
security_opt: {{ ix_lib.base.security.get_sec_opts(remove=["no-new-privileges"], add=["apparmor=unconfined"]) | tojson }}
{% if values.network.dns_opts %}
dns_opt: {{ ix_lib.base.network.dns_opts(values.network.dns_opts) | tojson }}
{% endif %}
healthcheck: {{ ix_lib.base.healthchecks.check_health("/usr/sbin/health.sh") | tojson }}
environment: {{ ix_lib.base.environment.envs(app={
"NETDATA_LISTENER_PORT": values.network.web_port,
}, user=values.netdata.additional_envs, values=values) | tojson }}
{% if not values.network.host_network %}
ports:
- {{ ix_lib.base.ports.get_port(port={"target": values.network.web_port, "published": values.network.web_port}) | tojson }}
{% endif %}
volumes: {{ volume_mounts.items | tojson }}

{% if volumes.items %}
volumes: {{ volumes.items | tojson }}
{% endif %}

x-portals: {{ ix_lib.base.metadata.get_portals([{"port": values.network.web_port}]) | tojson }}
x-notes: {{ ix_lib.base.metadata.get_notes("Netdata") | tojson }}
{{ tpl.render() | tojson }}
98 changes: 0 additions & 98 deletions ix-dev/stable/netdata/templates/library/base_v1_1_7/environment.py

This file was deleted.

120 changes: 0 additions & 120 deletions ix-dev/stable/netdata/templates/library/base_v1_1_7/healthchecks.py

This file was deleted.

Loading

0 comments on commit cecb1fc

Please sign in to comment.