Repository: kubernetes
Issue: Kubectl reported a Deployment scaled where as replicas are unavailable
Labels: kind/feature,sig/apps,sig/cli,lifecycle/frozen

/kind bug
/sig api-machinery

**What happened**:

kubectl reported a Deployment scaled even when the replicas were unavailable.

**What you expected to happen**:

All replicas in the Deployment were unavailable and even then the command output showed that Deployment scaled.

**How to reproduce it (as minimally and precisely as possible)**:

Create a Deployment using the configuration file:

```
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: nginx-deployment 
spec:
  replicas: 3 
  template:
    metadata:
      labels:
        app: nginx 
    spec:
      containers:
      - name: nginx 
        image: nginx:1.12.1
        ports: 
        - containerPort: 80
        - containerPort: 443
```

Create a ResourceQuota using the configuration file:

```
apiVersion: v1
kind: ResourceQuota
metadata:
  name: quota
spec:
  hard:
    cpu: "10"
    memory: 6Gi
    pods: "10"
    replicationcontrollers: "3"
    services: "5"
    configmaps: "5"
```

Describe the quota:

```
$ kubectl describe quota/quota
Name:                   quota
Namespace:              default
Resource                Used  Hard
--------                ----  ----
configmaps              0     5
cpu                     300m  10
memory                  0     6Gi
pods                    3     10
replicationcontrollers  0     3
services                1     5
```

Scale the deployment:

```
$ kubectl scale --replicas=12 deployment/nginx-deployment
deployment "nginx-deployment" scaled
```
The output indicates that the deployment was scaled.

Getting more details about Deployment shows that 9 replicas are unavailable:

```
$ kubectl describe deployment/nginx-deployment
Name:                   nginx-deployment
Namespace:              default
CreationTimestamp:      Wed, 08 Nov 2017 15:25:03 -0800
Labels:                 app=nginx
Annotations:            deployment.kubernetes.io/revision=1
                        kubectl.kubernetes.io/last-applied-configuration={"apiVersion":"extensions/v1beta1","kind":"Deployment","metadata":{"annotations":{},"name":"nginx-deployment","namespace":"default"},"spec":{"replicas"...
Selector:               app=nginx
Replicas:               12 desired | 3 updated | 3 total | 3 available | 9 unavailable
```

Is this the expected behavior?

Also, no reason is given as to why the replicas did not scale.

**Anything else we need to know?**:

**Environment**:
- Kubernetes version (use `kubectl version`):

$ kubectl version
Client Version: version.Info{Major:"1", Minor:"8", GitVersion:"v1.8.2", GitCommit:"bdaeafa71f6c7c04636251031f93464384d54963", GitTreeState:"clean", BuildDate:"2017-10-24T21:07:53Z", GoVersion:"go1.9.1", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"7", GitVersion:"v1.7.4", GitCommit:"793658f2d7ca7f064d2bdf606519f9fe1229c381", GitTreeState:"clean", BuildDate:"2017-08-17T08:30:51Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}

- Cloud provider or hardware configuration:

AWS

- OS (e.g. from /etc/os-release):
- Kernel (e.g. `uname -a`):
- Install tools:
- Others: