Repository: kubernetes
Issue: Deployment status does not contain information whether there are still `Terminating` Pods (related to old ReplicaSet)
Labels: kind/feature,sig/apps,lifecycle/frozen,needs-triage

/sig apps
/kind feature

**What would you like to be added**:
Deployment status to contain information whether there are still `Terminating` Pods (related to old ReplicaSet).

**Why is this needed**:
According to the K8s docs K8s ensures that no new traffic is routed to `Terminating` Pods. But traffic from existing clients/connections can be still routed to such `Terminating` Pods. Depending on the component itself managed by the Deployment this can lead to issues.
We want to rely on the Deployment status and properly wait until all Pods related to the old ReplicaSet(s) are terminated. Unfortunately, currently the Deployment status does not maintain such information. None of the existing conditions (`Available`, `Progressing`) or status fields does not indicate that there are old Pods which are terminating.
So, one has to implement custom logic to explicitly list/watch Pods and wait until they terminate which is not a good user experience. 


**How to reproduce it (as minimally and precisely as possible)**:
1. Create a Deployment with relatively high `terminationGracePeriodSeconds`.


   ```yaml
   apiVersion: apps/v1
   kind: Deployment
   metadata:
     name: nginx-deployment
     labels:
       app: nginx
   spec:
     replicas: 3
     selector:
       matchLabels:
         app: nginx
     template:
       metadata:
         labels:
           app: nginx
       spec:
         terminationGracePeriodSeconds: 180
         containers:
         - name: nginx
           image: centos
           command: ["/bin/sh"]
           args: ["-c", "sleep 3600"]
           ports:
           - containerPort: 80
   ```

2. Rollout the Deployment

   ```
   $ k rollout restart deploy nginx-deployment
   ```

3. Make sure that the `Terminating` Pods are not reflected in any way in the Deployment status

   The Pods are:
   ```
   $ k get po
   NAME                                READY   STATUS        RESTARTS   AGE
   nginx-deployment-7bd8d8b665-8s2qk   1/1     Running       0          87s
   nginx-deployment-7bd8d8b665-nb6vg   1/1     Running       0          79s
   nginx-deployment-7bd8d8b665-x69b2   1/1     Running       0          70s
   nginx-deployment-7d95f864b7-5lcnf   1/1     Terminating   0          7m14s
   nginx-deployment-7d95f864b7-m2cw4   1/1     Terminating   0          7m14s
   nginx-deployment-7d95f864b7-pbm2k   1/1     Terminating   0          7m14s
   ```
   
   while the Deployment status is:
   ```yaml
     status:
       availableReplicas: 3
       conditions:
       - lastTransitionTime: "2022-05-23T11:34:56Z"
         lastUpdateTime: "2022-05-23T11:34:56Z"
         message: Deployment has minimum availability.
         reason: MinimumReplicasAvailable
         status: "True"
         type: Available
       - lastTransitionTime: "2022-05-18T13:11:28Z"
         lastUpdateTime: "2022-05-23T11:40:28Z"
         message: ReplicaSet "nginx-deployment-7bd8d8b665" has successfully progressed.
         reason: NewReplicaSetAvailable
         status: "True"
         type: Progressing
       observedGeneration: 3
       readyReplicas: 3
       replicas: 3
       updatedReplicas: 3
   ```

   As shared above, none of the existing conditions (`Available`, `Progressing`) or status fields does not indicate that there are old Pods which are terminating.