Altinity / Altinity/clickhouse-operator
replicaServiceTemplate is selected at a shard, not the replica.
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 2.6k
- Forks
- 574
- Avg merge
- 8d 6h
- Merged PRs (30d)
- 6
Description
Using operator 0.18.4. My understanding of replicaServiceTemplate is that it will be generated per replica, not per shard. The goal is to have a service that can load balance between replicas specifically, not just the whole CHI.
I've omitted some configuration for posterity.
...
clusters:
- name: simple-test
templates:
replicaServiceTemplate: replica-service-template
layout:
replicas:
- name: ro
shardsCount: 2
- name: wo
shardsCount: 2
serviceTemplates:
- name: replica-service-template
generateName: "replica-{chi}-{cluster}-{replica}"
...
This produces the following selector, for example:
$ kubectl describe service/replica-clickhouse-chart-test-simple-test-ro
...
clickhouse.altinity.com/app=chop
clickhouse.altinity.com/chi=clickhouse-chart-test
clickhouse.altinity.com/cluster=simple-test
clickhouse.altinity.com/namespace=default
clickhouse.altinity.com/replica=ro
clickhouse.altinity.com/shard=1
...
Please advise if I understand replicaServiceTemplate correctly, its goals, and whether or not it should be applying the shard to the selector.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the operator 0.18.4 configuration and inspecting the generated Service with kubectl describe, focusing on replicaServiceTemplate and its selector. Compare the reported replica and shard labels with the intended service scope, then document or test whether the selector should omit the shard label so completion has a clear expected result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- clickhouse, go, kubernetes
- Domain
- databases, infrastructure
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100