From 791000cbe4f771b4c48e7bb330db52ac3e1ff0c1 Mon Sep 17 00:00:00 2001 From: Steve Perry Date: Tue, 11 Oct 2016 14:36:18 -0700 Subject: [PATCH] Add replica count to tutorial. (#1434) --- .../deployment-scale.yaml | 16 +++++++++++++ .../run-stateless-application-deployment.md | 24 +++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 docs/tutorials/stateless-application/deployment-scale.yaml diff --git a/docs/tutorials/stateless-application/deployment-scale.yaml b/docs/tutorials/stateless-application/deployment-scale.yaml new file mode 100644 index 0000000000..2968b88360 --- /dev/null +++ b/docs/tutorials/stateless-application/deployment-scale.yaml @@ -0,0 +1,16 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: nginx-deployment +spec: + replicas: 4 + template: + metadata: + labels: + app: nginx + spec: + containers: + - name: nginx + image: nginx:1.8 # Update the version of nginx from 1.7.9 to 1.8 + ports: + - containerPort: 80 diff --git a/docs/tutorials/stateless-application/run-stateless-application-deployment.md b/docs/tutorials/stateless-application/run-stateless-application-deployment.md index 70aeb925c2..20a7aff243 100644 --- a/docs/tutorials/stateless-application/run-stateless-application-deployment.md +++ b/docs/tutorials/stateless-application/run-stateless-application-deployment.md @@ -94,6 +94,30 @@ specifies that the deployment should be updated to use nginx 1.8. kubectl get pods -l app=nginx +### Scaling the application by increasing the replica count + +You can increase the number of pods in your Deployment by applying a new YAML +file. This YAML file sets `replicas` to 4, which specifies that the Deployment +should have four pods: + +{% include code.html language="yaml" file="deployment-scale.yaml" ghlink="/docs/tutorials/stateless-application/deployment-scale.yaml" %} + +1. Apply the new YAML file: + + kubectl apply -f $REPO/docs/tutorials/stateless-application/deployment-scale.yaml + +1. Verify that the Deployment has four pods: + + kubectl get pods + + The output is similar to this: + + NAME READY STATUS RESTARTS AGE + nginx-deployment-148880595-4zdqq 1/1 Running 0 25s + nginx-deployment-148880595-6zgi1 1/1 Running 0 25s + nginx-deployment-148880595-fxcez 1/1 Running 0 2m + nginx-deployment-148880595-rwovn 1/1 Running 0 2m + ### Deleting a deployment Delete the deployment by name: