File tree 2 files changed +40
-0
lines changed
docs/tutorials/stateless-application
2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change @@ -94,6 +94,30 @@ specifies that the deployment should be updated to use nginx 1.8.
94
94
95
95
kubectl get pods -l app=nginx
96
96
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
+
97
121
### Deleting a deployment
98
122
99
123
Delete the deployment by name:
You can’t perform that action at this time.
0 commit comments