Skip to content

Commit 5924e5a

Browse files
committed
rename headless service
1 parent 91f9b74 commit 5924e5a

9 files changed

Lines changed: 24 additions & 24 deletions

File tree

rust/operator-binary/src/crd/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ impl v1alpha1::DruidCluster {
472472

473473
/// The name of the role-level load-balanced Kubernetes `Service`
474474
pub fn role_service_name(&self, role: &DruidRole) -> Option<String> {
475-
Some(format!("{}-{}-metrics", self.metadata.name.clone()?, role))
475+
Some(format!("{}-{}-headless", self.metadata.name.clone()?, role))
476476
}
477477

478478
/// The fully-qualified domain name of the role-level load-balanced Kubernetes `Service`
@@ -1682,12 +1682,12 @@ mod tests {
16821682

16831683
assert_eq!(
16841684
cluster.role_service_name(&DruidRole::Router),
1685-
Some("testcluster-router-metrics".to_string())
1685+
Some("testcluster-router-headless".to_string())
16861686
);
16871687

16881688
assert_eq!(
16891689
cluster.role_service_fqdn(&DruidRole::Router, &dummy_cluster_info),
1690-
Some("testcluster-router-metrics.default.svc.cluster.local".to_string())
1690+
Some("testcluster-router-headless.default.svc.cluster.local".to_string())
16911691
)
16921692
}
16931693

rust/operator-binary/src/druid_controller.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,7 @@ fn build_rolegroup_config_map(
843843
}
844844

845845
pub fn rolegroup_service_name(rolegroup: &RoleGroupRef<v1alpha1::DruidCluster>) -> String {
846-
format!("{name}-metrics", name = rolegroup.object_name())
846+
format!("{name}-headless", name = rolegroup.object_name())
847847
}
848848

849849
/// The rolegroup [`Service`] is a headless service that allows direct access to the instances of a certain rolegroup

tests/templates/kuttl/authorizer/authcheck.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import sys
33
import logging
44

5-
coordinator_host = "derby-druid-coordinator-default-metrics"
5+
coordinator_host = "derby-druid-coordinator-default-headless"
66
coordinator_port = "8281"
77
authenticator_name = "MyBasicMetadataAuthenticator"
88

@@ -52,7 +52,7 @@ def create_user(user_name):
5252
}
5353

5454
for role, port in druid_role_ports.items():
55-
url = f"https://{druid_cluster_name}-{role}-default-metrics:{port}/status"
55+
url = f"https://{druid_cluster_name}-{role}-default-headless:{port}/status"
5656
# make an authorized request -> return 401 expected
5757
print("Checking Unauthorized")
5858
res = requests.get(url, verify=False)

tests/templates/kuttl/commons/healthcheck.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
for role, port in druid_role_ports.items():
2727
url = (
28-
f"https://{druid_cluster_name}-{role}-default-metrics:{port}/status/health"
28+
f"https://{druid_cluster_name}-{role}-default-headless:{port}/status/health"
2929
)
3030
count = 1
3131

