Browse Source

HPCC-23824 Containerized logging configuration changes

Allow a global default

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 5 years ago
parent
commit
69c8dd4e31

+ 13 - 0
dockerfiles/hpcc/templates/_helpers.tpl

@@ -52,6 +52,19 @@ singleNode: {{ .Values.global.singleNode | default false }}
 {{- end -}}
 
 {{/*
+Generate local logging info, merged with global
+Pass in dict with root and me
+*/}}
+{{- define "hpcc.generateLoggingConfig" -}}
+{{- $logging := deepCopy .me | mergeOverwrite .root.Values.global }}
+{{- if hasKey $logging "logging" }}
+logging:
+{{ toYaml $logging.logging | indent 2 }}
+{{- end -}}
+{{- end -}}
+
+
+{{/*
 Add ConfigMap volume mount for a component
 */}}
 {{- define "hpcc.addConfigMapVolumeMount" -}}

+ 2 - 1
dockerfiles/hpcc/templates/dali.yaml

@@ -43,7 +43,8 @@ data:
   {{ .name }}.yaml: |
     version: 1.0
     dali:
-{{ toYaml . | indent 6 }}
+{{ toYaml (omit . "logging") | indent 6 }}
+{{- include "hpcc.generateLoggingConfig" (dict "root" $ "me" .) | indent 6 }}
     global:
 {{ include "hpcc.generateGlobalConfigMap" $ | indent 6 }}
 ---

+ 4 - 2
dockerfiles/hpcc/templates/eclagent.yaml

@@ -42,9 +42,11 @@ data:
   {{ .name }}.yaml: |
     version: 1.0
     eclagent:
-{{ toYaml . | indent 6 }}
+{{ toYaml (omit . "logging") | indent 6 }}
+{{- include "hpcc.generateLoggingConfig" (dict "root" $ "me" .) | indent 6 }}
     {{ $apptype }}:
-{{ toYaml . | indent 6 }}
+{{ toYaml (omit . "logging") | indent 6 }}
+{{- include "hpcc.generateLoggingConfig" (dict "root" $ "me" .) | indent 6 }}
     global:
 {{ include "hpcc.generateGlobalConfigMap" $ | indent 6 }}
   {{ $apptype }}-jobspec.yaml: |

+ 2 - 1
dockerfiles/hpcc/templates/eclccserver.yaml

@@ -42,7 +42,8 @@ data:
   {{ .name }}.yaml: |
     version: 1.0
     eclccserver:
-{{ toYaml . | indent 6 }}
+{{ toYaml (omit . "logging") | indent 6 }}
+{{- include "hpcc.generateLoggingConfig" (dict "root" $ "me" .) | indent 6 }}
       queues:
 {{ include "hpcc.generateConfigMapQueues" $ | indent 6 }}
     global:

+ 2 - 1
dockerfiles/hpcc/templates/esp.yaml

@@ -39,7 +39,8 @@ data:
   {{ .name }}.yaml: |
     version: 1.0
     esp:
-{{ toYaml . | indent 6 }}
+{{ toYaml (omit . "logging") | indent 6 }}
+{{- include "hpcc.generateLoggingConfig" (dict "root" $ "me" .) | indent 6 }}
       queues:
 {{ include "hpcc.generateConfigMapQueues" $ | indent 6 }}
     global:

+ 2 - 1
dockerfiles/hpcc/templates/localroxie.yaml

@@ -77,7 +77,8 @@ data:
   {{ $roxie.name }}.yaml: |
     version: 1.0
     roxie:
-{{ toYaml $roxie | indent 6 }}
+{{ toYaml (omit $roxie "logging") | indent 6 }}
+{{- include "hpcc.generateLoggingConfig" (dict "root" $ "me" $roxie) | indent 6 }}
     global:
 {{ include "hpcc.generateGlobalConfigMap" $ | indent 6 }}
 ---

+ 2 - 1
dockerfiles/hpcc/templates/roxie.yaml

@@ -75,7 +75,8 @@ data:
   {{ $roxie.name }}.yaml: |
     version: 1.0
     roxie:
-{{ toYaml $roxie | indent 6 }}
+{{ toYaml ( omit $roxie "logging") | indent 6 }}
+{{- include "hpcc.generateLoggingConfig" (dict "root" $ "me" $roxie) | indent 6 }}
     global:
 {{ include "hpcc.generateGlobalConfigMap" $ | indent 6 }}
 ---

