diff --git a/.changelog/3364.added.txt b/.changelog/3364.added.txt new file mode 100644 index 0000000000..3e83a94ea9 --- /dev/null +++ b/.changelog/3364.added.txt @@ -0,0 +1 @@ +feat: allow setting the cluster DNS domain \ No newline at end of file diff --git a/deploy/helm/sumologic/README.md b/deploy/helm/sumologic/README.md index 051148bb0c..a7ba679522 100644 --- a/deploy/helm/sumologic/README.md +++ b/deploy/helm/sumologic/README.md @@ -142,6 +142,7 @@ The following table lists the configurable parameters of the Sumo Logic chart an | `sumologic.collectionMonitoring` | If you set it to false, it would set `EXCLUDE_NAMESPACE=` and not add the Prometheus remotestorage metrics. | `true` | | `sumologic.collectorName` | The name of the Sumo Logic collector that will be created in the SetUp job. Defaults to `clusterName` if not specified. | `Nil` | | `sumologic.clusterName` | An identifier for the Kubernetes cluster. Whitespaces in the cluster name will be replaced with dashes. | `kubernetes` | +| `sumologic.clusterDNSDomain` | The DNS domain for the cluster. Change this if you're using a custom domain. | `cluster.local` | | `sumologic.cluster` | Configuration of Kubernetes for [Terraform client](https://www.terraform.io/docs/providers/kubernetes/index.html#argument-reference). | See [values.yaml] | | `sumologic.collector.sources` | Configuration of HTTP sources. [See docs/Terraform.md for more information](/docs/terraform.md). All double quotes should be escaped here regarding Terraform syntax. | See [values.yaml] | | `sumologic.collector.fields` | Configuration of Sumo Logic fields. [See Sumo Logic Terraform Plugin documentation for more information](https://registry.terraform.io/providers/SumoLogic/sumologic/latest/docs/resources/collector#fields). All double quotes should be escaped here regarding Terraform syntax. | See [values.yaml] | diff --git a/deploy/helm/sumologic/conf/logs/collector/otelcloudwatch/config.yaml b/deploy/helm/sumologic/conf/logs/collector/otelcloudwatch/config.yaml index 6c2a61db3a..85b9bbe435 100644 --- a/deploy/helm/sumologic/conf/logs/collector/otelcloudwatch/config.yaml +++ b/deploy/helm/sumologic/conf/logs/collector/otelcloudwatch/config.yaml @@ -1,6 +1,6 @@ exporters: otlphttp: - endpoint: http://${LOGS_METADATA_SVC}.${NAMESPACE}.svc.cluster.local.:4318 + endpoint: http://${LOGS_METADATA_SVC}.${NAMESPACE}.svc.{{ .Values.sumologic.clusterDNSDomain }}.:4318 sending_queue: queue_size: 10 # this improves load balancing at the cost of more network traffic diff --git a/deploy/helm/sumologic/conf/logs/collector/otelcol/config.yaml b/deploy/helm/sumologic/conf/logs/collector/otelcol/config.yaml index ed3163e8bb..beb247ab64 100644 --- a/deploy/helm/sumologic/conf/logs/collector/otelcol/config.yaml +++ b/deploy/helm/sumologic/conf/logs/collector/otelcol/config.yaml @@ -1,6 +1,6 @@ exporters: otlphttp: - endpoint: http://${LOGS_METADATA_SVC}.${NAMESPACE}.svc.cluster.local.:4318 + endpoint: http://${LOGS_METADATA_SVC}.${NAMESPACE}.svc.{{ .Values.sumologic.clusterDNSDomain }}.:4318 sending_queue: queue_size: 10 # this improves load balancing at the cost of more network traffic diff --git a/deploy/helm/sumologic/conf/metrics/collector/otelcol/config.yaml b/deploy/helm/sumologic/conf/metrics/collector/otelcol/config.yaml index fef54fb6ab..80abc6ee2d 100644 --- a/deploy/helm/sumologic/conf/metrics/collector/otelcol/config.yaml +++ b/deploy/helm/sumologic/conf/metrics/collector/otelcol/config.yaml @@ -2,7 +2,7 @@ {{- $scrapeConfigsPresent := or $collectorConfig.kubelet.enabled $collectorConfig.cAdvisor.enabled $collectorConfig.annotatedPods.enabled -}} exporters: otlphttp: - endpoint: http://${METADATA_METRICS_SVC}.${NAMESPACE}.svc.cluster.local.:4318 + endpoint: http://${METADATA_METRICS_SVC}.${NAMESPACE}.svc.{{ .Values.sumologic.clusterDNSDomain }}.:4318 sending_queue: queue_size: 10000 num_consumers: 10 diff --git a/deploy/helm/sumologic/templates/_helpers/_metrics.tpl b/deploy/helm/sumologic/templates/_helpers/_metrics.tpl index bb906a30e5..1c795c9bf0 100644 --- a/deploy/helm/sumologic/templates/_helpers/_metrics.tpl +++ b/deploy/helm/sumologic/templates/_helpers/_metrics.tpl @@ -36,10 +36,10 @@ Generate list of remoteWrite endpoints for telegraf configuration {{- $endpoints := list -}} {{- $kps := get .Values "kube-prometheus-stack" -}} {{- range $remoteWrite := $kps.prometheus.prometheusSpec.remoteWrite }} -{{- $endpoints = append $endpoints ($remoteWrite.url | trimPrefix "http://$(METADATA_METRICS_SVC).$(NAMESPACE).svc.cluster.local.:9888" | quote) -}} +{{- $endpoints = append $endpoints ($remoteWrite.url | trimPrefix "http://$(METADATA_METRICS_SVC).$(NAMESPACE):9888" | quote) -}} {{- end }} {{- range $remoteWrite := $kps.prometheus.prometheusSpec.additionalRemoteWrite }} -{{- $endpoints = append $endpoints ($remoteWrite.url | trimPrefix "http://$(METADATA_METRICS_SVC).$(NAMESPACE).svc.cluster.local.:9888" | quote) -}} +{{- $endpoints = append $endpoints ($remoteWrite.url | trimPrefix "http://$(METADATA_METRICS_SVC).$(NAMESPACE):9888" | quote) -}} {{- end -}} {{- range $endpoint := .Values.metadata.metrics.config.additionalEndpoints }} {{- $endpoints = append $endpoints ($endpoint | quote) -}} diff --git a/deploy/helm/sumologic/values.yaml b/deploy/helm/sumologic/values.yaml index b37baf4247..b33163f058 100644 --- a/deploy/helm/sumologic/values.yaml +++ b/deploy/helm/sumologic/values.yaml @@ -42,6 +42,11 @@ sumologic: ## Cluster name: Note spaces are not allowed and will be replaced with dashes. clusterName: "kubernetes" + ## Cluster DNS Domain + ## We use the DNS domain in internal urls to speed up DNS resolution, see https://github.com/kubernetes/kubernetes/issues/56903 + ## Change this if you have set a non-default DNS domain in your cluster + clusterDNSDomain: "cluster.local" + ## Configuration of Kubernetes for Terraform client ## https://www.terraform.io/docs/providers/kubernetes/index.html#argument-reference ## All double quotes should be escaped here regarding Terraform syntax @@ -1226,7 +1231,7 @@ kube-prometheus-stack: action: replace remoteWrite: ## infrastructure metrics - - url: http://$(METADATA_METRICS_SVC).$(NAMESPACE).svc.cluster.local.:9888/prometheus.metrics + - url: http://$(METADATA_METRICS_SVC).$(NAMESPACE):9888/prometheus.metrics remoteTimeout: 5s serviceMonitor: diff --git a/tests/integration/yamls/cluster.yaml b/tests/integration/yamls/cluster.yaml index 1b73d5360a..9c169d0401 100644 --- a/tests/integration/yamls/cluster.yaml +++ b/tests/integration/yamls/cluster.yaml @@ -6,6 +6,7 @@ nodes: # these changes allow us to scrape control plane metrics # see kind docs on customizing kubeadm: https://kind.sigs.k8s.io/docs/user/configuration/#kubeadm-config-patches # and kubeadm docs on configuring control plane components: https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/control-plane-flags/ + # The DNS domain is changed to verify we work correctly in that environment - | kind: ClusterConfiguration scheduler: @@ -19,3 +20,5 @@ nodes: dataDir: /tmp/etcd extraArgs: listen-metrics-urls: http://0.0.0.0:2381 + networking: + dnsDomain: "my.cluster"