tests/templates/kuttl/commons/ingestioncheck-tls.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def query_datasource(self, url, sql, expected, iterations):
9494
Query tasks
9595
===========""")
9696
tasks = druid.get_tasks(
97-
url=f"{protocol}://{druid_cluster_name}-coordinator-default-0.{druid_cluster_name}-coordinator-default-metrics.{namespace}.svc.cluster.local:{coordinator_port}/druid/indexer/v1/tasks",
97+
url=f"{protocol}://{druid_cluster_name}-coordinator-default-0.{druid_cluster_name}-coordinator-default-headless.{namespace}.svc.cluster.local:{coordinator_port}/druid/indexer/v1/tasks",
9898
)
9999
task_count = len(json.loads(tasks))
100100
print(f"existing tasks: {task_count}")
@@ -103,7 +103,7 @@ def query_datasource(self, url, sql, expected, iterations):
103103
Start ingestion task
104104
====================""")
105105
ingestion = druid.post_task(
106-
url=f"{protocol}://{druid_cluster_name}-coordinator-default-0.{druid_cluster_name}-coordinator-default-metrics.{namespace}.svc.cluster.local:{coordinator_port}/druid/indexer/v1/task",
106+
url=f"{protocol}://{druid_cluster_name}-coordinator-default-0.{druid_cluster_name}-coordinator-default-headless.{namespace}.svc.cluster.local:{coordinator_port}/druid/indexer/v1/task",
107107
input="/tmp/druid-quickstartimport.json",
108108
)
109109
task_id = json.loads(ingestion)["task"]
@@ -113,7 +113,7 @@ def query_datasource(self, url, sql, expected, iterations):
113113
Re-query tasks
114114
==============""")
115115
tasks = druid.get_tasks(
116-
url=f"{protocol}://{druid_cluster_name}-coordinator-default-0.{druid_cluster_name}-coordinator-default-metrics.{namespace}.svc.cluster.local:{coordinator_port}/druid/indexer/v1/tasks",
116+
url=f"{protocol}://{druid_cluster_name}-coordinator-default-0.{druid_cluster_name}-coordinator-default-headless.{namespace}.svc.cluster.local:{coordinator_port}/druid/indexer/v1/tasks",
117117
)
118118
new_task_count = len(json.loads(tasks))
119119
print(f"new tasks: {new_task_count}")
@@ -127,7 +127,7 @@ def query_datasource(self, url, sql, expected, iterations):
127127
while not job_finished:
128128
time.sleep(5)
129129
task = druid.get(
130-
url=f"{protocol}://{druid_cluster_name}-coordinator-default-0.{druid_cluster_name}-coordinator-default-metrics.{namespace}.svc.cluster.local:{coordinator_port}/druid/indexer/v1/task/{url_encoded_taskid}/status",
130+
url=f"{protocol}://{druid_cluster_name}-coordinator-default-0.{druid_cluster_name}-coordinator-default-headless.{namespace}.svc.cluster.local:{coordinator_port}/druid/indexer/v1/task/{url_encoded_taskid}/status",
131131
)
132132
task_status = json.loads(task)["status"]["statusCode"]
133133
print(f"Current task status: [{task_status}]")
@@ -143,7 +143,7 @@ def query_datasource(self, url, sql, expected, iterations):
143143
while not broker_ready:
144144
time.sleep(2)
145145
broker_ready_rc = druid.check_rc(
146-
f"{protocol}://{druid_cluster_name}-broker-default-0.{druid_cluster_name}-broker-default-metrics.{namespace}.svc.cluster.local:{broker_port}/druid/broker/v1/readiness"
146+
f"{protocol}://{druid_cluster_name}-broker-default-0.{druid_cluster_name}-broker-default-headless.{namespace}.svc.cluster.local:{broker_port}/druid/broker/v1/readiness"
147147
)
148148
broker_ready = broker_ready_rc == 200
149149
print(f"Broker respondend with [{broker_ready_rc}] to readiness check")
@@ -153,7 +153,7 @@ def query_datasource(self, url, sql, expected, iterations):
153153
==============""")
154154
sample_data_size = 39244
155155
result = druid.query_datasource(
156-
url=f"{protocol}://{druid_cluster_name}-broker-default-0.{druid_cluster_name}-broker-default-metrics.{namespace}.svc.cluster.local:{broker_port}/druid/v2/sql",
156+
url=f"{protocol}://{druid_cluster_name}-broker-default-0.{druid_cluster_name}-broker-default-headless.{namespace}.svc.cluster.local:{broker_port}/druid/v2/sql",
157157
sql={"query": 'select count(*) as c from "wikipedia-2015-09-12"'},
158158
expected=sample_data_size,
159159
iterations=12,

tests/templates/kuttl/commons/ingestioncheck.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def query_datasource(self, url, sql, expected, iterations):
5555
Query tasks
5656
===========""")
5757
tasks = druid.get_tasks(
58-
url=f"https://{druid_cluster_name}-coordinator-default-metrics:8281/druid/indexer/v1/tasks",
58+
url=f"https://{druid_cluster_name}-coordinator-default-headless:8281/druid/indexer/v1/tasks",
5959
)
6060
task_count = len(json.loads(tasks))
6161
print(f"existing tasks: {task_count}")
@@ -64,7 +64,7 @@ def query_datasource(self, url, sql, expected, iterations):
6464
Start ingestion task
6565
====================""")
6666
ingestion = druid.post_task(
67-
url=f"https://{druid_cluster_name}-coordinator-default-metrics:8281/druid/indexer/v1/task",
67+
url=f"https://{druid_cluster_name}-coordinator-default-headless:8281/druid/indexer/v1/task",
6868
input="/tmp/druid-quickstartimport.json",
6969
)
7070
task_id = json.loads(ingestion)["task"]
@@ -74,7 +74,7 @@ def query_datasource(self, url, sql, expected, iterations):
7474
Re-query tasks
7575
==============""")
7676
tasks = druid.get_tasks(
77-
url=f"https://{druid_cluster_name}-coordinator-default-metrics:8281/druid/indexer/v1/tasks",
77+
url=f"https://{druid_cluster_name}-coordinator-default-headless:8281/druid/indexer/v1/tasks",
7878
)
7979
new_task_count = len(json.loads(tasks))
8080
print(f"new tasks: {new_task_count}")
@@ -88,7 +88,7 @@ def query_datasource(self, url, sql, expected, iterations):
8888
while not job_finished:
8989
time.sleep(5)
9090
task = druid.get(
91-
url=f"https://{druid_cluster_name}-coordinator-default-metrics:8281/druid/indexer/v1/task/{url_encoded_taskid}/status",
91+
url=f"https://{druid_cluster_name}-coordinator-default-headless:8281/druid/indexer/v1/task/{url_encoded_taskid}/status",
9292
)
9393
task_status = json.loads(task)["status"]["statusCode"]
9494
print(f"Current task status: [{task_status}]")
@@ -104,7 +104,7 @@ def query_datasource(self, url, sql, expected, iterations):
104104
while not broker_ready:
105105
time.sleep(2)
106106
broker_ready_rc = druid.check_rc(
107-
f"https://{druid_cluster_name}-broker-default-metrics:8282/druid/broker/v1/readiness"
107+
f"https://{druid_cluster_name}-broker-default-headless:8282/druid/broker/v1/readiness"
108108
)
109109
broker_ready = broker_ready_rc == 200
110110
print(f"Broker respondend with [{broker_ready_rc}] to readiness check")
@@ -114,7 +114,7 @@ def query_datasource(self, url, sql, expected, iterations):
114114
==============""")
115115
sample_data_size = 39244
116116
result = druid.query_datasource(
117-
url=f"https://{druid_cluster_name}-broker-default-metrics:8282/druid/v2/sql",
117+
url=f"https://{druid_cluster_name}-broker-default-headless:8282/druid/v2/sql",
118118
sql={"query": 'select count(*) as c from "wikipedia-2015-09-12"'},
119119
expected=sample_data_size,
120120
iterations=12,

tests/templates/kuttl/ldap/authcheck.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def main():
2626
)
2727

2828
for role, port in druid_role_ports.items():
29-
url = f"https://{druid_cluster_name}-{role}-default-metrics:{port}/status"
29+
url = f"https://{druid_cluster_name}-{role}-default-headless:{port}/status"
3030
# make an authorized request -> return 401 expected
3131
logging.info(f"making unauthorized request to {role}.")
3232
res = requests.get(url, verify=False)

tests/templates/kuttl/oidc/login.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
session = requests.Session()
1717

18-
druid_router_service = f"druid-router-default-metrics.{namespace}.svc.cluster.local"
18+
druid_router_service = f"druid-router-default-headless.{namespace}.svc.cluster.local"
1919
keycloak_service = f"keycloak.{namespace}.svc.cluster.local"
2020

2121
# Open Druid web UI which will redirect to OIDC login

tests/templates/kuttl/tls/check-tls.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ TYPE=$2
77
# No encryption
88
if [[ $TYPE == "no-tls" ]]
99
then
10-
HOST=http://derby-druid-router-default-0.derby-druid-router-default-metrics.${NAMESPACE}.svc.cluster.local:8888/status/health
10+
HOST=http://derby-druid-router-default-0.derby-druid-router-default-headless.${NAMESPACE}.svc.cluster.local:8888/status/health
1111

1212
# should work
1313
echo "[NO_TLS] Test unsecured access"
@@ -23,7 +23,7 @@ fi
2323
# Only encryption
2424
if [[ $TYPE == "internal-and-server-tls" ]]
2525
then
26-
HOST=https://derby-druid-router-default-0.derby-druid-router-default-metrics.${NAMESPACE}.svc.cluster.local:9088/status/health
26+
HOST=https://derby-druid-router-default-0.derby-druid-router-default-headless.${NAMESPACE}.svc.cluster.local:9088/status/health
2727

2828
# should not work without --insecure
2929
echo "[TLS_ENCRYPTION] Test TLS without trusted CA and without insecure access"
@@ -69,7 +69,7 @@ fi
6969
# Encryption and TLS client auth
7070
if [[ $TYPE == "internal-and-server-tls-and-tls-client-auth" ]]
7171
then
72-
HOST=https://derby-druid-router-default-0.derby-druid-router-default-metrics.${NAMESPACE}.svc.cluster.local:9088/status/health
72+
HOST=https://derby-druid-router-default-0.derby-druid-router-default-headless.${NAMESPACE}.svc.cluster.local:9088/status/health
7373

7474
# Should fail
7575
echo "[TLS_AUTH] Test insecure access"

0 commit comments

Comments
 (0)