From 8bafd459e7b83d60619e76388bb710528a9499d9 Mon Sep 17 00:00:00 2001 From: Julien Guitton Date: Thu, 11 Jan 2024 10:59:47 +0100 Subject: [PATCH 01/10] Update logback.xml template for 2.0.0-M1 and make it optional --- pkg/nificlient/config/common/common.go | 6 +- pkg/resources/nifi/secretconfig.go | 24 ++- pkg/resources/templates/config/logback.xml.go | 180 +++++++++++++++--- 3 files changed, 173 insertions(+), 37 deletions(-) diff --git a/pkg/nificlient/config/common/common.go b/pkg/nificlient/config/common/common.go index 1926776b8b..f85b8e95bf 100644 --- a/pkg/nificlient/config/common/common.go +++ b/pkg/nificlient/config/common/common.go @@ -8,7 +8,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/konpyutaika/nifikop/api/v1" + v1 "github.com/konpyutaika/nifikop/api/v1" "github.com/konpyutaika/nifikop/pkg/pki" "github.com/konpyutaika/nifikop/pkg/pki/certmanagerpki" "github.com/konpyutaika/nifikop/pkg/util" @@ -101,3 +101,7 @@ func generateNodesAddressFromTemplate(nodes []v1.Node, template string) map[int3 func UseSSL(cluster *v1.NifiCluster) bool { return cluster.Spec.ListenersConfig.SSLSecrets != nil } + +func MustOverrideLogback(cluster *v1.NifiCluster) bool { + return false +} diff --git a/pkg/resources/nifi/secretconfig.go b/pkg/resources/nifi/secretconfig.go index 53fcb4fdc0..cacb5a7821 100644 --- a/pkg/resources/nifi/secretconfig.go +++ b/pkg/resources/nifi/secretconfig.go @@ -43,7 +43,6 @@ func (r *Reconciler) secretConfig(id int32, nodeConfig *v1.NodeConfig, serverPas "zookeeper.properties": []byte(r.generateZookeeperPropertiesNodeConfig(id, nodeConfig, log)), "state-management.xml": []byte(r.getStateManagementConfigString(nodeConfig, id, log)), "login-identity-providers.xml": []byte(r.getLoginIdentityProvidersConfigString(nodeConfig, id, log)), - "logback.xml": []byte(r.getLogbackConfigString(nodeConfig, id, log)), "bootstrap.conf": []byte(r.generateBootstrapPropertiesNodeConfig(id, nodeConfig, log)), "bootstrap-notification-services.xml": []byte(r.getBootstrapNotificationServicesConfigString(nodeConfig, id, log)), }, @@ -52,6 +51,12 @@ func (r *Reconciler) secretConfig(id int32, nodeConfig *v1.NodeConfig, serverPas if configcommon.UseSSL(r.NifiCluster) { secret.Data["authorizers.xml"] = []byte(r.getAuthorizersConfigString(nodeConfig, id, log)) } + + logbackConfigString := r.getLogbackConfigString(nodeConfig, id, log) + if logbackConfigString != nil { + secret.Data["logback.xml"] = []byte(*logbackConfigString) + } + return secret } @@ -310,13 +315,13 @@ func (r *Reconciler) getLoginIdentityProvidersConfigString(nConfig *v1.NodeConfi // Logback configuration // //////////////////////////// -func (r *Reconciler) getLogbackConfigString(nConfig *v1.NodeConfig, id int32, log zap.Logger) string { +func (r *Reconciler) getLogbackConfigString(nConfig *v1.NodeConfig, id int32, log zap.Logger) *string { for _, node := range r.NifiCluster.Spec.Nodes { if node.Id == id && node.ReadOnlyConfig != nil && &node.ReadOnlyConfig.LogbackConfig != (&v1.LogbackConfig{}) { if node.ReadOnlyConfig.LogbackConfig.ReplaceSecretConfig != nil { conf, err := r.getSecrectConfig(context.TODO(), *node.ReadOnlyConfig.LogbackConfig.ReplaceSecretConfig) if err == nil { - return conf + return &conf } log.Error("error occurred during getting readonly secret config", zap.String("clusterName", r.NifiCluster.Name), @@ -327,7 +332,7 @@ func (r *Reconciler) getLogbackConfigString(nConfig *v1.NodeConfig, id int32, lo if node.ReadOnlyConfig.LogbackConfig.ReplaceConfigMap != nil { conf, err := r.getConfigMap(context.TODO(), *node.ReadOnlyConfig.LogbackConfig.ReplaceConfigMap) if err == nil { - return conf + return &conf } log.Error("error occurred during getting readonly configmap", zap.String("clusterName", r.NifiCluster.Name), @@ -341,7 +346,7 @@ func (r *Reconciler) getLogbackConfigString(nConfig *v1.NodeConfig, id int32, lo if r.NifiCluster.Spec.ReadOnlyConfig.LogbackConfig.ReplaceSecretConfig != nil { conf, err := r.getSecrectConfig(context.TODO(), *r.NifiCluster.Spec.ReadOnlyConfig.LogbackConfig.ReplaceSecretConfig) if err == nil { - return conf + return &conf } log.Error("error occurred during getting readonly secret config", zap.String("clusterName", r.NifiCluster.Name), @@ -352,7 +357,7 @@ func (r *Reconciler) getLogbackConfigString(nConfig *v1.NodeConfig, id int32, lo if r.NifiCluster.Spec.ReadOnlyConfig.LogbackConfig.ReplaceConfigMap != nil { conf, err := r.getConfigMap(context.TODO(), *r.NifiCluster.Spec.ReadOnlyConfig.LogbackConfig.ReplaceConfigMap) if err == nil { - return conf + return &conf } log.Error("error occurred during getting readonly configmap", zap.String("clusterName", r.NifiCluster.Name), @@ -360,6 +365,10 @@ func (r *Reconciler) getLogbackConfigString(nConfig *v1.NodeConfig, id int32, lo zap.Error(err)) } + if !configcommon.MustOverrideLogback(r.NifiCluster) { + return nil + } + var out bytes.Buffer t := template.Must(template.New("nConfig-config").Parse(config.LogbackTemplate)) if err := t.Execute(&out, map[string]interface{}{ @@ -371,7 +380,8 @@ func (r *Reconciler) getLogbackConfigString(nConfig *v1.NodeConfig, id int32, lo zap.Int32("nodeId", id), zap.Error(err)) } - return out.String() + output := out.String() + return &output } /////////////////////////////////////////////////// diff --git a/pkg/resources/templates/config/logback.xml.go b/pkg/resources/templates/config/logback.xml.go index 08f0cd059e..5e9754db89 100644 --- a/pkg/resources/templates/config/logback.xml.go +++ b/pkg/resources/templates/config/logback.xml.go @@ -1,25 +1,28 @@ package config -var LogbackTemplate = ` - + + + true - + ${org.apache.nifi.bootstrap.config.log.dir}/nifi-app.log @@ -30,16 +33,21 @@ var LogbackTemplate = ` To ZIP rolled files, replace '.log' with '.log.zip'. --> ${org.apache.nifi.bootstrap.config.log.dir}/nifi-app_%d{yyyy-MM-dd_HH}.%i.log + 100MB - + 30 + + 3GB + + true true %date %level [%thread] %logger{40} %msg%n - + ${org.apache.nifi.bootstrap.config.log.dir}/nifi-user.log @@ -50,59 +58,138 @@ var LogbackTemplate = ` To ZIP rolled files, replace '.log' with '.log.zip'. --> ${org.apache.nifi.bootstrap.config.log.dir}/nifi-user_%d.log - + 30 + + 3GB + + true %date %level [%thread] %logger{40} %msg%n + + ${org.apache.nifi.bootstrap.config.log.dir}/nifi-request.log + + ${org.apache.nifi.bootstrap.config.log.dir}/nifi-request_%d.log + + 30 + + 3GB + + true + + + %msg%n + + + ${org.apache.nifi.bootstrap.config.log.dir}/nifi-bootstrap.log ${org.apache.nifi.bootstrap.config.log.dir}/nifi-bootstrap_%d.log - - 5 + + 30 + + 3GB + + true %date %level [%thread] %logger{40} %msg%n - + + + ${org.apache.nifi.bootstrap.config.log.dir}/nifi-deprecation.log + + ${org.apache.nifi.bootstrap.config.log.dir}/nifi-deprecation_%d.%i.log + + 10MB + + 10 + + 100MB + + true + + + %date %level [%thread] %logger %msg%n + + + + + + + + ${org.apache.nifi.bootstrap.config.log.dir}/nifi-app-${logFileSuffix}.log + + + ${org.apache.nifi.bootstrap.config.log.dir}/nifi-app-${logFileSuffix}_%d{yyyy-MM-dd_HH}.%i.log + + 100MB + + 30 + + 3GB + + true + + true + + %date %level [%thread] %logger{40} %msg%n + + + + + %date %level [%thread] %logger{40} %msg%n - + - + + + + + + - - + + + + - + @@ -114,10 +201,35 @@ var LogbackTemplate = ` - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -155,16 +274,19 @@ var LogbackTemplate = ` - + + + + - + - + ` From 8e184eb6b65b07dcb0d25f41fa943f22325c3fe8 Mon Sep 17 00:00:00 2001 From: Julien Guitton Date: Thu, 11 Jan 2024 11:04:18 +0100 Subject: [PATCH 02/10] Update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e8838e510b..fca8511e13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ - [PR #349](https://github.com/konpyutaika/nifikop/pull/349) - **[Operator/NifiRegistryClient]** Set FlowRegistry type in RegistryClient creation. - [PR #350](https://github.com/konpyutaika/nifikop/pull/350) - **[Operator]** Remove optimistic lock on `Patch`. - [PR #352](https://github.com/konpyutaika/nifikop/pull/352) - **[Operator]** Changed default LogLevel of NiFi from `DEBUG` to `INFO`. +- [PR #353](https://github.com/konpyutaika/nifikop/pull/353) - **[Operator/NifiCluster]** Updated `logback.xml` template for 2.0.0-M1 and made it optional (by default disabled). ### Fixed Bugs From b24be6aece0ba4e2cf35124d066340d3bb83de81 Mon Sep 17 00:00:00 2001 From: Julien Guitton Date: Thu, 11 Jan 2024 11:04:18 +0100 Subject: [PATCH 03/10] Update CHANGELOG --- CHANGELOG.md | 1 + pkg/resources/templates/config/logback.xml.go | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e8838e510b..fca8511e13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ - [PR #349](https://github.com/konpyutaika/nifikop/pull/349) - **[Operator/NifiRegistryClient]** Set FlowRegistry type in RegistryClient creation. - [PR #350](https://github.com/konpyutaika/nifikop/pull/350) - **[Operator]** Remove optimistic lock on `Patch`. - [PR #352](https://github.com/konpyutaika/nifikop/pull/352) - **[Operator]** Changed default LogLevel of NiFi from `DEBUG` to `INFO`. +- [PR #353](https://github.com/konpyutaika/nifikop/pull/353) - **[Operator/NifiCluster]** Updated `logback.xml` template for 2.0.0-M1 and made it optional (by default disabled). ### Fixed Bugs diff --git a/pkg/resources/templates/config/logback.xml.go b/pkg/resources/templates/config/logback.xml.go index 5e9754db89..54a94d9df1 100644 --- a/pkg/resources/templates/config/logback.xml.go +++ b/pkg/resources/templates/config/logback.xml.go @@ -1,15 +1,15 @@ package config -var LogbackTemplate = ` - + + true @@ -29,9 +31,14 @@ To ZIP rolled files, replace '.log' with '.log.zip'. --> ${org.apache.nifi.bootstrap.config.log.dir}/nifi-app_%d{yyyy-MM-dd_HH}.%i.log - 5MB - 2 - 15MB + + 100MB + + 30 + + 3GB + + true true @@ -41,43 +48,112 @@ ${org.apache.nifi.bootstrap.config.log.dir}/nifi-user.log - + - ${org.apache.nifi.bootstrap.config.log.dir}/nifi-user_%d{yyyy-MM-dd_HH}.%i.log - 2 - 5MB - 15MB + ${org.apache.nifi.bootstrap.config.log.dir}/nifi-user_%d.log + + 30 + + 3GB + + true %date %level [%thread] %logger{40} %msg%n + + ${org.apache.nifi.bootstrap.config.log.dir}/nifi-request.log + + ${org.apache.nifi.bootstrap.config.log.dir}/nifi-request_%d.log + + 30 + + 3GB + + true + + + %msg%n + + + ${org.apache.nifi.bootstrap.config.log.dir}/nifi-bootstrap.log - + - ${org.apache.nifi.bootstrap.config.log.dir}/nifi-bootstrap_%d{yyyy-MM-dd_HH}.%i.log - - 2 - 5MB - 15MB + ${org.apache.nifi.bootstrap.config.log.dir}/nifi-bootstrap_%d.log + + 30 + + 3GB + + true %date %level [%thread] %logger{40} %msg%n + + ${org.apache.nifi.bootstrap.config.log.dir}/nifi-deprecation.log + + ${org.apache.nifi.bootstrap.config.log.dir}/nifi-deprecation_%d.%i.log + + 10MB + + 10 + + 100MB + + true + + + %date %level [%thread] %logger %msg%n + + + + + + + + ${org.apache.nifi.bootstrap.config.log.dir}/nifi-app-${logFileSuffix}.log + + + ${org.apache.nifi.bootstrap.config.log.dir}/nifi-app-${logFileSuffix}_%d{yyyy-MM-dd_HH}.%i.log + + 100MB + + 30 + + 3GB + + true + + true + + %date %level [%thread] %logger{40} %msg%n + + + + + %date %level [%thread] %logger{40} %msg%n @@ -86,12 +162,17 @@ + + + + + - + @@ -100,8 +181,7 @@ - - + @@ -119,6 +199,7 @@ + @@ -134,15 +215,17 @@ - + + + + - + + + + @@ -182,24 +264,26 @@ + - - - + + + + \ No newline at end of file From f3e35548e8715fea222b258ef1ab2c8707ba466c Mon Sep 17 00:00:00 2001 From: Julien Guitton Date: Thu, 11 Jan 2024 11:52:39 +0100 Subject: [PATCH 06/10] Revert --- helm/nifi-cluster/config/logback.xml | 140 ++++++--------------------- 1 file changed, 28 insertions(+), 112 deletions(-) diff --git a/helm/nifi-cluster/config/logback.xml b/helm/nifi-cluster/config/logback.xml index 7737d1b658..0fe78cf6a6 100644 --- a/helm/nifi-cluster/config/logback.xml +++ b/helm/nifi-cluster/config/logback.xml @@ -15,8 +15,6 @@ --> - - true @@ -31,14 +29,9 @@ To ZIP rolled files, replace '.log' with '.log.zip'. --> ${org.apache.nifi.bootstrap.config.log.dir}/nifi-app_%d{yyyy-MM-dd_HH}.%i.log - - 100MB - - 30 - - 3GB - - true + 5MB + 2 + 15MB true @@ -48,112 +41,43 @@ ${org.apache.nifi.bootstrap.config.log.dir}/nifi-user.log - + - ${org.apache.nifi.bootstrap.config.log.dir}/nifi-user_%d.log - - 30 - - 3GB - - true + ${org.apache.nifi.bootstrap.config.log.dir}/nifi-user_%d{yyyy-MM-dd_HH}.%i.log + 2 + 5MB + 15MB %date %level [%thread] %logger{40} %msg%n - - ${org.apache.nifi.bootstrap.config.log.dir}/nifi-request.log - - ${org.apache.nifi.bootstrap.config.log.dir}/nifi-request_%d.log - - 30 - - 3GB - - true - - - %msg%n - - - ${org.apache.nifi.bootstrap.config.log.dir}/nifi-bootstrap.log - + - ${org.apache.nifi.bootstrap.config.log.dir}/nifi-bootstrap_%d.log - - 30 - - 3GB - - true + ${org.apache.nifi.bootstrap.config.log.dir}/nifi-bootstrap_%d{yyyy-MM-dd_HH}.%i.log + + 2 + 5MB + 15MB %date %level [%thread] %logger{40} %msg%n - - ${org.apache.nifi.bootstrap.config.log.dir}/nifi-deprecation.log - - ${org.apache.nifi.bootstrap.config.log.dir}/nifi-deprecation_%d.%i.log - - 10MB - - 10 - - 100MB - - true - - - %date %level [%thread] %logger %msg%n - - - - - - - - ${org.apache.nifi.bootstrap.config.log.dir}/nifi-app-${logFileSuffix}.log - - - ${org.apache.nifi.bootstrap.config.log.dir}/nifi-app-${logFileSuffix}_%d{yyyy-MM-dd_HH}.%i.log - - 100MB - - 30 - - 3GB - - true - - true - - %date %level [%thread] %logger{40} %msg%n - - - - - %date %level [%thread] %logger{40} %msg%n @@ -162,17 +86,12 @@ - - - - - - + @@ -181,7 +100,8 @@ - + + @@ -199,7 +119,6 @@ - @@ -215,17 +134,15 @@ - + - - - + - - + + + + - - - - + \ No newline at end of file From 95035278d4dc033ad09de87afd242baefbefaf47 Mon Sep 17 00:00:00 2001 From: Julien Guitton Date: Thu, 11 Jan 2024 11:55:55 +0100 Subject: [PATCH 07/10] Update helm chart logback.xml --- helm/nifi-cluster/config/logback.xml | 137 ++++++++++++++++++++++----- 1 file changed, 113 insertions(+), 24 deletions(-) diff --git a/helm/nifi-cluster/config/logback.xml b/helm/nifi-cluster/config/logback.xml index 0fe78cf6a6..9852c27836 100644 --- a/helm/nifi-cluster/config/logback.xml +++ b/helm/nifi-cluster/config/logback.xml @@ -15,6 +15,8 @@ --> + + true @@ -29,9 +31,14 @@ To ZIP rolled files, replace '.log' with '.log.zip'. --> ${org.apache.nifi.bootstrap.config.log.dir}/nifi-app_%d{yyyy-MM-dd_HH}.%i.log - 5MB - 2 - 15MB + + 100MB + + 30 + + 3GB + + true true @@ -41,43 +48,112 @@ ${org.apache.nifi.bootstrap.config.log.dir}/nifi-user.log - + - ${org.apache.nifi.bootstrap.config.log.dir}/nifi-user_%d{yyyy-MM-dd_HH}.%i.log - 2 - 5MB - 15MB + ${org.apache.nifi.bootstrap.config.log.dir}/nifi-user_%d.log + + 30 + + 3GB + + true %date %level [%thread] %logger{40} %msg%n + + ${org.apache.nifi.bootstrap.config.log.dir}/nifi-request.log + + ${org.apache.nifi.bootstrap.config.log.dir}/nifi-request_%d.log + + 30 + + 3GB + + true + + + %msg%n + + + ${org.apache.nifi.bootstrap.config.log.dir}/nifi-bootstrap.log - + - ${org.apache.nifi.bootstrap.config.log.dir}/nifi-bootstrap_%d{yyyy-MM-dd_HH}.%i.log - - 2 - 5MB - 15MB + ${org.apache.nifi.bootstrap.config.log.dir}/nifi-bootstrap_%d.log + + 30 + + 3GB + + true %date %level [%thread] %logger{40} %msg%n + + ${org.apache.nifi.bootstrap.config.log.dir}/nifi-deprecation.log + + ${org.apache.nifi.bootstrap.config.log.dir}/nifi-deprecation_%d.%i.log + + 10MB + + 10 + + 100MB + + true + + + %date %level [%thread] %logger %msg%n + + + + + + + + ${org.apache.nifi.bootstrap.config.log.dir}/nifi-app-${logFileSuffix}.log + + + ${org.apache.nifi.bootstrap.config.log.dir}/nifi-app-${logFileSuffix}_%d{yyyy-MM-dd_HH}.%i.log + + 100MB + + 30 + + 3GB + + true + + true + + %date %level [%thread] %logger{40} %msg%n + + + + + %date %level [%thread] %logger{40} %msg%n @@ -86,12 +162,17 @@ + + + + + - + @@ -100,8 +181,7 @@ - - + @@ -119,6 +199,7 @@ + @@ -134,11 +215,14 @@ - + + + + @@ -162,19 +246,18 @@ - - - - - - + + + + + @@ -182,6 +265,7 @@ + @@ -202,4 +286,9 @@ + + + + + \ No newline at end of file From 8114c23f3a534540d8adb90d8627c05f52b28264 Mon Sep 17 00:00:00 2001 From: Julien Guitton Date: Thu, 11 Jan 2024 15:00:39 +0100 Subject: [PATCH 08/10] Delete logback.xml template --- pkg/nificlient/config/common/common.go | 4 - pkg/resources/nifi/secretconfig.go | 21 +- pkg/resources/templates/config/logback.xml.go | 292 ------------------ 3 files changed, 2 insertions(+), 315 deletions(-) delete mode 100644 pkg/resources/templates/config/logback.xml.go diff --git a/pkg/nificlient/config/common/common.go b/pkg/nificlient/config/common/common.go index f85b8e95bf..82e1b2d1c5 100644 --- a/pkg/nificlient/config/common/common.go +++ b/pkg/nificlient/config/common/common.go @@ -101,7 +101,3 @@ func generateNodesAddressFromTemplate(nodes []v1.Node, template string) map[int3 func UseSSL(cluster *v1.NifiCluster) bool { return cluster.Spec.ListenersConfig.SSLSecrets != nil } - -func MustOverrideLogback(cluster *v1.NifiCluster) bool { - return false -} diff --git a/pkg/resources/nifi/secretconfig.go b/pkg/resources/nifi/secretconfig.go index cacb5a7821..bb7ea14e47 100644 --- a/pkg/resources/nifi/secretconfig.go +++ b/pkg/resources/nifi/secretconfig.go @@ -52,8 +52,7 @@ func (r *Reconciler) secretConfig(id int32, nodeConfig *v1.NodeConfig, serverPas secret.Data["authorizers.xml"] = []byte(r.getAuthorizersConfigString(nodeConfig, id, log)) } - logbackConfigString := r.getLogbackConfigString(nodeConfig, id, log) - if logbackConfigString != nil { + if logbackConfigString := r.getLogbackConfigString(nodeConfig, id, log); logbackConfigString != nil { secret.Data["logback.xml"] = []byte(*logbackConfigString) } @@ -365,23 +364,7 @@ func (r *Reconciler) getLogbackConfigString(nConfig *v1.NodeConfig, id int32, lo zap.Error(err)) } - if !configcommon.MustOverrideLogback(r.NifiCluster) { - return nil - } - - var out bytes.Buffer - t := template.Must(template.New("nConfig-config").Parse(config.LogbackTemplate)) - if err := t.Execute(&out, map[string]interface{}{ - "NifiCluster": r.NifiCluster, - "Id": id, - }); err != nil { - log.Error("error occurred during parsing the config template", - zap.String("clusterName", r.NifiCluster.Name), - zap.Int32("nodeId", id), - zap.Error(err)) - } - output := out.String() - return &output + return nil } /////////////////////////////////////////////////// diff --git a/pkg/resources/templates/config/logback.xml.go b/pkg/resources/templates/config/logback.xml.go deleted file mode 100644 index baaab5fa14..0000000000 --- a/pkg/resources/templates/config/logback.xml.go +++ /dev/null @@ -1,292 +0,0 @@ -package config - -var LogbackTemplate = ` - - - - - - - true - - - - ${org.apache.nifi.bootstrap.config.log.dir}/nifi-app.log - - - ${org.apache.nifi.bootstrap.config.log.dir}/nifi-app_%d{yyyy-MM-dd_HH}.%i.log - - 100MB - - 30 - - 3GB - - true - - true - - %date %level [%thread] %logger{40} %msg%n - - - - - ${org.apache.nifi.bootstrap.config.log.dir}/nifi-user.log - - - ${org.apache.nifi.bootstrap.config.log.dir}/nifi-user_%d.log - - 30 - - 3GB - - true - - - %date %level [%thread] %logger{40} %msg%n - - - - - ${org.apache.nifi.bootstrap.config.log.dir}/nifi-request.log - - ${org.apache.nifi.bootstrap.config.log.dir}/nifi-request_%d.log - - 30 - - 3GB - - true - - - %msg%n - - - - - ${org.apache.nifi.bootstrap.config.log.dir}/nifi-bootstrap.log - - - ${org.apache.nifi.bootstrap.config.log.dir}/nifi-bootstrap_%d.log - - 30 - - 3GB - - true - - - %date %level [%thread] %logger{40} %msg%n - - - - - ${org.apache.nifi.bootstrap.config.log.dir}/nifi-deprecation.log - - ${org.apache.nifi.bootstrap.config.log.dir}/nifi-deprecation_%d.%i.log - - 10MB - - 10 - - 100MB - - true - - - %date %level [%thread] %logger %msg%n - - - - - - - - ${org.apache.nifi.bootstrap.config.log.dir}/nifi-app-${logFileSuffix}.log - - - ${org.apache.nifi.bootstrap.config.log.dir}/nifi-app-${logFileSuffix}_%d{yyyy-MM-dd_HH}.%i.log - - 100MB - - 30 - - 3GB - - true - - true - - %date %level [%thread] %logger{40} %msg%n - - - - - - - - %date %level [%thread] %logger{40} %msg%n - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -` From 6f37246aa0703b6c6af1ddec37f9e48088d34c3f Mon Sep 17 00:00:00 2001 From: Julien Guitton Date: Thu, 11 Jan 2024 15:01:50 +0100 Subject: [PATCH 09/10] Update CHANGELOG --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fca8511e13..546d5199f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ - [PR #349](https://github.com/konpyutaika/nifikop/pull/349) - **[Operator/NifiRegistryClient]** Set FlowRegistry type in RegistryClient creation. - [PR #350](https://github.com/konpyutaika/nifikop/pull/350) - **[Operator]** Remove optimistic lock on `Patch`. - [PR #352](https://github.com/konpyutaika/nifikop/pull/352) - **[Operator]** Changed default LogLevel of NiFi from `DEBUG` to `INFO`. -- [PR #353](https://github.com/konpyutaika/nifikop/pull/353) - **[Operator/NifiCluster]** Updated `logback.xml` template for 2.0.0-M1 and made it optional (by default disabled). +- [PR #353](https://github.com/konpyutaika/nifikop/pull/353) - **[Operator/NifiCluster]** Removed `logback.xml` template. ### Fixed Bugs From 5718661043c634daa59a532418553f0428b89f40 Mon Sep 17 00:00:00 2001 From: Julien Guitton Date: Thu, 11 Jan 2024 16:04:37 +0100 Subject: [PATCH 10/10] Update doc --- api/v1/nificluster_types.go | 4 ++-- config/samples/nifi_v1_nificluster.yaml | 4 ++-- .../5_references/1_nifi_cluster/2_read_only_config.md | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/api/v1/nificluster_types.go b/api/v1/nificluster_types.go index 60e916eede..f29c898309 100644 --- a/api/v1/nificluster_types.go +++ b/api/v1/nificluster_types.go @@ -292,9 +292,9 @@ type BootstrapProperties struct { // Logback configuration that will be applied to the node. type LogbackConfig struct { - // logback.xml configuration that will replace the one produced based on template + // logback.xml configuration that will replace the one provided by NiFi ReplaceConfigMap *ConfigmapReference `json:"replaceConfigMap,omitempty"` - // logback.xml configuration that will replace the one produced based on template and overrideConfigMap + // logback.xml configuration that will replace the one provided by NiFi and overrideConfigMap ReplaceSecretConfig *SecretConfigReference `json:"replaceSecretConfig,omitempty"` } diff --git a/config/samples/nifi_v1_nificluster.yaml b/config/samples/nifi_v1_nificluster.yaml index 67c396edef..71e2a6c217 100644 --- a/config/samples/nifi_v1_nificluster.yaml +++ b/config/samples/nifi_v1_nificluster.yaml @@ -59,7 +59,7 @@ spec: maximumTimerDrivenThreadCount: 30 # Logback configuration that will be applied to the node logbackConfig: - # logback.xml configuration that will replace the one produced based on template + # logback.xml configuration that will replace the one provided by NiFi replaceConfigMap: # The key of the value,in data content, that we want use. data: logback.xml @@ -67,7 +67,7 @@ spec: name: raw # Namespace where is located the secret that we want to refer. namespace: nifikop - # logback.xml configuration that will replace the one produced based on template and overrideConfigMap + # logback.xml configuration that will replace the one provided by NiFi and overrideConfigMap replaceSecretConfig: # The key of the value,in data content, that we want use. data: logback.xml diff --git a/site/docs/5_references/1_nifi_cluster/2_read_only_config.md b/site/docs/5_references/1_nifi_cluster/2_read_only_config.md index 7b59018a2e..7be691e148 100644 --- a/site/docs/5_references/1_nifi_cluster/2_read_only_config.md +++ b/site/docs/5_references/1_nifi_cluster/2_read_only_config.md @@ -14,7 +14,7 @@ readOnlyConfig: maximumEventDrivenThreadCount: 10 # Logback configuration that will be applied to the node logbackConfig: - # logback.xml configuration that will replace the one produced based on template + # logback.xml configuration that will replace the one provided by NiFi replaceConfigMap: # The key of the value,in data content, that we want use. data: logback.xml @@ -22,7 +22,7 @@ readOnlyConfig: name: raw # Namespace where is located the secret that we want to refer. namespace: nifikop - # logback.xml configuration that will replace the one produced based on template and overrideConfigMap + # logback.xml configuration that will replace the one provided by NiFi and overrideConfigMap replaceSecretConfig: # The key of the value,in data content, that we want use. data: logback.xml @@ -188,8 +188,8 @@ readOnlyConfig: |Field|Type|Description|Required|Default| |-----|----|-----------|--------|--------| -|replaceConfigMap|[ConfigmapReference](#configmapreference)|logback.xml configuration that will replace the one produced based on template.|No|nil| -|replaceSecretConfig|[SecretConfigReference](#secretconfigreference)|logback.xml configuration that will replace the one produced based on template and overrideConfigMap.|No|nil| +|replaceConfigMap|[ConfigmapReference](#configmapreference)|logback.xml configuration that will replace the one provided by NiFi.|No|nil| +|replaceSecretConfig|[SecretConfigReference](#secretconfigreference)|logback.xml configuration that will replace the one provided by NiFi and overrideConfigMap.|No|nil| ## AuthorizerConfig