Argo-cd: Old ReplicaSets are not deleted when sync completes

Created on 5 Nov 2019  路  1Comment  路  Source: argoproj/argo-cd

Checklist:

  • [x] I've searched in the docs and FAQ for my answer: http://bit.ly/argocd-faq.
  • [x] I've included steps to reproduce the bug.
  • [x] I've pasted the output of argocd version.

Describe the bug

Old ReplicaSet not deleted after rollout to new ReplicaSet (even when doing sync with prune enabled).

To Reproduce

  1. Create a simple Helm chart:

Chart.yaml:

apiVersion: v1
name: test
description: A test app
type: application
version: 0.1.0

values.yaml:

replicaCount: 2

templates/deployment.yaml:

apiVersion: apps/v1beta2
kind: Deployment
metadata:
  name: {{ .Release.Name }}
spec:
  replicas: {{ .Values.replicaCount }}
  selector:
    matchLabels:
      app.kubernetes.io/name: {{ .Chart.Name }}
      app.kubernetes.io/instance: {{ .Release.Name }}
  strategy:
  template:
    metadata:
      labels:
        app.kubernetes.io/name: {{ .Chart.Name }}
        app.kubernetes.io/instance: {{ .Release.Name }}
    spec:
      containers:
        - name: nginx
          image: nginx:alpine          
          ports:
            - name: http
              containerPort: 80
              protocol: TCP

templates/service.yaml:

apiVersion: v1
kind: Service
metadata:
  name: {{ .Release.Name }}
spec:
  type: ClusterIP
  ports:
    - name: http
      port: 8080
      targetPort: 80
      protocol: TCP
  selector:
    app.kubernetes.io/name: {{ .Chart.Name }}
    app.kubernetes.io/instance: {{ .Release.Name }}
  1. Create and sync ArgoCD application from this chart.

  2. Edit templates/deployment.yaml: and replace container image to nginx:latest. Sync with prune and wait till sync completes.

  3. Observe the current state of the application: notice two replica sets instead of one.

Expected behavior

Old replica set is deleted after rollout complete.

Screenshots

Notice two replica sets, one is without any pods:

Untitled

Version

argocd: v1.2.5+85f62df
  BuildDate: 2019-10-29T00:05:49Z
  GitCommit: 85f62dff9e3de5a2ee80e9350c897923f59b7e85
  GitTreeState: clean
  GoVersion: go1.12.6
  Compiler: gc
  Platform: linux/amd64
argocd-server: v1.2.4+ad7a69a
  BuildDate: 2019-10-23T20:06:50Z
  GitCommit: ad7a69a79883b7767cbeb88ca9a36d28277bd4ab
  GitTreeState: clean
  GoVersion: go1.12.6
  Compiler: gc
  Platform: linux/amd64
  Ksonnet Version: 0.13.1
bug

Most helpful comment

You should add revisionHistoryLimit to the deployment

>All comments

You should add revisionHistoryLimit to the deployment

Was this page helpful?
0 / 5 - 0 ratings