From 762cef0d09af981fa2e27c74c85ad1236ffaeafb Mon Sep 17 00:00:00 2001 From: Emil Natan Date: Sun, 17 Mar 2024 13:48:34 +0200 Subject: [PATCH] Use the TektonConfig to customize the logging We have been using kustomize to create ConfigMap (config-logging) to customize the pipelines' pods logs to adhere with ADR-6. That configuration is now overriden by the Tekton operator. We use the TektonConfig now to customize the logs. Added configuration for triggers log. --- .../openshift-pipelines/config-logging.yaml | 42 ------------- .../openshift-pipelines/kustomization.yaml | 1 - .../openshift-pipelines/tekton-config.yaml | 63 +++++++++++++++++++ 3 files changed, 63 insertions(+), 43 deletions(-) delete mode 100644 operator/gitops/argocd/pipeline-service/openshift-pipelines/config-logging.yaml diff --git a/operator/gitops/argocd/pipeline-service/openshift-pipelines/config-logging.yaml b/operator/gitops/argocd/pipeline-service/openshift-pipelines/config-logging.yaml deleted file mode 100644 index a23cb8436..000000000 --- a/operator/gitops/argocd/pipeline-service/openshift-pipelines/config-logging.yaml +++ /dev/null @@ -1,42 +0,0 @@ ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: config-logging - namespace: openshift-pipelines - labels: - app.kubernetes.io/component: resolvers - app.kubernetes.io/part-of: tekton-pipelines - app.kubernetes.io/instance: default - operator.tekton.dev/operand-name: tektoncd-pipelines - annotations: - argocd.argoproj.io/sync-wave: "1" -data: - zap-logger-config: | - { - "level": "info", - "development": false, - "sampling": { - "initial": 100, - "thereafter": 100 - }, - "outputPaths": ["stdout"], - "errorOutputPaths": ["stderr"], - "encoding": "json", - "encoderConfig": { - "timeKey": "ts", - "levelKey": "level", - "nameKey": "logger", - "callerKey": "caller", - "messageKey": "msg", - "stacktraceKey": "stacktrace", - "lineEnding": "", - "levelEncoder": "", - "timeEncoder": "iso8601", - "durationEncoder": "string", - "callerEncoder": "" - } - } - # Log level overrides - loglevel.controller: "info" - loglevel.webhook: "info" diff --git a/operator/gitops/argocd/pipeline-service/openshift-pipelines/kustomization.yaml b/operator/gitops/argocd/pipeline-service/openshift-pipelines/kustomization.yaml index 1be4e8905..bff4d5ba5 100644 --- a/operator/gitops/argocd/pipeline-service/openshift-pipelines/kustomization.yaml +++ b/operator/gitops/argocd/pipeline-service/openshift-pipelines/kustomization.yaml @@ -7,7 +7,6 @@ resources: - appstudio-pipelines-scc.yaml - openshift-operator.yaml - tekton-config.yaml - - config-logging.yaml - chains-service-monitor.yaml - bugfix-pac-gitauth-secrets.yaml # Manually add ConfigMap and Service until PLNSRVCE-1359 is fixed diff --git a/operator/gitops/argocd/pipeline-service/openshift-pipelines/tekton-config.yaml b/operator/gitops/argocd/pipeline-service/openshift-pipelines/tekton-config.yaml index 10b44799a..3c1915ab9 100644 --- a/operator/gitops/argocd/pipeline-service/openshift-pipelines/tekton-config.yaml +++ b/operator/gitops/argocd/pipeline-service/openshift-pipelines/tekton-config.yaml @@ -43,6 +43,39 @@ spec: # Rekor integration is disabled for now. It is planned to be re-introduced in the future. transparency.enabled: "false" + trigger: + options: + configMaps: + config-logging-triggers: + data: + loglevel.controller: info + loglevel.webhook: info + loglevel.eventlistener: info + zap-logger-config: | + { + "level": "info", + "development": false, + "sampling": { + "initial": 100, + "thereafter": 100 + }, + "outputPaths": ["stdout"], + "errorOutputPaths": ["stderr"], + "encoding": "json", + "encoderConfig": { + "timeKey": "ts", + "levelKey": "level", + "nameKey": "logger", + "callerKey": "caller", + "messageKey": "msg", + "stacktraceKey": "stacktrace", + "lineEnding": "", + "levelEncoder": "", + "timeEncoder": "iso8601", + "durationEncoder": "string", + "callerEncoder": "" + } + } pipeline: default-service-account: appstudio-pipeline enable-api-fields: alpha @@ -53,6 +86,36 @@ spec: enable-tekton-oci-bundles: true options: disabled: false + configMaps: + config-logging: + data: + loglevel.controller: info + loglevel.webhook: info + zap-logger-config: | + { + "level": "info", + "development": false, + "sampling": { + "initial": 100, + "thereafter": 100 + }, + "outputPaths": ["stdout"], + "errorOutputPaths": ["stderr"], + "encoding": "json", + "encoderConfig": { + "timeKey": "ts", + "levelKey": "level", + "nameKey": "logger", + "callerKey": "caller", + "messageKey": "msg", + "stacktraceKey": "stacktrace", + "lineEnding": "", + "levelEncoder": "", + "timeEncoder": "iso8601", + "durationEncoder": "string", + "callerEncoder": "" + } + } deployments: tekton-operator-proxy-webhook: spec: