Skip to content

Commit 791000c

Browse files
Add replica count to tutorial. (kubernetes#1434)
1 parent f57e43a commit 791000c

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
apiVersion: extensions/v1beta1
2+
kind: Deployment
3+
metadata:
4+
name: nginx-deployment
5+
spec:
6+
replicas: 4
7+
template:
8+
metadata:
9+
labels:
10+
app: nginx
11+
spec:
12+
containers:
13+
- name: nginx
14+
image: nginx:1.8 # Update the version of nginx from 1.7.9 to 1.8
15+
ports:
16+
- containerPort: 80

docs/tutorials/stateless-application/run-stateless-application-deployment.md

+24
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,30 @@ specifies that the deployment should be updated to use nginx 1.8.
9494

9595
kubectl get pods -l app=nginx
9696

97+
### Scaling the application by increasing the replica count
98+
99+
You can increase the number of pods in your Deployment by applying a new YAML
100+
file. This YAML file sets `replicas` to 4, which specifies that the Deployment
101+
should have four pods:
102+
103+
{% include code.html language="yaml" file="deployment-scale.yaml" ghlink="/docs/tutorials/stateless-application/deployment-scale.yaml" %}
104+
105+
1. Apply the new YAML file:
106+
107+
kubectl apply -f $REPO/docs/tutorials/stateless-application/deployment-scale.yaml
108+
109+
1. Verify that the Deployment has four pods:
110+
111+
kubectl get pods
112+
113+
The output is similar to this:
114+
115+
NAME READY STATUS RESTARTS AGE
116+
nginx-deployment-148880595-4zdqq 1/1 Running 0 25s
117+
nginx-deployment-148880595-6zgi1 1/1 Running 0 25s
118+
nginx-deployment-148880595-fxcez 1/1 Running 0 2m
119+
nginx-deployment-148880595-rwovn 1/1 Running 0 2m
120+
97121
### Deleting a deployment
98122

99123
Delete the deployment by name:

0 commit comments

Comments
 (0)