argoproj / argo-rollouts

Progressive Delivery for Kubernetes
https://argo-rollouts.readthedocs.io/
Apache License 2.0
2.75k stars 863 forks source link

Same version is applied to both active and preview pod while blue-green rolling out. #3648

Open geowalrus4gh opened 4 months ago

geowalrus4gh commented 4 months ago

Describe the bug

I have a blue-green config as follows.

blueGreen: 
    activeMetadata:
      labels:
        role: active
        version: {{ .Chart.AppVersion | quote }}
    previewMetadata:
      labels:
        role: preview
        version: {{ .Chart.AppVersion | quote }}

I need to inject the version of application into label while running a blue-green rollout. During first-time deployment, the version of both active and preview will be the same, say 1.0. When I release a new version 1.1, the preview should only be changed to the new version. But in reality, what happens is that both the preview and active versions are changed to new 1.1 version. Any workaround to tackle this?

Expected behavior

Expected is like this

Active pod

labels:
  version: 1.0

Preview pod

labels:
  version: 1.1
kostis-codefresh commented 3 months ago

I don't understand what is the bug here regarding Argo Rollouts.

The purpose of metadata is to hold ephemeral data for Argo Rollouts to distinguish between the two releases. But it is your responsibility to place the content that you want there.

If you want to keep the application version separate the easier way is to keep it in the Rollout itself like this https://github.com/kostis-codefresh/configmaps-argo-rollouts-example/blob/main/manifests/blue-green/example-rollout.yml#L34

Full blog at https://codefresh.io/blog/progressive-delivery-for-kubernetes-config-maps-using-argo-rollouts/