[FEATURE]: Propagate role label to pods
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 75/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- go, kubernetes
- Domain
- infrastructure
Research direction
Start by locating the operator logic that propagates the existing cluster, node-index, and shard-index labels to pods, then compare it with the ValkeyNode status role shown in the issue. Done means primary and replica pods receive distinct valkey.io/role labels while existing ValkeyCluster resources remain compatible.
Written by the indexing model from the issue text.
Description
Pre-flight checks
- I have searched existing issues and discussions and could not find a duplicate.
Problem / Use case
I'm checking providing access to discover cluster nodes from outside of EKS cluster, but still inside private network. So client connects via LB, discover nodes and connects by IP to required shards.
While this epic is in progress, I'm trying to add Service (LoadBalancer) in front with config like this:
---
apiVersion: v1
kind: Service
metadata:
name: external-service
spec:
ports:
- name: valkey
port: 6379
protocol: TCP
targetPort: 6379
selector:
valkey.io/cluster: test-cluster
type: LoadBalancer
But it adds all pods from the cluster, not only primary. It's not a big issue I would say, but would be useful to be able to limit it.
As I see, this info already exists in ValkeyNode status (see example below), so it should be relatively easy to add it.
Also, it could be useful for other use cases.
NAME READY ROLE POD AGE
test-cluster-0-0 true primary valkey-test-cluster-0-0-0 40m
test-cluster-0-1 true replica valkey-test-cluster-0-1-0 40m
Proposed solution
Operator already propagates Valkey specific labels, like:
labels:
valkey.io/cluster: test-cluster
valkey.io/node-index: "0"
valkey.io/shard-index: "0"
I think one more could be added, like valkey.io/role: primary (or replica)
Scope of change
Small (small CRD field or controller behaviour tweak)
API / behaviour impact
- This change is backwards-compatible with existing ValkeyCluster CRs.
- This change introduces a breaking API change in
v1alpha1.
Contribution
- I would like to implement this feature myself.
- I would like to help review or test this feature.
Additional context
No response
- Dominant language
- Go
- Stars
- 359
- Forks
- 58
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 11
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.
More from valkey-io/valkey-operator
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
valkey-io/valkey-operator#438 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
valkey-io/valkey-operator#353 · 5 comments ·
-
question
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
valkey-io/valkey-operator#302 · 1 comment ·
-
[BUG]: Reverting a scale-in right after the drain leaves an empty shard the operator never recovers Openbug
Difficulty 4/5 3-5 days Newbie friendliness 55/100
valkey-io/valkey-operator#445 ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 68/100
valkey-io/valkey-operator#444 ·
All issues in valkey-io/valkey-operator
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
-
enhancement needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
kind/cleanup
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
kubernetes-sigs/kueue#15947 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sympozium-ai/sympozium#627 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100