How to: Lab 7.2. Scale deployment
A deployment creates a ReplicaSet that manages scalability. Do not manage replicasets outside of deployments.

1. Create a deployment using the official deployment manifest example `controllers/nginx-deployment.yaml`
2. List created resources
3. Edit the deployment with `kubectl edit` and change the `namespace` to dev
4. Save the editor and confirm behaviour
5. Edit the deployment again using a different editor, change the replicas to 12 and upgrade the image version
6. Save the editor and confirm behaviour, then immediately list all resources and review:
   - deployment status for `READY`, `UP-TO-DATE` and `AVAILABLE`
   - replicaset status for `DESIRED`, `CURRENT` and `READY`
   - pod status for `NAME`, `READY` and `STATUS`
   - compare the _ID-suffix_ in the Pods name to the ReplicaSets name
7. View details of deployment to confirm edit applied, including image change
8. Scale down the deployment back to 3 replicas using `kubectl scale` and review same in [6]
9. List all resources and confirm scaling applied
10. Delete created resources
11. Edit the `apiVersion` of the manifest example file to `apps/v0`
12. Apply the edited manifest and confirm behaviour
lab7.2 solution
```sh
wget -O lab7-2.yaml https://k8s.io/examples/controllers/nginx-deployment.yaml
kubectl apply -f lab7-2.yaml
kubectl get all
kubectl edit -f lab7-2.yaml
```

```yaml
kind: Deployment
metadata:
  name: nginx-deployment
  namespace: dev