anchor.diff:  	127.0.0.1 - - [03/Nov/2017:17:33:32 +0000] "GET /favicon.ico HTTP/1.1" 404 571 "http://localhost:8080/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36" "-"
   	2017/11/03 17:33:32 [error] 5#5: *2 open() "/usr/share/nginx/html/favicon.ico" failed (2: No such file or directory), client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "localhost:8080", referrer: "http://localhost:8080/"
   
  -=== Delete a Pod
  -
  -Delete the pod as shown below:
  -
  -	$ kubectl delete -f templates/pod.yaml
  -
   === Resource request
   
   A Container in a Pod can be assigned memory and CPU _request_ and _limit_. Request is the minimum amount of memory/CPU needed to run a container. Limit is the maximum amount of memory/CPU that a container will 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.
   
  -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. 
  +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. 
   
   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.
   
  
positive.code: 
  Create the pod as shown below:
  
  	$ kubectl create -f templates/pod.yaml
  	pod "nginx-pod" created
  
  Get the list of pod:
  
negative.code: 	$ kubectl get pod/nginx-pod -o jsonpath={.spec.containers[].resources}
  	map[requests:map[cpu:100m]]
  
  ===== Assign memory and CPU
  
  Let's assign a memory request and limit to a Pod using the configuration file shown:
  
  	apiVersion: v1
  	kind: Pod
  	metadata:
  	  name: nginx-pod2
  	  labels:
  	    name: nginx-pod
  	spec:
  	  containers:
  	  - name: nginx
  	    image: nginx:latest
  	    resources:
  	      limits:
  	        memory: "2Mi"
  	        cpu: 2
  	      requests:
  	        memory: "1Mi"
  	        cpu: 1
  	    ports:
  	    - containerPort: 80
  
  The only change in this configuration file is the addition of `spec.containers[].resources` section. The limits are specified in the `limits` section and the requests are specified in the `requests` section.
  
  Create the pod:
  
  	$ kubectl apply -f templates/pod-resources.yaml
  	pod "nginx-pod2" created
  
  Get more details about the requests and limits:
  
  	$ kubectl get pod/nginx-pod2 -o jsonpath={.spec.containers[].resources}
  	map[limits:map[memory:200Mi cpu:2] requests:map[cpu:1 memory:100Mi]]
  
  NGINX container requires fairly low memory and CPU. And so these request and limit numbers would work well, and the pod is started correctly. Now, let's try to start a WildFly pod using similar numbers. The configuration file for the same is shown:
  
  	apiVersion: v1
  	kind: Pod
  	metadata:
  	  name: wildfly-pod
  	  labels:
  	    name: wildfly-pod
  	spec:
  	  containers:
  	  - name: wildfly
  	    image: jboss/wildfly:11.0.0.Final
  	    resources:
  	      limits:
  	        memory: "200Mi"
  	        cpu: 2
  	      requests:
  	        memory: "100Mi"
  	        cpu: 1
  	    ports:
  	    - containerPort: 8080
  
  The max amount of memory allocated for the WildFly container in this pod is restricted to 200MB. Let's create this Pod:
  
  	$ kubectl apply -f templates/pod-resources2.yaml
  	pod "wildfly-pod" created
  
  Watch the status of the Pod:
  
  	NAME          READY     STATUS              RESTARTS   AGE
  	wildfly-pod   0/1       ContainerCreating   0          5s
  	wildfly-pod   1/1       Running   0         26s
  	wildfly-pod   0/1       OOMKilled   0         29s
  	wildfly-pod   1/1       Running   1         31s
  	wildfly-pod   0/1       OOMKilled   1         34s
  	wildfly-pod   0/1       CrashLoopBackOff   1         45s
  	wildfly-pod   1/1       Running   2         46s
  	wildfly-pod   0/1       OOMKilled   2         49s
  	wildfly-pod   0/1       CrashLoopBackOff   2         1m
  	wildfly-pod   1/1       Running   3         1m
  	wildfly-pod   0/1       OOMKilled   3         1m
  
  It shows that the container could not be started because the maximum amount of memory allocated to the container is too little.
  
  In `templates/pod-resources2.yaml`, change the value of `spec.containers[].resources.limits.memory` to `300Mi`. Delete the existing Pod, and create a new one:
  
  	$ kubectl apply -f templates/pod-resources2.yaml
  	pod "wildfly-pod" created
  	$ kubectl get -w pod/wildfly-pod
  	NAME          READY     STATUS              RESTARTS   AGE
  	wildfly-pod   0/1       ContainerCreating   0          3s
  	wildfly-pod   1/1       Running   0         25s
  
  Now, the Pod successfully starts.
  
  Get more details about the resources allocated to the Pod:
  
  	$ kubectl get pod/wildfly-pod -o jsonpath={.spec.containers[].resources}
  	map[limits:map[cpu:2 memory:300Mi] requests:map[cpu:1 memory:100Mi]]
  
  === Quality of service
  
  