Skip to content

Commit 96ad4c2

Browse files
committed
1 parent 823d820 commit 96ad4c2

File tree

1 file changed

+14
-18
lines changed

1 file changed

+14
-18
lines changed

01-path-basics/103-kubernetes-concepts/readme.adoc

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ Kubernetes as a platform has a number of abstractions that map to API objects. T
1414

1515
== Prerequisites
1616

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].
1818

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.
2020
Please be sure to `cd` into that directory before running the commands below.
2121

2222
$ 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
230230

231231
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.
232232

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.
234234

235235
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.
236236

@@ -337,7 +337,7 @@ Watch the status of the Pod:
337337
wildfly-pod 1/1 Running 3 1m
338338
wildfly-pod 0/1 OOMKilled 3 1m
339339

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.
341341

342342
In `pod-resources2.yaml`, change the value of `spec.containers[].resources.limits.memory` to `300Mi`. Delete the existing Pod, and create a new one:
343343

@@ -369,7 +369,7 @@ Kubernetes assigns one of the QoS classes to the Pod:
369369

370370
QoS class is used by Kubernetes for scheduling and evicting Pods.
371371

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.
373373

374374
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.
375375

@@ -703,7 +703,7 @@ If rolling back to a specific revision then enter:
703703

704704
Run the following command to delete the Deployment:
705705

706-
$ kubectl delete -f templates/deployment.yaml
706+
$ kubectl delete -f deployment.yaml
707707
deployment "nginx-deployment" deleted
708708

709709
== Service
@@ -1370,7 +1370,7 @@ A new namespace can be created using a configuration file or `kubectl`.
13701370

13711371
. Create a new Namespace:
13721372

1373-
$ kubectl apply -f namespace.yaml
1373+
$ kubectl apply -f namespace.yaml
13741374
namespace "dev" created
13751375

13761376
. Get the list of Namespaces:
@@ -1399,31 +1399,31 @@ No resource limits.
13991399
+
14001400
. Create a Deployment in this new Namespace using a configuration file:
14011401
+
1402-
$ deployment-namespace.yaml
1402+
$ deployment-namespace.yaml
14031403
apiVersion: extensions/v1beta1
14041404
kind: Deployment
14051405
metadata:
14061406
name: nginx-deployment-ns
14071407
namespace: dev
14081408
spec:
1409-
replicas: 3
1409+
replicas: 3
14101410
template:
14111411
metadata:
14121412
labels:
1413-
app: nginx
1413+
app: nginx
14141414
spec:
14151415
containers:
1416-
- name: nginx
1416+
- name: nginx
14171417
image: nginx:1.12.1
1418-
ports:
1418+
ports:
14191419
- containerPort: 80
14201420
- containerPort: 443
14211421
+
14221422
The main change is the addition of `namespace: dev`.
14231423
+
14241424
. Create the Deployment:
14251425

1426-
$ kubectl apply -f deployment-namespace.yaml
1426+
$ kubectl apply -f deployment-namespace.yaml
14271427
deployment "nginx-deployment-ns" created
14281428

14291429
. 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.
14461446

14471447
. Create a Deployment:
14481448

1449-
$ kubectl -n dev2 apply -f templates/deployment.yaml
1449+
$ kubectl -n dev2 apply -f deployment.yaml
14501450
deployment "nginx-deployment-ns" created
14511451

14521452
. Get Deployments in the newly created Namespace:
@@ -1647,7 +1647,3 @@ You are now ready to continue on with the workshop!
16471647
|image:button-continue-developer.png[link=../../03-path-application-development/301-local-development]
16481648
|image:button-continue-operations.png[link=../../02-path-working-with-clusters/201-cluster-monitoring]
16491649
|=====
1650-
1651-
1652-
1653-

0 commit comments

Comments
 (0)