Open kandeshvari opened 2 years ago
@kandeshvari , if the match label is added to the pod template as well, I think it should work. Could you verify if the pod label matches the service label?
@huikang, if I set role: foo
it doesn't work - error is the same. If I set role: leader
- all works fine. But it is not a behaviour that I need. I want to set role: leader
dynamically. Only one pod can be leader
, but if I set role: leader
in the Rollout - all the pods have this label. It is wrong.
The rollout's podTemplate likes Deployment, where all pods have the same labels. The behavior you described sounds a statefulset.
So I don't think dynamic labels will be supported for rollout CR.
Dynamic labels are not for Rollout
. They are for Pod
. As I understand - Rollout
cr is an extension of a Deployment
and must act as a Deployment
. If I use plain Deployment
- everything works fine, if I "translate" it to Rollout
- I'm getting the error. So, I may conclude - the problem is in the Rollout
cr and excessive label checks, that are not present in the Deployment
.
The rollout controller checks if the service
's label matches the pods label
apiVersion: v1
kind: Service
metadata:
name: xxx
spec:
selector:
L1: K1
L2: K2
Then the rollout must have labels L1: K1
and L2: K2
in the its selector's label.
piVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
name: rollouts-test
spec:
selector:
matchLabels:
L1: K1 # --------- > match service's label
L2: K2
Could you illustrate what you use cases?
My case
βββββββββββββββββ
βPod (active) β
ββββββββββββββββββββββββββββΊβ β
β β labels: β
βββββββββββββββ΄βββ β role: leaderβ
βService β βββββββββββββββββ
β β
β selector: β
β role: leaderβ
ββββββββββββββββββ βββββββββββββββββ
βPod (standby) β
β β
β labels: [] β
βββββββββββββββββ
role: leader
is a dynamically added to Pod
label. Service
is always static and points to active pod.
I want to use canary deployment without any traffic shaper. So I await that argo rollouts just will create separate deployment for me, which in my case will be one more standby
pod. I will test it manually, switch the leader to this node, and promote
it to complete the deployment.
Looks like rollout is missing in the picture. Are the two pods belong to the same rollout? What is the selector label of the rollout?
I also have the same problem. Are there any workarounds?
This issue is stale because it has been open 60 days with no activity.
Summary
I use dynamic labeling to pass traffic to leader pod. Definition is
Label
role: leader
is added to pod by a sidecar container after a complex leader check.I do not use label
role
inRollout
and get this errorIs there possibility to use argo rollout in such cases?
argo rollouts: master from 13 Nov '21 k8s: 1.22.3
Message from the maintainers:
Impacted by this bug? Give it a π. We prioritize the issues with the most π.