Skip to content

Commit

Permalink
feat: update cluster domain to force direct resolution
Browse files Browse the repository at this point in the history
Signed-off-by: Zadkiel Aharonian <[email protected]>
  • Loading branch information
aslafy-z committed Aug 2, 2023
1 parent 5a8e76e commit 414d462
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions charts/logging-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. |
Expand All @@ -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 |
Expand Down
2 changes: 1 addition & 1 deletion charts/logging-operator/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
Expand Down
2 changes: 1 addition & 1 deletion charts/logging-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ""
Expand Down
6 changes: 3 additions & 3 deletions pkg/sdk/logging/api/v1beta1/logging_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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 ""
Expand Down

0 comments on commit 414d462

Please sign in to comment.