Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not depend on clusterDomain == cluster.local #325

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ We use *breaking* word for marking changes that are not backward compatible (rel
- [#279](https://github.com/thanos-io/kube-thanos/pull/279) Change `hashringConfigmapName` to `hashringConfigMapName` in Receive configuration.
- [#284](https://github.com/thanos-io/kube-thanos/pull/284) Change Receive `PodDisruptionBudget` api version to `policy/v1`
- [#293](https://github.com/thanos-io/kube-thanos/pull/293) Upgrade to Thanos v0.30.2
- [#325](https://github.com/thanos-io/kube-thanos/pull/325) Do not depend on Kubernetes cluster DNS domain to be 'cluster.local'.

### Added

Expand Down
18 changes: 9 additions & 9 deletions all.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ local s = t.store(commonConfig {
// NOTICE: <MEMCACHED_SERVICE> is a placeholder to generate examples.
// List of memcached addresses, that will get resolved with the DNS service discovery provider.
// For DNS service discovery reference https://thanos.io/tip/thanos/service-discovery.md/#dns-service-discovery
addresses: ['dnssrv+_client._tcp.<MEMCACHED_SERVICE>.%s.svc.cluster.local' % commonConfig.namespace],
addresses: ['dnssrv+_client._tcp.<MEMCACHED_SERVICE>.%s' % commonConfig.namespace],
},
},
indexCache: {
Expand All @@ -130,7 +130,7 @@ local s = t.store(commonConfig {
// NOTICE: <MEMCACHED_SERVICE> is a placeholder to generate examples.
// List of memcached addresses, that will get resolved with the DNS service discovery provider.
// For DNS service discovery reference https://thanos.io/tip/thanos/service-discovery.md/#dns-service-discovery
addresses: ['dnssrv+_client._tcp.<MEMCACHED_SERVICE>.%s.svc.cluster.local' % commonConfig.namespace],
addresses: ['dnssrv+_client._tcp.<MEMCACHED_SERVICE>.%s' % commonConfig.namespace],
},
},
});
Expand All @@ -152,12 +152,12 @@ local q = t.query(commonConfig {
});

local finalRu = t.rule(ru.config {
queriers: ['dnssrv+_http._tcp.%s.%s.svc.cluster.local' % [q.service.metadata.name, q.service.metadata.namespace]],
queriers: ['dnssrv+_http._tcp.%s.%s' % [q.service.metadata.name, q.service.metadata.namespace]],
});

local qf = t.queryFrontend(commonConfig {
replicas: 1,
downstreamURL: 'http://%s.%s.svc.cluster.local.:%d' % [
downstreamURL: 'http://%s.%s:%d' % [
q.service.metadata.name,
q.service.metadata.namespace,
q.service.spec.ports[1].port,
Expand All @@ -172,7 +172,7 @@ local qf = t.queryFrontend(commonConfig {
// NOTICE: <MEMCACHED_SERVICE> is a placeholder to generate examples.
// List of memcached addresses, that will get resolved with the DNS service discovery provider.
// For DNS service discovery reference https://thanos.io/tip/thanos/service-discovery.md/#dns-service-discovery
addresses: ['dnssrv+_client._tcp.<MEMCACHED_SERVICE>.%s.svc.cluster.local' % commonConfig.namespace],
addresses: ['dnssrv+_client._tcp.<MEMCACHED_SERVICE>.%s' % commonConfig.namespace],
},
},
labelsCache: {
Expand All @@ -181,7 +181,7 @@ local qf = t.queryFrontend(commonConfig {
// NOTICE: <MEMCACHED_SERVICE> is a placeholder to generate examples.
// List of memcached addresses, that will get resolved with the DNS service discovery provider.
// For DNS service discovery reference https://thanos.io/tip/thanos/service-discovery.md/#dns-service-discovery
addresses: ['dnssrv+_client._tcp.<MEMCACHED_SERVICE>.%s.svc.cluster.local' % commonConfig.namespace],
addresses: ['dnssrv+_client._tcp.<MEMCACHED_SERVICE>.%s' % commonConfig.namespace],
},
},
});
Expand Down Expand Up @@ -213,7 +213,7 @@ local strs = t.storeShards(commonConfig {
// NOTICE: <MEMCACHED_SERVICE> is a placeholder to generate examples.
// List of memcached addresses, that will get resolved with the DNS service discovery provider.
// For DNS service discovery reference https://thanos.io/tip/thanos/service-discovery.md/#dns-service-discovery
addresses: ['dnssrv+_client._tcp.<MEMCACHED_SERVICE>.%s.svc.cluster.local' % commonConfig.namespace],
addresses: ['dnssrv+_client._tcp.<MEMCACHED_SERVICE>.%s' % commonConfig.namespace],
},
},
indexCache: {
Expand All @@ -222,14 +222,14 @@ local strs = t.storeShards(commonConfig {
// NOTICE: <MEMCACHED_SERVICE> is a placeholder to generate examples.
// List of memcached addresses, that will get resolved with the DNS service discovery provider.
// For DNS service discovery reference https://thanos.io/tip/thanos/service-discovery.md/#dns-service-discovery
addresses: ['dnssrv+_client._tcp.<MEMCACHED_SERVICE>.%s.svc.cluster.local' % commonConfig.namespace],
addresses: ['dnssrv+_client._tcp.<MEMCACHED_SERVICE>.%s' % commonConfig.namespace],
},
},
});

local finalQ = t.query(q.config {
stores: [
'dnssrv+_grpc._tcp.%s.%s.svc.cluster.local' % [service.metadata.name, service.metadata.namespace]
'dnssrv+_grpc._tcp.%s.%s' % [service.metadata.name, service.metadata.namespace]
for service in [re.service, ru.service, sc.service, s.service] +
[rcvs.hashrings[hashring].service for hashring in std.objectFields(rcvs.hashrings)] +
[strs.shards[shard].service for shard in std.objectFields(strs.shards)]
Expand Down
18 changes: 9 additions & 9 deletions examples/all/manifests/thanos-query-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ spec:
- --log.format=logfmt
- --query.replica-label=prometheus_replica
- --query.replica-label=rule_replica
- --endpoint=dnssrv+_grpc._tcp.thanos-receive.thanos.svc.cluster.local
- --endpoint=dnssrv+_grpc._tcp.thanos-rule.thanos.svc.cluster.local
- --endpoint=dnssrv+_grpc._tcp.thanos-sidecar.thanos.svc.cluster.local
- --endpoint=dnssrv+_grpc._tcp.thanos-store.thanos.svc.cluster.local
- --endpoint=dnssrv+_grpc._tcp.thanos-receive-default.thanos.svc.cluster.local
- --endpoint=dnssrv+_grpc._tcp.thanos-receive-region-1.thanos.svc.cluster.local
- --endpoint=dnssrv+_grpc._tcp.thanos-store-0.thanos.svc.cluster.local
- --endpoint=dnssrv+_grpc._tcp.thanos-store-1.thanos.svc.cluster.local
- --endpoint=dnssrv+_grpc._tcp.thanos-store-2.thanos.svc.cluster.local
- --endpoint=dnssrv+_grpc._tcp.thanos-receive.thanos
- --endpoint=dnssrv+_grpc._tcp.thanos-rule.thanos
- --endpoint=dnssrv+_grpc._tcp.thanos-sidecar.thanos
- --endpoint=dnssrv+_grpc._tcp.thanos-store.thanos
- --endpoint=dnssrv+_grpc._tcp.thanos-receive-default.thanos
- --endpoint=dnssrv+_grpc._tcp.thanos-receive-region-1.thanos
- --endpoint=dnssrv+_grpc._tcp.thanos-store-0.thanos
- --endpoint=dnssrv+_grpc._tcp.thanos-store-1.thanos
- --endpoint=dnssrv+_grpc._tcp.thanos-store-2.thanos
- --query.timeout=5m
- --query.lookback-delta=15m
- |-
Expand Down
6 changes: 3 additions & 3 deletions examples/all/manifests/thanos-query-frontend-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ spec:
- --log.format=logfmt
- --query-frontend.compress-responses
- --http-address=0.0.0.0:9090
- --query-frontend.downstream-url=http://thanos-query.thanos.svc.cluster.local.:9090
- --query-frontend.downstream-url=http://thanos-query.thanos:9090
- --query-range.split-interval=12h
- --labels.split-interval=12h
- --query-range.max-retries-per-request=10
Expand All @@ -53,7 +53,7 @@ spec:
- |-
--query-range.response-cache-config="config":
"addresses":
- "dnssrv+_client._tcp.<MEMCACHED_SERVICE>.thanos.svc.cluster.local"
- "dnssrv+_client._tcp.<MEMCACHED_SERVICE>.thanos"
"dns_provider_update_interval": "10s"
"max_async_buffer_size": 10000
"max_async_concurrency": 20
Expand All @@ -65,7 +65,7 @@ spec:
- |-
--labels.response-cache-config="config":
"addresses":
- "dnssrv+_client._tcp.<MEMCACHED_SERVICE>.thanos.svc.cluster.local"
- "dnssrv+_client._tcp.<MEMCACHED_SERVICE>.thanos"
"dns_provider_update_interval": "10s"
"max_async_buffer_size": 10000
"max_async_concurrency": 20
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ spec:
- --label=replica="$(NAME)"
- --label=receive="true"
- --objstore.config=$(OBJSTORE_CONFIG)
- --receive.local-endpoint=$(NAME).thanos-receive-default.$(NAMESPACE).svc.cluster.local:10901
- --receive.local-endpoint=$(NAME).thanos-receive-default.$(NAMESPACE):10901
- --receive.hashrings-file=/var/lib/thanos-receive/hashrings.json
- |-
--tracing.config="config":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ spec:
- --label=replica="$(NAME)"
- --label=receive="true"
- --objstore.config=$(OBJSTORE_CONFIG)
- --receive.local-endpoint=$(NAME).thanos-receive-region-1.$(NAMESPACE).svc.cluster.local:10901
- --receive.local-endpoint=$(NAME).thanos-receive-region-1.$(NAMESPACE):10901
- --receive.hashrings-file=/var/lib/thanos-receive/hashrings.json
- |-
--tracing.config="config":
Expand Down
2 changes: 1 addition & 1 deletion examples/all/manifests/thanos-receive-statefulSet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ spec:
- --label=replica="$(NAME)"
- --label=receive="true"
- --objstore.config=$(OBJSTORE_CONFIG)
- --receive.local-endpoint=$(NAME).thanos-receive.$(NAMESPACE).svc.cluster.local:10901
- --receive.local-endpoint=$(NAME).thanos-receive.$(NAMESPACE):10901
- --receive.hashrings-file=/var/lib/thanos-receive/hashrings.json
- |-
--tracing.config="config":
Expand Down
2 changes: 1 addition & 1 deletion examples/all/manifests/thanos-rule-statefulSet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ spec:
- --alert.label-drop=rule_replica
- --tsdb.retention=48h
- --tsdb.block-duration=2h
- --query=dnssrv+_http._tcp.thanos-query.thanos.svc.cluster.local
- --query=dnssrv+_http._tcp.thanos-query.thanos
- --alertmanagers.url=alertmanager:9093
- --alertmanagers.config-file=/etc/thanos/config/thanos-ruler-config/config.yaml
- --rule-file=/etc/thanos/rules/test/test
Expand Down
4 changes: 2 additions & 2 deletions examples/all/manifests/thanos-store-shard0-statefulSet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ spec:
- |-
--index-cache.config="config":
"addresses":
- "dnssrv+_client._tcp.<MEMCACHED_SERVICE>.thanos.svc.cluster.local"
- "dnssrv+_client._tcp.<MEMCACHED_SERVICE>.thanos"
"dns_provider_update_interval": "10s"
"max_async_buffer_size": 10000
"max_async_concurrency": 20
Expand All @@ -75,7 +75,7 @@ spec:
"chunk_subrange_ttl": "24h"
"config":
"addresses":
- "dnssrv+_client._tcp.<MEMCACHED_SERVICE>.thanos.svc.cluster.local"
- "dnssrv+_client._tcp.<MEMCACHED_SERVICE>.thanos"
"dns_provider_update_interval": "10s"
"max_async_buffer_size": 10000
"max_async_concurrency": 20
Expand Down
4 changes: 2 additions & 2 deletions examples/all/manifests/thanos-store-shard1-statefulSet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ spec:
- |-
--index-cache.config="config":
"addresses":
- "dnssrv+_client._tcp.<MEMCACHED_SERVICE>.thanos.svc.cluster.local"
- "dnssrv+_client._tcp.<MEMCACHED_SERVICE>.thanos"
"dns_provider_update_interval": "10s"
"max_async_buffer_size": 10000
"max_async_concurrency": 20
Expand All @@ -75,7 +75,7 @@ spec:
"chunk_subrange_ttl": "24h"
"config":
"addresses":
- "dnssrv+_client._tcp.<MEMCACHED_SERVICE>.thanos.svc.cluster.local"
- "dnssrv+_client._tcp.<MEMCACHED_SERVICE>.thanos"
"dns_provider_update_interval": "10s"
"max_async_buffer_size": 10000
"max_async_concurrency": 20
Expand Down
4 changes: 2 additions & 2 deletions examples/all/manifests/thanos-store-shard2-statefulSet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ spec:
- |-
--index-cache.config="config":
"addresses":
- "dnssrv+_client._tcp.<MEMCACHED_SERVICE>.thanos.svc.cluster.local"
- "dnssrv+_client._tcp.<MEMCACHED_SERVICE>.thanos"
"dns_provider_update_interval": "10s"
"max_async_buffer_size": 10000
"max_async_concurrency": 20
Expand All @@ -75,7 +75,7 @@ spec:
"chunk_subrange_ttl": "24h"
"config":
"addresses":
- "dnssrv+_client._tcp.<MEMCACHED_SERVICE>.thanos.svc.cluster.local"
- "dnssrv+_client._tcp.<MEMCACHED_SERVICE>.thanos"
"dns_provider_update_interval": "10s"
"max_async_buffer_size": 10000
"max_async_concurrency": 20
Expand Down
4 changes: 2 additions & 2 deletions examples/all/manifests/thanos-store-statefulSet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ spec:
- |-
--index-cache.config="config":
"addresses":
- "dnssrv+_client._tcp.<MEMCACHED_SERVICE>.thanos.svc.cluster.local"
- "dnssrv+_client._tcp.<MEMCACHED_SERVICE>.thanos"
"dns_provider_update_interval": "10s"
"max_async_buffer_size": 10000
"max_async_concurrency": 20
Expand All @@ -72,7 +72,7 @@ spec:
"chunk_subrange_ttl": "24h"
"config":
"addresses":
- "dnssrv+_client._tcp.<MEMCACHED_SERVICE>.thanos.svc.cluster.local"
- "dnssrv+_client._tcp.<MEMCACHED_SERVICE>.thanos"
"dns_provider_update_interval": "10s"
"max_async_buffer_size": 10000
"max_async_concurrency": 20
Expand Down
2 changes: 1 addition & 1 deletion examples/development-minio/minio-secret-thanos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ stringData:
type: s3
config:
bucket: thanos
endpoint: minio.thanos.svc.cluster.local:9000
endpoint: minio.thanos:9000
insecure: true
access_key: minio
secret_key: minio123
Expand Down
2 changes: 1 addition & 1 deletion jsonnet/kube-thanos/kube-thanos-query.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ local defaults = {
imagePullPolicy: 'IfNotPresent',
replicas: error 'must provide replicas',
replicaLabels: error 'must provide replicaLabels',
stores: ['dnssrv+_grpc._tcp.thanos-store.%s.svc.cluster.local' % defaults.namespace],
stores: ['dnssrv+_grpc._tcp.thanos-store.%s' % defaults.namespace],
rules: [], // TODO(bwplotka): This is deprecated, switch to endpoints while ready.
externalPrefix: '',
prefixHeader: '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
],
tenantLabelName: null,
tenantHeader: null,
clusterDomain: 'cluster.local',
extraEnv: [],
receiveLimitsConfigFile: {},
storeLimits: {},
Expand Down
4 changes: 2 additions & 2 deletions jsonnet/kube-thanos/kube-thanos-receive-ingestor.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ function(params) {
},

storeEndpoints:: [
'dnssrv+_grpc._tcp.%s.%s.svc.cluster.local:%d' % [ingestors.hashrings[name.hashring].service.metadata.name, tr.config.namespace, tr.config.ports.grpc]
'dnssrv+_grpc._tcp.%s.%s:%d' % [ingestors.hashrings[name.hashring].service.metadata.name, tr.config.namespace, tr.config.ports.grpc]
for name in tr.config.hashrings
],

endpoints:: {
[name.hashring]: [
'%s-%d.%s.%s.svc.cluster.local:%d' % [
'%s-%d.%s.%s:%d' % [
ingestors.hashrings[name.hashring].service.metadata.name,
i,
ingestors.hashrings[name.hashring].service.metadata.name,
Expand Down
3 changes: 1 addition & 2 deletions jsonnet/kube-thanos/kube-thanos-receive.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,8 @@ function(params) {
},

statefulSet:
local localEndpointFlag = '--receive.local-endpoint=$(NAME).%s.$(NAMESPACE).svc.%s:%d' % [
local localEndpointFlag = '--receive.local-endpoint=$(NAME).%s.$(NAMESPACE):%d' % [
tr.config.name,
tr.config.clusterDomain,
tr.config.ports.grpc,
];

Expand Down
2 changes: 1 addition & 1 deletion jsonnet/kube-thanos/kube-thanos-store.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -253,5 +253,5 @@ function(params) {
],
},
},
storeEndpoint:: 'dnssrv+_grpc._tcp.%s.%s.svc.cluster.local:%d' % [ts.service.metadata.name, ts.config.namespace, ts.config.ports.grpc],
storeEndpoint:: 'dnssrv+_grpc._tcp.%s.%s:%d' % [ts.service.metadata.name, ts.config.namespace, ts.config.ports.grpc],
}
4 changes: 2 additions & 2 deletions manifests/thanos-query-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ spec:
- --log.format=logfmt
- --query.replica-label=prometheus_replica
- --query.replica-label=rule_replica
- --endpoint=dnssrv+_grpc._tcp.thanos-store.thanos.svc.cluster.local:10901
- --endpoint=dnssrv+_grpc._tcp.thanos-receive-ingestor-default.thanos.svc.cluster.local:10901
- --endpoint=dnssrv+_grpc._tcp.thanos-store.thanos:10901
- --endpoint=dnssrv+_grpc._tcp.thanos-receive-ingestor-default.thanos:10901
- --query.auto-downsampling
env:
- name: HOST_IP_ADDRESS
Expand Down
2 changes: 1 addition & 1 deletion manifests/thanos-receive-ingestor-default-statefulSet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ spec:
- --tsdb.retention=15d
- --label=replica="$(NAME)"
- --label=receive="true"
- --receive.local-endpoint=$(NAME).thanos-receive-ingestor-default.$(NAMESPACE).svc.cluster.local:10901
- --receive.local-endpoint=$(NAME).thanos-receive-ingestor-default.$(NAMESPACE):10901
- --receive.hashrings-file=/var/lib/thanos-receive/hashrings.json
env:
- name: NAME
Expand Down
2 changes: 1 addition & 1 deletion manifests/thanos-receive-router-configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
data:
hashrings.json: '[{"endpoints": ["thanos-receive-ingestor-default-0.thanos-receive-ingestor-default.thanos.svc.cluster.local:10901"], "hashring": "default", "tenants": [ ]}]'
hashrings.json: '[{"endpoints": ["thanos-receive-ingestor-default-0.thanos-receive-ingestor-default.thanos:10901"], "hashring": "default", "tenants": [ ]}]'
kind: ConfigMap
metadata:
name: hashring-config
Expand Down
2 changes: 1 addition & 1 deletion minio.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ local minio = (import 'jsonnet/minio/minio.libsonnet')({
type: s3
config:
bucket: thanos
endpoint: %s.%s.svc.cluster.local:9000
endpoint: %s.%s:9000
insecure: true
access_key: minio
secret_key: minio123
Expand Down