From 414d46206e7101882fe1ddf1d5af5bb82a54d7fc Mon Sep 17 00:00:00 2001 From: Zadkiel Aharonian Date: Wed, 2 Aug 2023 11:55:22 +0200 Subject: [PATCH] feat: update cluster domain to force direct resolution Signed-off-by: Zadkiel Aharonian --- charts/logging-operator/README.md | 4 ++-- charts/logging-operator/templates/_helpers.tpl | 2 +- charts/logging-operator/values.yaml | 2 +- pkg/sdk/logging/api/v1beta1/logging_types.go | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/charts/logging-operator/README.md b/charts/logging-operator/README.md index d2ada27e8e..cbee7a9efa 100644 --- a/charts/logging-operator/README.md +++ b/charts/logging-operator/README.md @@ -67,7 +67,7 @@ Use `createCustomResource=false` with Helm v3 to avoid trying to create CRDs fro | tolerations | list | `[]` | Node Tolerations | | affinity | object | `{}` | Node Affinity | | podLabels | object | `{}` | Define which Nodes the Pods are scheduled on. | -| logging | object | `{"allowClusterResourcesFromAllNamespaces":false,"clusterDomain":"cluster.local","clusterFlows":[],"clusterOutputs":[],"controlNamespace":"","defaultFlow":{},"enableRecreateWorkloadOnImmutableFieldChange":false,"enabled":false,"errorOutputRef":"","eventTailer":{},"flowConfigCheckDisabled":false,"flowConfigOverride":"","fluentbit":{},"fluentbitDisabled":false,"fluentd":{},"fluentdDisabled":false,"globalFilters":[],"hostTailer":{},"loggingRef":"","nodeAgents":{},"skipInvalidResources":false,"syslogNG":{},"watchNamespaces":[]}` | Logging resources configuration. | +| logging | object | `{"allowClusterResourcesFromAllNamespaces":false,"clusterDomain":"cluster.local.","clusterFlows":[],"clusterOutputs":[],"controlNamespace":"","defaultFlow":{},"enableRecreateWorkloadOnImmutableFieldChange":false,"enabled":false,"errorOutputRef":"","eventTailer":{},"flowConfigCheckDisabled":false,"flowConfigOverride":"","fluentbit":{},"fluentbitDisabled":false,"fluentd":{},"fluentdDisabled":false,"globalFilters":[],"hostTailer":{},"loggingRef":"","nodeAgents":{},"skipInvalidResources":false,"syslogNG":{},"watchNamespaces":[]}` | Logging resources configuration. | | logging.enabled | bool | `false` | Logging resources are disabled by default | | logging.loggingRef | string | `""` | Reference to the logging system. Each of the loggingRefs can manage a fluentbit daemonset and a fluentd statefulset. | | logging.flowConfigCheckDisabled | bool | `false` | Disable configuration check before applying new fluentd configuration. | @@ -82,7 +82,7 @@ Use `createCustomResource=false` with Helm v3 to avoid trying to create CRDs fro | logging.errorOutputRef | string | `""` | GlobalOutput name to flush ERROR events to | | logging.globalFilters | list | `[]` | Global filters to apply on logs before any match or filter mechanism. | | logging.watchNamespaces | list | `[]` | Limit namespaces to watch Flow and Output custom resources. | -| logging.clusterDomain | string | `"cluster.local"` | Cluster domain name to be used when templating URLs to services | +| logging.clusterDomain | string | `"cluster.local."` | Cluster domain name to be used when templating URLs to services | | logging.controlNamespace | string | `""` | Namespace for cluster wide configuration resources like ClusterFlow and ClusterOutput. This should be a protected namespace from regular users. Resources like fluentbit and fluentd will run in this namespace as well. | | logging.allowClusterResourcesFromAllNamespaces | bool | `false` | Allow configuration of cluster resources from any namespace. Mutually exclusive with ControlNamespace restriction of Cluster resources | | logging.nodeAgents | object | `{}` | NodeAgent Configuration | diff --git a/charts/logging-operator/templates/_helpers.tpl b/charts/logging-operator/templates/_helpers.tpl index 8dd7073bb1..b08d9abee3 100644 --- a/charts/logging-operator/templates/_helpers.tpl +++ b/charts/logging-operator/templates/_helpers.tpl @@ -67,7 +67,7 @@ app.kubernetes.io/managed-by: {{ .Release.Service }} {{/* Formats the cluster domain as a suffix, e.g.: .Values.clusterDomain == "", returns "" -.Values.clusterDomain == "cluster.local", returns ".cluster.local" +.Values.clusterDomain == "cluster.local.", returns ".cluster.local." */}} {{- define "logging-operator.clusterDomainAsSuffix" -}} {{- if .Values.clusterDomain -}} diff --git a/charts/logging-operator/values.yaml b/charts/logging-operator/values.yaml index 10597474df..1b1b7319cd 100644 --- a/charts/logging-operator/values.yaml +++ b/charts/logging-operator/values.yaml @@ -183,7 +183,7 @@ logging: watchNamespaces: [] # -- Cluster domain name to be used when templating URLs to services - clusterDomain: "cluster.local" + clusterDomain: "cluster.local." # -- Namespace for cluster wide configuration resources like ClusterFlow and ClusterOutput. This should be a protected namespace from regular users. Resources like fluentbit and fluentd will run in this namespace as well. controlNamespace: "" diff --git a/pkg/sdk/logging/api/v1beta1/logging_types.go b/pkg/sdk/logging/api/v1beta1/logging_types.go index dc8ab0b42e..3118d8da44 100644 --- a/pkg/sdk/logging/api/v1beta1/logging_types.go +++ b/pkg/sdk/logging/api/v1beta1/logging_types.go @@ -67,7 +67,7 @@ type LoggingSpec struct { WatchNamespaces []string `json:"watchNamespaces,omitempty"` // WatchNamespaceSelector is a LabelSelector to find matching namespaces to watch as in WatchNamespaces WatchNamespaceSelector *metav1.LabelSelector `json:"watchNamespaceSelector,omitempty"` - // Cluster domain name to be used when templating URLs to services (default: "cluster.local"). + // Cluster domain name to be used when templating URLs to services (default: "cluster.local."). ClusterDomain *string `json:"clusterDomain,omitempty"` // Namespace for cluster wide configuration resources like CLusterFlow and ClusterOutput. // This should be a protected namespace from regular users. @@ -150,7 +150,7 @@ const ( // SetDefaults fills empty attributes func (l *Logging) SetDefaults() error { if l.Spec.ClusterDomain == nil { - l.Spec.ClusterDomain = util.StringPointer("cluster.local") + l.Spec.ClusterDomain = util.StringPointer("cluster.local.") } if !l.Spec.FlowConfigCheckDisabled && l.Status.ConfigCheckResults == nil { l.Status.ConfigCheckResults = make(map[string]bool) @@ -598,7 +598,7 @@ func (l *Logging) QualifiedName(name string) string { // ClusterDomainAsSuffix formats the cluster domain as a suffix, e.g.: // .Spec.ClusterDomain == "", returns "" -// .Spec.ClusterDomain == "cluster.local", returns ".cluster.local" +// .Spec.ClusterDomain == "cluster.local.", returns ".cluster.local." func (l *Logging) ClusterDomainAsSuffix() string { if l.Spec.ClusterDomain == nil || *l.Spec.ClusterDomain == "" { return ""