+ 10 - 5
dockerfiles/hpcc/templates/thor.yaml

@@ -88,22 +88,27 @@ data:
   {{ $thorScope.name }}.yaml: |
     version: 1.0
     thor:
-{{ toYaml $thorScope | indent 6 }}
+{{ toYaml (omit $thorScope "logging") | indent 6 }}
+{{- include "hpcc.generateLoggingConfig" (dict "root" $ "me" $thorScope) | indent 6 }}
     {{ $agentAppType }}:
-{{ toYaml $hthorScope | indent 6 }}
+{{ toYaml (omit $hthorScope "logging") | indent 6 }}
+{{- include "hpcc.generateLoggingConfig" (dict "root" $ "me" $hthorScope) | indent 6 }}
     eclagent: # main agent Q handler
-{{ toYaml $eclAgentScope | indent 6 }}
+{{ toYaml (omit $eclAgentScope "logging") | indent 6 }}
+{{- include "hpcc.generateLoggingConfig" (dict "root" $ "me" $eclAgentScope) | indent 6 }}
     global:
 {{ include "hpcc.generateGlobalConfigMap" $ | indent 6 }}
 
   {{ $thorAgentScope.name }}.yaml: |
     version: 1.0
     eclagent:
-{{ toYaml $thorAgentScope | indent 6 }}
+{{ toYaml (omit $thorAgentScope "logging") | indent 6 }}
+{{- include "hpcc.generateLoggingConfig" (dict "root" $ "me" $thorAgentScope) | indent 6 }}
       type: thor
 {{- if $thorAgentScope.useChildProceses }}
     thor:
-{{ toYaml $thorScope | indent 6 }}
+{{ toYaml (omit $thorScope "logging") | indent 6 }}
+{{- include "hpcc.generateLoggingConfig" (dict "root" $ "me" $thorScope) | indent 6 }}
 {{- end }}
     global:
 {{ include "hpcc.generateGlobalConfigMap" $ | indent 6 }}

+ 22 - 19
dockerfiles/hpcc/values.schema.json

@@ -74,6 +74,9 @@
         },
         "image": {
           "$ref": "#/definitions/image"
+        },
+        "logging": {
+          "$ref": "#/definitions/logging"
         }
       },
       "additionalProperties": false
@@ -111,6 +114,24 @@
       "required": [ "storageSize" ],
       "additionalProperties": false
     },
+    "logging": {
+      "type": "object",
+      "properties": {
+        "audiences": {
+          "type": "string",
+          "description": "List of target audiences to include in logging output. Comprised of 3 letter codes delimited by + or -"
+        },
+        "classes": {
+          "type": "string",
+          "description": "List of target logging classes to include in output. Comprised of 3 letter codes delimited by + or -"
+        },
+        "detail": {
+          "type": "integer",
+          "description": "Log output verbosity"
+        }
+      },
+      "additionalProperties": { "type": ["integer", "string", "boolean"] }
+    },
     "dali": {
       "type": "object",
       "required": [ "name", "storage" ],
@@ -270,7 +291,7 @@
           "type": "string",
           "description": "The (optional) file prefix to add to relative filenames"
         },
-	"numSlaves": {
+        "numSlaves": {
           "type": "integer",
           "description": "The number of slave pods",
           "minimum": 1
@@ -288,24 +309,6 @@
           "$ref": "#/definitions/logging"
         }
       }
-    },
-    "logging": {
-      "type": "object",
-      "properties": {
-        "audiences": {
-          "type": "string",
-          "description": "List of target audiences to include in logging output. Comprised of 3 letter codes delimited by + or -"
-        },
-        "classes": {
-          "type": "string",
-          "description": "List of target logging classes to include in output. Comprised of 3 letter codes delimited by + or -"
-        },
-        "detail": {
-          "type": "integer",
-          "description": "Log output verbosity"
-        }
-      },
-      "additionalProperties": false
     }
   }
 }

+ 3 - 0
dockerfiles/hpcc/values.yaml

@@ -35,6 +35,9 @@ global:
   # This will cause initContainers to be created to ensure that host mount points have correct uid/gid
   hostStorage: true
 
+  # logging sets the default logging information for all components. Can be overridden locally
+  logging:
+    detail: 100
 
 dali:
 - name: mydali