diff --git a/charts/nobl9-agent/values.schema.json b/charts/nobl9-agent/values.schema.json index e40e4f5..531c3c1 100644 --- a/charts/nobl9-agent/values.schema.json +++ b/charts/nobl9-agent/values.schema.json @@ -1,6 +1,6 @@ { "type": "object", - "$schema": "http://json-schema.org/draft-07/schema", + "$schema": "https://json-schema.org/draft-07/schema#", "required": [ "command", "config", @@ -33,129 +33,72 @@ ], "properties": { "image": { - "type": [ - "string" - ], + "type": "string", "description": "Image used by chart", "default": "nobl9/agent" }, "version": { - "type": [ - "string" - ], + "type": "string", "description": "Agent version (image tag)", "default": "\"0.69.2\"" }, "pullPolicy": { - "type": [ - "string" - ], + "type": "string", "description": "Image Pull Policy", "default": "Always" }, "extraEnvs": { "type": [ - "object", + "array", "null" ], "description": "Additional Envs", "required": [], "properties": { "name": { - "type": [ - "string" - ] + "type": "string" }, "value": { - "type": [ - "string" - ] + "type": "string" }, "valueFrom": { - "type": "object", - "required": [], - "properties": { - "secretKeyRef": { - "type": "object", - "required": [], - "properties": { - "key": { - "type": [ - "string" - ] - }, - "name": { - "type": [ - "string" - ] - } - } - } - } + "type": "object" } } }, "extraVolumes": { "type": [ - "object", + "array", "null" ], "description": "Additional Volumes", - "required": [], "properties": { "name": { - "type": [ - "string" - ] - }, - "secret": { - "type": "object", - "required": [], - "properties": { - "defaultMode": { - "type": [ - "string" - ] - }, - "secretName": { - "type": [ - "string" - ] - } - } + "type": "string" } } }, "extraVolumeMounts": { "type": [ - "object", + "array", "null" ], "description": "Additional Volume mounts", "required": [], "properties": { "mountPath": { - "type": [ - "string" - ] + "type": "string" }, "name": { - "type": [ - "string" - ] + "type": "string" }, "readOnly": { - "type": [ - "boolean" - ], - "default": "true" + "type": "boolean" } } }, "annotations": { - "type": [ - "object" - ], + "type": "object", "description": "Custom annotations" } } @@ -196,16 +139,12 @@ ], "properties": { "cpu": { - "type": [ - "string" - ], + "type": "string", "description": "CPU request", "default": "\"0.1\"" }, "memory": { - "type": [ - "string" - ], + "type": "string", "description": "Memory request", "default": "\"350Mi\"" } @@ -219,16 +158,12 @@ ], "properties": { "cpu": { - "type": [ - "string" - ], + "type": "string", "description": "CPU limit", "default": "\"1.0\"" }, "memory": { - "type": [ - "string" - ], + "type": "string", "description": "Memory limit", "default": "\"1Gi\"" } @@ -246,30 +181,22 @@ ], "properties": { "allowPrivilegeEscalation": { - "type": [ - "boolean" - ], + "type": "boolean", "description": "Grants container a privileged status if set to true", "default": "false" }, "readOnlyRootFilesystem": { - "type": [ - "boolean" - ], + "type": "boolean", "description": "ReadOnly file system mode if set to true", "default": "true" }, "runAsNonRoot": { - "type": [ - "boolean" - ], + "type": "boolean", "description": "Runs the container as a root user if set to false", "default": "true" }, "runAsUser": { - "type": [ - "number" - ], + "type": "number", "description": "Runs the container with specified PID", "default": "2000" } @@ -282,9 +209,7 @@ ], "properties": { "create": { - "type": [ - "boolean" - ], + "type": "boolean", "description": "Allow chart to create service account.", "default": "true" }, @@ -314,10 +239,6 @@ "config": { "type": "object", "required": [ - "project", - "organization", - "clientId", - "clientSecret", "intakeUrl", "authServer", "oktaOrgUrl" @@ -325,13 +246,15 @@ "properties": { "project": { "type": [ - "string" + "string", + "null" ], "description": "Nobl9 Project name" }, "organization": { "type": [ - "string" + "string", + "null" ], "description": "Nobl9 Organization name" }, @@ -343,35 +266,23 @@ "description": "Nobl9 Data Source name" }, "clientId": { - "type": [ - "string" - ], "description": "Nobl9 Client ID, creates secret with this value, leave empty and use deployment.extraEnvs to load from existing Secret" }, "clientSecret": { - "type": [ - "string" - ], "description": "Nobl9 Client secret, creates secret with this value, leave empty and use deployment.extraEnvs to load from existing Secret" }, "intakeUrl": { - "type": [ - "string" - ], + "type": "string", "description": "Nobl9 API URL", "default": "\"https://app.nobl9.com/api/input\"" }, "authServer": { - "type": [ - "string" - ], + "type": "string", "description": "Nobl9 Auth Server ID", "default": "\"auseg9kiegWKEtJZC416\"" }, "oktaOrgUrl": { - "type": [ - "string" - ], + "type": "string", "description": "Nobl9 Okta Organization URL", "default": "\"https://accounts.nobl9.com\"" }, @@ -385,9 +296,7 @@ } }, "command": { - "type": [ - "array" - ], + "type": "array", "description": "Container command", "default": ["telegraf"] }, @@ -398,5 +307,95 @@ ], "description": "# -- Allow to pass additional arguments to the telegraf command for ex. \"--debug\"" } - } + }, + "allOf": [ + { + "if": { + "properties": { + "deployment": { + "properties": { + "extraEnvs": { + "type": "array", + "contains": { + "type": "object", + "properties": { + "name": { + "type": "string", + "const": "N9_CLIENT_SECRET" + } + } + } + } + } + } + } + }, + "then": { + "properties": { + "config": { + "properties": { + "clientSecret": { + "type": "null" + } + } + } + } + }, + "else": { + "properties": { + "config": { + "properties": { + "clientSecret": { + "type": "string" + } + } + } + } + } + }, + { + "if": { + "properties": { + "deployment": { + "properties": { + "extraEnvs": { + "type": "array", + "contains": { + "type": "object", + "properties": { + "name": { + "type": "string", + "const": "N9_CLIENT_ID" + } + } + } + } + } + } + } + }, + "then": { + "properties": { + "config": { + "properties": { + "clientId": { + "type": "null" + } + } + } + } + }, + "else": { + "properties": { + "config": { + "properties": { + "clientId": { + "type": "string" + } + } + } + } + } + } + ] } \ No newline at end of file