You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 01-path-basics/103-kubernetes-concepts/readme.adoc
+14-18Lines changed: 14 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,9 +14,9 @@ Kubernetes as a platform has a number of abstractions that map to API objects. T
14
14
15
15
== Prerequisites
16
16
17
-
This chapter uses a cluster with 3 master nodes and 5 worker nodes as described link:../102-your-first-cluster#multi-master[here].
17
+
This chapter uses a cluster with 3 master nodes and 5 worker nodes as described link:../102-your-first-cluster#multi-master[here].
18
18
19
-
All configuration files for this chapter are in the `01-path-basics/103-kubernetes-concepts/templates` directory.
19
+
All configuration files for this chapter are in the `01-path-basics/103-kubernetes-concepts/templates` directory.
20
20
Please be sure to `cd` into that directory before running the commands below.
21
21
22
22
$ cd 01-path-basics/103-kubernetes-concepts/templates
@@ -230,7 +230,7 @@ If the containers in the pod generate logs, then they can be seen using the comm
230
230
231
231
A Container in a Pod can be assigned memory and CPU _request_ and _limit_. Request is the minimum amount of memory/CPU that Kubernetes will give to the container. Limit is the maximum amount of memory/CPU that a container will be allowed to use. The memory/CPU request/limit for the Pod is the sum of the memory/CPU requests/limits for all the Containers in the Pod. Request defaults to limit if not specified. Default value of the limit is the node capacity.
232
232
233
-
A Pod can be scheduled on a node if the Pod's memory and CPU request can be met. Memory and CPU limits are not taken into consideration for scheduling.
233
+
A Pod can be scheduled on a node if the Pod's memory and CPU request can be met. Memory and CPU limits are not taken into consideration for scheduling.
234
234
235
235
Pod can continue to operate on the node if Containers in the Pod does not exceed the memory request. If Containers in the Pod exceeds the memory request then they become target of eviction whenever the node runs out of memory. If Containers in the Pod exceeds the memory limit then they are terminated. If the Pod can be restarted, then kubelet will restart it, just like any other type of runtime failure. A Container might or might not be allowed to exceed its CPU limit for extended periods of time. However, it will not be killed for excessive usage.
236
236
@@ -337,7 +337,7 @@ Watch the status of the Pod:
337
337
wildfly-pod 1/1 Running 3 1m
338
338
wildfly-pod 0/1 OOMKilled 3 1m
339
339
340
-
`OOMKilled` shows that the container was terminated because it ran out of memory.
340
+
`OOMKilled` shows that the container was terminated because it ran out of memory.
341
341
342
342
In `pod-resources2.yaml`, change the value of `spec.containers[].resources.limits.memory` to `300Mi`. Delete the existing Pod, and create a new one:
343
343
@@ -369,7 +369,7 @@ Kubernetes assigns one of the QoS classes to the Pod:
369
369
370
370
QoS class is used by Kubernetes for scheduling and evicting Pods.
371
371
372
-
When every Container in a Pod is given a memory and CPU limit, and optionally non-zero request, and they exactly match, then a Pod is scheduled with `Guaranteed` QoS. This is the higest priority.
372
+
When every Container in a Pod is given a memory and CPU limit, and optionally non-zero request, and they exactly match, then a Pod is scheduled with `Guaranteed` QoS. This is the higest priority.
373
373
374
374
A Pod is given `Burstable` QoS class if the Pod does not meet the `Guaranteed` QoS and at least one Container has a memory or CPU request. This is intermediate priority.
375
375
@@ -703,7 +703,7 @@ If rolling back to a specific revision then enter:
703
703
704
704
Run the following command to delete the Deployment:
705
705
706
-
$ kubectl delete -f templates/deployment.yaml
706
+
$ kubectl delete -f deployment.yaml
707
707
deployment "nginx-deployment" deleted
708
708
709
709
== Service
@@ -1370,7 +1370,7 @@ A new namespace can be created using a configuration file or `kubectl`.
1370
1370
1371
1371
. Create a new Namespace:
1372
1372
1373
-
$ kubectl apply -f namespace.yaml
1373
+
$ kubectl apply -f namespace.yaml
1374
1374
namespace "dev" created
1375
1375
1376
1376
. Get the list of Namespaces:
@@ -1399,31 +1399,31 @@ No resource limits.
1399
1399
+
1400
1400
. Create a Deployment in this new Namespace using a configuration file:
1401
1401
+
1402
-
$ deployment-namespace.yaml
1402
+
$ deployment-namespace.yaml
1403
1403
apiVersion: extensions/v1beta1
1404
1404
kind: Deployment
1405
1405
metadata:
1406
1406
name: nginx-deployment-ns
1407
1407
namespace: dev
1408
1408
spec:
1409
-
replicas: 3
1409
+
replicas: 3
1410
1410
template:
1411
1411
metadata:
1412
1412
labels:
1413
-
app: nginx
1413
+
app: nginx
1414
1414
spec:
1415
1415
containers:
1416
-
- name: nginx
1416
+
- name: nginx
1417
1417
image: nginx:1.12.1
1418
-
ports:
1418
+
ports:
1419
1419
- containerPort: 80
1420
1420
- containerPort: 443
1421
1421
+
1422
1422
The main change is the addition of `namespace: dev`.
1423
1423
+
1424
1424
. Create the Deployment:
1425
1425
1426
-
$ kubectl apply -f deployment-namespace.yaml
1426
+
$ kubectl apply -f deployment-namespace.yaml
1427
1427
deployment "nginx-deployment-ns" created
1428
1428
1429
1429
. Deployment in a Namespace can be queried by providing an additional switch `-n` as shown:
@@ -1446,7 +1446,7 @@ Alternatively, a namespace can be created using `kubectl` as well.
0 commit comments