In production scenarios, you will definitely need to scale your application—this is where Kubernetes is powerful; you can either manually scale your application or use autoscaling. Let's first take a look at how to perform the manual scaling of your Deployment. You can do it either imperatively or declaratively. To perform scaling by using an imperative command in PowerShell, perform these steps:
- Execute the kubectl scale command, which will scale the windows-example Deployment to three replicas:
PS C:\src\declarative-demo> kubectl scale deployment/windows-example --replicas=3
deployment.extensions/windows-example scaled
- Now watch how the Pods are being added to your Deployment:
PS C:\src\declarative-demo> kubectl get pods -w
NAME READY STATUS RESTARTS AGE
windows-example-5cb7456474-5ndrm 0/1 ContainerCreating 0 8s
windows-example-5cb7456474...