Question: What is What's next?

Answer: S e e   s y s c t l s   f o r   m o r e   d e t a i l s . A l l o w   r u n n i n g   k u b e - p r o x y   w i t h   i n   n f t a b l e s   m o d e . R e a d   m o r e   i n f o r m a t i o n   i n   c g r o u p s   v 2 .   I t e m s   o n   t h i s   p a g e   r e f e r   t o   t h i r d   p a r t y   p r o d u c t s   o r   p r o j e c t s   t h a t   p r o v i d e   f u n c t i o n a l i t y   r e q u i r e d   b y   K u b e r n e t e s .   T h e   K u b e r n e t e s   p r o j e c t   a u t h o r s   a r e n ' t   r e s p o n s i b l e   f o r   t h o s e   t h i r d - p a r t y   p r o d u c t s   o r   p r o j e c t s .   S e e   t h e   C N C F   w e b s i t e   g u i d e l i n e s   f o r   m o r e   d e t a i l s .   Y o u   s h o u l d   r e a d   t h e   c o n t e n t   g u i d e   b e f o r e   p r o p o s i n g   a   c h a n g e   t h a t   a d d s   a n   e x t r a   t h i r d - p a r t y   l i n k .


Question: What is Resource Management for Pods and Containers?

Answer: Resource Management for Pods and ContainersWhen you specify a Pod, you can optionally specify how much of each resource a container needs. The most common resources to specify are CPU and memory (RAM); there are others.When you specify the resource request for containers in a Pod, the kube-scheduler uses this information to decide which node to place the Pod on. When you specify a resource limit for a container, the kubelet enforces those limits so that the running container is not allowed to use more of that resource than the limit you set. The kubelet also reserves at least the request amount of that system resource specifically for that container to use.Requests and limitsIf the node where a Pod is running has enough of a resource available, it's possible (and allowed) for a container to use more resource than its request for that resource specifies.For example, if you set a memory request of 256 MiB for a container, and that container is in a Pod scheduled to a Node with 8GiB of memory and no other Pods, then the container can try to use more RAM.Limits are a different story. Both cpu and memory limits are applied by the kubelet (and container runtime), and are ultimately enforced by the kernel. On Linux nodes, the Linux kernel enforces limits with cgroups. The behavior of cpu and memory limit enforcement is slightly different.cpu limits are enforced by CPU throttling. When a container approaches its cpu limit, the kernel will restrict access to the CPU corresponding to the container's limit. Thus, a cpu limit is a hard limit the kernel enforces. Containers may not use more CPU than is specified in their cpu limit.memory limits are enforced by the kernel with out of memory (OOM) kills. When a container uses more than its memory limit, the kernel may terminate it. However, terminations only happen when the kernel detects memory pressure. Thus, a container that over allocates memory may not be immediately killed. This means memory limits are enforced reactively. A container may use more memory than its memory limit, but if it does, it may get killed.Note:There is an alpha feature MemoryQoS which attempts to add more preemptive limit enforcement for memory (as opposed to reactive enforcement by the OOM killer). However, this effort is stalled due to a potential livelock situation a memory hungry can cause.Note:If you specify a limit for a resource, but do not specify any request, and no admission-time mechanism has applied a default request for that resource, then Kubernetes copies the limit you specified and uses it as the requested value for the resource.Resource typesCPU and memory are each a resource type. A resource type has a base unit. CPU represents compute processing and is specified in units of Kubernetes CPUs. Memory is specified in units of bytes. For Linux workloads, you can specify huge page resources. Huge pages are a Linux-specific feature where the node kernel allocates blocks of memory that are much larger than the default page


Question: How does Resource Management for Pods and Containers work?

Answer: Resource Management for Pods and ContainersWhen you specify a Pod, you can optionally specify how much of each resource a container needs. The most common resources to specify are CPU and memory (RAM); there are others.When you specify the resource request for containers in a Pod, the kube-scheduler uses this information to decide which node to place the Pod on. When you specify a resource limit for a container, the kubelet enforces those limits so that the running container is not allowed to use more of that resource than the limit you set. The kubelet also reserves at least the request amount of that system resource specifically for that container to use.Requests and limitsIf the node where a Pod is running has enough of a resource available, it's possible (and allowed) for a container to use more resource than its request for that resource specifies.For example, if you set a memory request of 256 MiB for a container, and that container is in a Pod scheduled to a Node with 8GiB of memory and no other Pods, then the container can try to use more RAM.Limits are a different story. Both cpu and memory limits are applied by the kubelet (and container runtime), and are ultimately enforced by the kernel. On Linux nodes, the Linux kernel enforces limits with cgroups. The behavior of cpu and memory limit enforcement is slightly different.cpu limits are enforced by CPU throttling. When a container approaches its cpu limit, the kernel will restrict access to the CPU corresponding to the container's limit. Thus, a cpu limit is a hard limit the kernel enforces. Containers may not use more CPU than is specified in their cpu limit.memory limits are enforced by the kernel with out of memory (OOM) kills. When a container uses more than its memory limit, the kernel may terminate it. However, terminations only happen when the kernel detects memory pressure. Thus, a container that over allocates memory may not be immediately killed. This means memory limits are enforced reactively. A container may use more memory than its memory limit, but if it does, it may get killed.Note:There is an alpha feature MemoryQoS which attempts to add more preemptive limit enforcement for memory (as opposed to reactive enforcement by the OOM killer). However, this effort is stalled due to a potential livelock situation a memory hungry can cause.Note:If you specify a limit for a resource, but do not specify any request, and no admission-time mechanism has applied a default request for that resource, then Kubernetes copies the limit you specified and uses it as the requested value for the resource.Resource typesCPU and memory are each a resource type. A resource type has a base unit. CPU represents compute processing and is specified in units of Kubernetes CPUs. Memory is specified in units of bytes. For Linux workloads, you can specify huge page resources. Huge pages are a Linux-specific feature where the node kernel allocates blocks of memory that are much larger than the default page


Question: When would you use Resource Management for Pods and Containers?

Answer: Resource Management for Pods and ContainersWhen you specify a Pod, you can optionally specify how much of each resource a container needs. The most common resources to specify are CPU and memory (RAM); there are others.When you specify the resource request for containers in a Pod, the kube-scheduler uses this information to decide which node to place the Pod on. When you specify a resource limit for a container, the kubelet enforces those limits so that the running container is not allowed to use more of that resource than the limit you set. The kubelet also reserves at least the request amount of that system resource specifically for that container to use.Requests and limitsIf the node where a Pod is running has enough of a resource available, it's possible (and allowed) for a container to use more resource than its request for that resource specifies.For example, if you set a memory request of 256 MiB for a container, and that container is in a Pod scheduled to a Node with 8GiB of memory and no other Pods, then the container can try to use more RAM.Limits are a different story. Both cpu and memory limits are applied by the kubelet (and container runtime), and are ultimately enforced by the kernel. On Linux nodes, the Linux kernel enforces limits with cgroups. The behavior of cpu and memory limit enforcement is slightly different.cpu limits are enforced by CPU throttling. When a container approaches its cpu limit, the kernel will restrict access to the CPU corresponding to the container's limit. Thus, a cpu limit is a hard limit the kernel enforces. Containers may not use more CPU than is specified in their cpu limit.memory limits are enforced by the kernel with out of memory (OOM) kills. When a container uses more than its memory limit, the kernel may terminate it. However, terminations only happen when the kernel detects memory pressure. Thus, a container that over allocates memory may not be immediately killed. This means memory limits are enforced reactively. A container may use more memory than its memory limit, but if it does, it may get killed.Note:There is an alpha feature MemoryQoS which attempts to add more preemptive limit enforcement for memory (as opposed to reactive enforcement by the OOM killer). However, this effort is stalled due to a potential livelock situation a memory hungry can cause.Note:If you specify a limit for a resource, but do not specify any request, and no admission-time mechanism has applied a default request for that resource, then Kubernetes copies the limit you specified and uses it as the requested value for the resource.Resource typesCPU and memory are each a resource type. A resource type has a base unit. CPU represents compute processing and is specified in units of Kubernetes CPUs. Memory is specified in units of bytes. For Linux workloads, you can specify huge page resources. Huge pages are a Linux-specific feature where the node kernel allocates blocks of memory that are much larger than the default page


Question: What are the benefits of Resource Management for Pods and Containers?

Answer: Resource Management for Pods and ContainersWhen you specify a Pod, you can optionally specify how much of each resource a container needs. The most common resources to specify are CPU and memory (RAM); there are others.When you specify the resource request for containers in a Pod, the kube-scheduler uses this information to decide which node to place the Pod on. When you specify a resource limit for a container, the kubelet enforces those limits so that the running container is not allowed to use more of that resource than the limit you set. The kubelet also reserves at least the request amount of that system resource specifically for that container to use.Requests and limitsIf the node where a Pod is running has enough of a resource available, it's possible (and allowed) for a container to use more resource than its request for that resource specifies.For example, if you set a memory request of 256 MiB for a container, and that container is in a Pod scheduled to a Node with 8GiB of memory and no other Pods, then the container can try to use more RAM.Limits are a different story. Both cpu and memory limits are applied by the kubelet (and container runtime), and are ultimately enforced by the kernel. On Linux nodes, the Linux kernel enforces limits with cgroups. The behavior of cpu and memory limit enforcement is slightly different.cpu limits are enforced by CPU throttling. When a container approaches its cpu limit, the kernel will restrict access to the CPU corresponding to the container's limit. Thus, a cpu limit is a hard limit the kernel enforces. Containers may not use more CPU than is specified in their cpu limit.memory limits are enforced by the kernel with out of memory (OOM) kills. When a container uses more than its memory limit, the kernel may terminate it. However, terminations only happen when the kernel detects memory pressure. Thus, a container that over allocates memory may not be immediately killed. This means memory limits are enforced reactively. A container may use more memory than its memory limit, but if it does, it may get killed.Note:There is an alpha feature MemoryQoS which attempts to add more preemptive limit enforcement for memory (as opposed to reactive enforcement by the OOM killer). However, this effort is stalled due to a potential livelock situation a memory hungry can cause.Note:If you specify a limit for a resource, but do not specify any request, and no admission-time mechanism has applied a default request for that resource, then Kubernetes copies the limit you specified and uses it as the requested value for the resource.Resource typesCPU and memory are each a resource type. A resource type has a base unit. CPU represents compute processing and is specified in units of Kubernetes CPUs. Memory is specified in units of bytes. For Linux workloads, you can specify huge page resources. Huge pages are a Linux-specific feature where the node kernel allocates blocks of memory that are much larger than the default page


Question: What is Resource Management for Pods and Containers?

Answer: W h e n   y o u   s p e c i f y   a   P o d ,   y o u   c a n   o p t i o n a l l y   s p e c i f y   h o w   m u c h   o f   e a c h   r e s o u r c e   a   c o n t a i n e r   n e e d s .   T h e   m o s t   c o m m o n   r e s o u r c e s   t o   s p e c i f y   a r e   C P U   a n d   m e m o r y   ( R A M ) ;   t h e r e   a r e   o t h e r s .   W h e n   y o u   s p e c i f y   t h e   r e s o u r c e   r e q u e s t   f o r   c o n t a i n e r s   i n   a   P o d ,   t h e   k u b e - s c h e d u l e r   u s e s   t h i s   i n f o r m a t i o n   t o   d e c i d e   w h i c h   n o d e   t o   p l a c e   t h e   P o d   o n .   W h e n   y o u   s p e c i f y   a   r e s o u r c e   l i m i t   f o r   a   c o n t a i n e r ,   t h e   k u b e l e t   e n f o r c e s   t h o s e   l i m i t s   s o   t h a t   t h e   r u n n i n g   c o n t a i n e r   i s   n o t   a l l o w e d   t o   u s e   m o r e   o f   t h a t   r e s o u r c e   t h a n   t h e   l i m i t   y o u   s e t .   T h e   k u b e l e t   a l s o   r e s e r v e s   a t   l e a s t   t h e   r e q u e s t   a m o u n t   o f   t h a t   s y s t e m   r e s o u r c e   s p e c i f i c a l l y   f o r   t h a t   c o n t a i n e r   t o   u s e .


Question: What is Requests and limits?

Answer: I f   t h e   n o d e   w h e r e   a   P o d   i s   r u n n i n g   h a s   e n o u g h   o f   a   r e s o u r c e   a v a i l a b l e ,   i t ' s   p o s s i b l e   ( a n d   a l l o w e d )   f o r   a   c o n t a i n e r   t o   u s e   m o r e   r e s o u r c e   t h a n   i t s   r e q u e s t   f o r   t h a t   r e s o u r c e   s p e c i f i e s .   F o r   e x a m p l e ,   i f   y o u   s e t   a   m e m o r y   r e q u e s t   o f   2 5 6   M i B   f o r   a   c o n t a i n e r ,   a n d   t h a t   c o n t a i n e r   i s   i n   a   P o d   s c h e d u l e d   t o   a   N o d e   w i t h   8 G i B   o f   m e m o r y   a n d   n o   o t h e r   P o d s ,   t h e n   t h e   c o n t a i n e r   c a n   t r y   t o   u s e   m o r e   R A M .   L i m i t s   a r e   a   d i f f e r e n t   s t o r y .   B o t h   c p u   a n d   m e m o r y   l i m i t s   a r e   a p p l i e d   b y   t h e   k u b e l e t   ( a n d   c o n t a i n e r   r u n t i m e ) ,   a n d   a r e   u l t i m a t e l y   e n f o r c e d   b y   t h e   k e r n e l .   O n   L i n u x   n o d e s ,   t h e   L i n u x   k e r n e l   e n f o r c e s   l i m i t s   w i t h   c g r o u p s .   T h e   b e h a v i o r   o f   c p u   a n d   m e m o r y   l i m i t   e n f o r c e m e n t   i s   s l i g h t l y   d i f f e r e n t .   c p u   l i m i t s   a r e   e n f o r c e d   b y   C P U   t h r o t t l i n g .   W h e n   a   c o n t a i n e r   a p p r o a c h e s   i t s   c p u   l i m i t ,   t h e   k e r n e l   w i l l   r e s t r i c t   a c c e s s   t o   t h e   C P U   c o r r e s p o n d i n g   t o   t h e   c o n t a i n e r ' s   l i m i t .   T h u s ,   a   c p u   l i m i t   i s   a   h a r d   l i m i t   t h e   k e r n e l   e n f o r c e s .   C o n t a i n e r s   m a y   n o t   u s e   m o r e   C P U   t h a n   i s   s p e c i f i e d   i n   t h e i r   c p u   l i m i t .   m e m o r y   l i m i t s   a r e   e n f o r c e d   b y   t h e


Question: What is Resource types?

Answer: C P U   a n d   m e m o r y   a r e   e a c h   a   r e s o u r c e   t y p e .   A   r e s o u r c e   t y p e   h a s   a   b a s e   u n i t .   C P U   r e p r e s e n t s   c o m p u t e   p r o c e s s i n g   a n d   i s   s p e c i f i e d   i n   u n i t s   o f   K u b e r n e t e s   C P U s .   M e m o r y   i s   s p e c i f i e d   i n   u n i t s   o f   b y t e s .   F o r   L i n u x   w o r k l o a d s ,   y o u   c a n   s p e c i f y   h u g e   p a g e   r e s o u r c e s .   H u g e   p a g e s   a r e   a   L i n u x - s p e c i f i c   f e a t u r e   w h e r e   t h e   n o d e   k e r n e l   a l l o c a t e s   b l o c k s   o f   m e m o r y   t h a t   a r e   m u c h   l a r g e r   t h a n   t h e   d e f a u l t   p a g e   s i z e .   F o r   e x a m p l e ,   o n   a   s y s t e m   w h e r e   t h e   d e f a u l t   p a g e   s i z e   i s   4 K i B ,   y o u   c o u l d   s p e c i f y   a   l i m i t ,   h u g e p a g e s - 2 M i :   8 0 M i .   I f   t h e   c o n t a i n e r   t r i e s   a l l o c a t i n g   o v e r   4 0   2 M i B   h u g e   p a g e s   ( a   t o t a l   o f   8 0   M i B ) ,   t h a t   a l l o c a t i o n   f a i l s .


Question: What is Note:?

Answer: C P U   a n d   m e m o r y   a r e   c o l l e c t i v e l y   r e f e r r e d   t o   a s   c o m p u t e   r e s o u r c e s ,   o r   r e s o u r c e s .   C o m p u t e   r e s o u r c e s   a r e   m e a s u r a b l e   q u a n t i t i e s   t h a t   c a n   b e   r e q u e s t e d ,   a l l o c a t e d ,   a n d   c o n s u m e d .   T h e y   a r e   d i s t i n c t   f r o m   A P I   r e s o u r c e s .   A P I   r e s o u r c e s ,   s u c h   a s   P o d s   a n d   S e r v i c e s   a r e   o b j e c t s   t h a t   c a n   b e   r e a d   a n d   m o d i f i e d   t h r o u g h   t h e   K u b e r n e t e s   A P I   s e r v e r .


Question: What is Resource requests and limits of Pod and container?

Answer: F o r   e a c h   c o n t a i n e r ,   y o u   c a n   s p e c i f y   r e s o u r c e   l i m i t s   a n d   r e q u e s t s ,   i n c l u d i n g   t h e   f o l l o w i n g :   s p e c . c o n t a i n e r s [ ] . r e s o u r c e s . l i m i t s . c p u s p e c . c o n t a i n e r s [ ] . r e s o u r c e s . l i m i t s . m e m o r y s p e c . c o n t a i n e r s [ ] . r e s o u r c e s . l i m i t s . h u g e p a g e s - < s i z e > s p e c . c o n t a i n e r s [ ] . r e s o u r c e s . r e q u e s t s . c p u s p e c . c o n t a i n e r s [ ] . r e s o u r c e s . r e q u e s t s . m e m o r y s p e c . c o n t a i n e r s [ ] . r e s o u r c e s . r e q u e s t s . h u g e p a g e s - < s i z e >   A l t h o u g h   y o u   c a n   o n l y   s p e c i f y   r e q u e s t s   a n d   l i m i t s   f o r   i n d i v i d u a l   c o n t a i n e r s ,   i t   i s   a l s o   u s e f u l   t o   t h i n k   a b o u t   t h e   o v e r a l l   r e s o u r c e   r e q u e s t s   a n d   l i m i t s   f o r   a   P o d .   F o r   a   p a r t i c u l a r   r e s o u r c e ,   a   P o d   r e s o u r c e   r e q u e s t / l i m i t   i s   t h e   s u m   o f   t h e   r e s o u r c e   r e q u e s t s / l i m i t s   o f   t h a t   t y p e   f o r   e a c h   c o n t a i n e r   i n   t h e   P o d .


Question: What is Pod-level resource specification?

Answer: P r o v i d e d   y o u r   c l u s t e r   h a s   t h e   P o d L e v e l R e s o u r c e s   f e a t u r e   g a t e   e n a b l e d ,   y o u   c a n   s p e c i f y   r e s o u r c e   r e q u e s t s   a n d   l i m i t s   a t   t h e   P o d   l e v e l .   A t   t h e   P o d   l e v e l ,   K u b e r n e t e s   1 . 3 4   o n l y   s u p p o r t s   r e s o u r c e   r e q u e s t s   o r   l i m i t s   f o r   s p e c i f i c   r e s o u r c e   t y p e s :   c p u   a n d   /   o r   m e m o r y   a n d   /   o r   h u g e p a g e s .   W i t h   t h i s   f e a t u r e ,   K u b e r n e t e s   a l l o w s   y o u   t o   d e c l a r e   a n   o v e r a l l   r e s o u r c e   b u d g e t   f o r   t h e   P o d ,   w h i c h   i s   e s p e c i a l l y   h e l p f u l   w h e n   d e a l i n g   w i t h   a   l a r g e   n u m b e r   o f   c o n t a i n e r s   w h e r e   i t   c a n   b e   d i f f i c u l t   t o   a c c u r a t e l y   g a u g e   i n d i v i d u a l   r e s o u r c e   n e e d s .   A d d i t i o n a l l y ,   i t   e n a b l e s   c o n t a i n e r s   w i t h i n   a   P o d   t o   s h a r e   i d l e   r e s o u r c e s   w i t h   e a c h   o t h e r ,   i m p r o v i n g   r e s o u r c e   u t i l i z a t i o n .   F o r   a   P o d ,   y o u   c a n   s p e c i f y   r e s o u r c e   l i m i t s   a n d   r e q u e s t s   f o r   C P U   a n d   m e m o r y   b y   i n c l u d i n g   t h e   f o l l o w i n g :   s p e c . r e s o u r c e s . l i m i t s . c p u s p e c . r e s o u r c e s . l i m i t s . m e m o r y s p e c . r e s o u r c e s . l i m i t s . h u g e p a g e s - < s i z e > s p e c . r e s o u r c e s . r e q u e s t s . c p u s p e c . r e s o u r c e s . r e q u e s t s . m e m o r y s p e c . r e s o u r c e s . r e q u e s t s . h u g e p a g e s - < s i z e >


Question: What is CPU resource units?

Answer: L i m i t s   a n d   r e q u e s t s   f o r   C P U   r e s o u r c e s   a r e   m e a s u r e d   i n   c p u   u n i t s .   I n   K u b e r n e t e s ,   1   C P U   u n i t   i s   e q u i v a l e n t   t o   1   p h y s i c a l   C P U   c o r e ,   o r   1   v i r t u a l   c o r e ,   d e p e n d i n g   o n   w h e t h e r   t h e   n o d e   i s   a   p h y s i c a l   h o s t   o r   a   v i r t u a l   m a c h i n e   r u n n i n g   i n s i d e   a   p h y s i c a l   m a c h i n e .   F r a c t i o n a l   r e q u e s t s   a r e   a l l o w e d .   W h e n   y o u   d e f i n e   a   c o n t a i n e r   w i t h   s p e c . c o n t a i n e r s [ ] . r e s o u r c e s . r e q u e s t s . c p u   s e t   t o   0 . 5 ,   y o u   a r e   r e q u e s t i n g   h a l f   a s   m u c h   C P U   t i m e   c o m p a r e d   t o   i f   y o u   a s k e d   f o r   1 . 0   C P U .   F o r   C P U   r e s o u r c e   u n i t s ,   t h e   q u a n t i t y   e x p r e s s i o n   0 . 1   i s   e q u i v a l e n t   t o   t h e   e x p r e s s i o n   1 0 0 m ,   w h i c h   c a n   b e   r e a d   a s   " o n e   h u n d r e d   m i l l i c p u " .   S o m e   p e o p l e   s a y   " o n e   h u n d r e d   m i l l i c o r e s " ,   a n d   t h i s   i s   u n d e r s t o o d   t o   m e a n   t h e   s a m e   t h i n g .   C P U   r e s o u r c e   i s   a l w a y s   s p e c i f i e d   a s   a n   a b s o l u t e   a m o u n t   o f   r e s o u r c e ,   n e v e r   a s   a   r e l a t i v e   a m o u n t .   F o r   e x a m p l e ,   5 0 0 m   C P U   r e p r e s e n t s   t h e   r o u g h l y   s a m e   a m o u n t   o f   c o m p u t i n g   p o w e r   w h e t h e r   t h a t   c o n t a i n e r   r u n s   o n   a   s i n g l e - c o r e ,   d u a l - c o r e ,   o r   4 8 - c o r e   m a c h i n e .


Question: What is Note:?

Answer: K u b e r n e t e s   d o e s n ' t   a l l o w   y o u   t o   s p e c i f y   C P U   r e s o u r c e s   w i t h   a   p r e c i s i o n   f i n e r   t h a n   1 m   o r   0 . 0 0 1   C P U .   T o   a v o i d   a c c i d e n t a l l y   u s i n g   a n   i n v a l i d   C P U   q u a n t i t y ,   i t ' s   u s e f u l   t o   s p e c i f y   C P U   u n i t s   u s i n g   t h e   m i l l i C P U   f o r m   i n s t e a d   o f   t h e   d e c i m a l   f o r m   w h e n   u s i n g   l e s s   t h a n   1   C P U   u n i t .   F o r   e x a m p l e ,   y o u   h a v e   a   P o d   t h a t   u s e s   5 m   o r   0 . 0 0 5   C P U   a n d   w o u l d   l i k e   t o   d e c r e a s e   i t s   C P U   r e s o u r c e s .   B y   u s i n g   t h e   d e c i m a l   f o r m ,   i t ' s   h a r d e r   t o   s p o t   t h a t   0 . 0 0 0 5   C P U   i s   a n   i n v a l i d   v a l u e ,   w h i l e   b y   u s i n g   t h e   m i l l i C P U   f o r m ,   i t ' s   e a s i e r   t o   s p o t   t h a t   0 . 5 m   i s   a n   i n v a l i d   v a l u e .


Question: What is Memory resource units?

Answer: L i m i t s   a n d   r e q u e s t s   f o r   m e m o r y   a r e   m e a s u r e d   i n   b y t e s .   Y o u   c a n   e x p r e s s   m e m o r y   a s   a   p l a i n   i n t e g e r   o r   a s   a   f i x e d - p o i n t   n u m b e r   u s i n g   o n e   o f   t h e s e   q u a n t i t y   s u f f i x e s :   E ,   P ,   T ,   G ,   M ,   k .   Y o u   c a n   a l s o   u s e   t h e   p o w e r - o f - t w o   e q u i v a l e n t s :   E i ,   P i ,   T i ,   G i ,   M i ,   K i .   F o r   e x a m p l e ,   t h e   f o l l o w i n g   r e p r e s e n t   r o u g h l y   t h e   s a m e   v a l u e :   1 2 8 9 7 4 8 4 8 ,   1 2 9 e 6 ,   1 2 9 M ,   1 2 8 9 7 4 8 4 8 0 0 0 m ,   1 2 3 M i   P a y   a t t e n t i o n   t o   t h e   c a s e   o f   t h e   s u f f i x e s .   I f   y o u   r e q u e s t   4 0 0 m   o f   m e m o r y ,   t h i s   i s   a   r e q u e s t   f o r   0 . 4   b y t e s .   S o m e o n e   w h o   t y p e s   t h a t   p r o b a b l y   m e a n t   t o   a s k   f o r   4 0 0   m e b i b y t e s   ( 4 0 0 M i )   o r   4 0 0   m e g a b y t e s   ( 4 0 0 M ) .


Question: What is Container resources example?

Answer: T h e   f o l l o w i n g   P o d   h a s   t w o   c o n t a i n e r s .   B o t h   c o n t a i n e r s   a r e   d e f i n e d   w i t h   a   r e q u e s t   f o r   0 . 2 5   C P U   a n d   6 4 M i B   ( 2 2 6   b y t e s )   o f   m e m o r y .   E a c h   c o n t a i n e r   h a s   a   l i m i t   o f   0 . 5   C P U   a n d   1 2 8 M i B   o f   m e m o r y .   Y o u   c a n   s a y   t h e   P o d   h a s   a   r e q u e s t   o f   0 . 5   C P U   a n d   1 2 8   M i B   o f   m e m o r y ,   a n d   a   l i m i t   o f   1   C P U   a n d   2 5 6 M i B   o f   m e m o r y .   - - -   a p i V e r s i o n :   v 1   k i n d :   P o d   m e t a d a t a :   n a m e :   f r o n t e n d   s p e c :   c o n t a i n e r s :   -   n a m e :   a p p   i m a g e :   i m a g e s . m y - c o m p a n y . e x a m p l e / a p p : v 4   r e s o u r c e s :   r e q u e s t s :   m e m o r y :   " 6 4 M i "   c p u :   " 2 5 0 m "   l i m i t s :   m e m o r y :   " 1 2 8 M i "   c p u :   " 5 0 0 m "   -   n a m e :   l o g - a g g r e g a t o r   i m a g e :   i m a g e s . m y - c o m p a n y . e x a m p l e / l o g - a g g r e g a t o r : v 6   r e s o u r c e s :   r e q u e s t s :   m e m o r y :   " 6 4 M i "   c p u :   " 2 5 0 m "   l i m i t s :   m e m o r y :   " 1 2 8 M i "   c p u :   " 5 0 0 m "


Question: What is Pod resources example?

Answer: T h i s   f e a t u r e   c a n   b e   e n a b l e d   b y   s e t t i n g   t h e   P o d L e v e l R e s o u r c e s   f e a t u r e   g a t e .   T h e   f o l l o w i n g   P o d   h a s   a n   e x p l i c i t   r e q u e s t   o f   1   C P U   a n d   1 0 0   M i B   o f   m e m o r y ,   a n d   a n   e x p l i c i t   l i m i t   o f   1   C P U   a n d   2 0 0   M i B   o f   m e m o r y .   T h e   p o d - r e s o u r c e s - d e m o - c t r - 1   c o n t a i n e r   h a s   e x p l i c i t   r e q u e s t s   a n d   l i m i t s   s e t .   H o w e v e r ,   t h e   p o d - r e s o u r c e s - d e m o - c t r - 2   c o n t a i n e r   w i l l   s i m p l y   s h a r e   t h e   r e s o u r c e s   a v a i l a b l e   w i t h i n   t h e   P o d   r e s o u r c e   b o u n d a r i e s ,   a s   i t   d o e s   n o t   h a v e   e x p l i c i t   r e q u e s t s   a n d   l i m i t s   s e t .   a p i V e r s i o n :   v 1   k i n d :   P o d   m e t a d a t a :   n a m e :   p o d - r e s o u r c e s - d e m o   n a m e s p a c e :   p o d - r e s o u r c e s - e x a m p l e   s p e c :   r e s o u r c e s :   l i m i t s :   c p u :   " 1 "   m e m o r y :   " 2 0 0 M i "   r e q u e s t s :   c p u :   " 1 "   m e m o r y :   " 1 0 0 M i "   c o n t a i n e r s :   -   n a m e :   p o d - r e s o u r c e s - d e m o - c t r - 1   i m a g e :   n g i n x   r e s o u r c e s :   l i m i t s :   c p u :   " 0 . 5 "   m e m o r y :   " 1 0 0 M i "   r e q u e s t s :   c p u :   " 0 . 5 "   m e m o r y :   " 5 0 M i "   -   n a m e :   p o d - r e s o u r c e s - d e m o - c t r - 2   i m a g e :   f e d o r a   c o m m a n d :   -   s l e e p   -   i n f


Question: What is How Pods with resource requests are scheduled?

Answer: W h e n   y o u   c r e a t e   a   P o d ,   t h e   K u b e r n e t e s   s c h e d u l e r   s e l e c t s   a   n o d e   f o r   t h e   P o d   t o   r u n   o n .   E a c h   n o d e   h a s   a   m a x i m u m   c a p a c i t y   f o r   e a c h   o f   t h e   r e s o u r c e   t y p e s :   t h e   a m o u n t   o f   C P U   a n d   m e m o r y   i t   c a n   p r o v i d e   f o r   P o d s .   T h e   s c h e d u l e r   e n s u r e s   t h a t ,   f o r   e a c h   r e s o u r c e   t y p e ,   t h e   s u m   o f   t h e   r e s o u r c e   r e q u e s t s   o f   t h e   s c h e d u l e d   c o n t a i n e r s   i s   l e s s   t h a n   t h e   c a p a c i t y   o f   t h e   n o d e .   N o t e   t h a t   a l t h o u g h   a c t u a l   m e m o r y   o r   C P U   r e s o u r c e   u s a g e   o n   n o d e s   i s   v e r y   l o w ,   t h e   s c h e d u l e r   s t i l l   r e f u s e s   t o   p l a c e   a   P o d   o n   a   n o d e   i f   t h e   c a p a c i t y   c h e c k   f a i l s .   T h i s   p r o t e c t s   a g a i n s t   a   r e s o u r c e   s h o r t a g e   o n   a   n o d e   w h e n   r e s o u r c e   u s a g e   l a t e r   i n c r e a s e s ,   f o r   e x a m p l e ,   d u r i n g   a   d a i l y   p e a k   i n   r e q u e s t   r a t e .


Question: What is How Kubernetes applies resource requests and limits?

Answer: W h e n   t h e   k u b e l e t   s t a r t s   a   c o n t a i n e r   a s   p a r t   o f   a   P o d ,   t h e   k u b e l e t   p a s s e s   t h a t   c o n t a i n e r ' s   r e q u e s t s   a n d   l i m i t s   f o r   m e m o r y   a n d   C P U   t o   t h e   c o n t a i n e r   r u n t i m e .   O n   L i n u x ,   t h e   c o n t a i n e r   r u n t i m e   t y p i c a l l y   c o n f i g u r e s   k e r n e l   c g r o u p s   t h a t   a p p l y   a n d   e n f o r c e   t h e   l i m i t s   y o u   d e f i n e d .   T h e   C P U   l i m i t   d e f i n e s   a   h a r d   c e i l i n g   o n   h o w   m u c h   C P U   t i m e   t h e   c o n t a i n e r   c a n   u s e .   D u r i n g   e a c h   s c h e d u l i n g   i n t e r v a l   ( t i m e   s l i c e ) ,   t h e   L i n u x   k e r n e l   c h e c k s   t o   s e e   i f   t h i s   l i m i t   i s   e x c e e d e d ;   i f   s o ,   t h e   k e r n e l   w a i t s   b e f o r e   a l l o w i n g   t h a t   c g r o u p   t o   r e s u m e   e x e c u t i o n . T h e   C P U   r e q u e s t   t y p i c a l l y   d e f i n e s   a   w e i g h t i n g .   I f   s e v e r a l   d i f f e r e n t   c o n t a i n e r s   ( c g r o u p s )   w a n t   t o   r u n   o n   a   c o n t e n d e d   s y s t e m ,   w o r k l o a d s   w i t h   l a r g e r   C P U   r e q u e s t s   a r e   a l l o c a t e d   m o r e   C P U   t i m e   t h a n   w o r k l o a d s   w i t h   s m a l l   r e q u e s t s . T h e   m e m o r y   r e q u e s t   i s   m a i n l y   u s e d   d u r i n g   ( K u b e r n e t e s )   P o d   s c h e d u l i n g .   O n   a   n o d e   t h a t   u s e s   c g r o u p s   v 2 ,   t h e   c o n t a i n e r   r u n t i m e   m i g h t   u s e   t h e   m e m o r y   r e q u e s t   a s   a   h i n t   t o   s e t   m e m o r y . m i n   a n d   m e m o r y . l o w . T h e   m e m o r y   l i m i t   d e f i n e s   a   m e m o r y   l i m i t   f o r   t h a t   c g r o u p


Question: What is Monitoring compute & memory resource usage?

Answer: T h e   k u b e l e t   r e p o r t s   t h e   r e s o u r c e   u s a g e   o f   a   P o d   a s   p a r t   o f   t h e   P o d   s t a t u s .   I f   o p t i o n a l   t o o l s   f o r   m o n i t o r i n g   a r e   a v a i l a b l e   i n   y o u r   c l u s t e r ,   t h e n   P o d   r e s o u r c e   u s a g e   c a n   b e   r e t r i e v e d   e i t h e r   f r o m   t h e   M e t r i c s   A P I   d i r e c t l y   o r   f r o m   y o u r   m o n i t o r i n g   t o o l s .


Question: What is Caution:?

Answer: F r o m   t h e   p e r s p e c t i v e   o f   m e m o r y   m a n a g e m e n t ,   t h e r e   a r e   s o m e   s i m i l a r i t i e s   b e t w e e n   w h e n   a   p r o c e s s   u s e s   m e m o r y   a s   a   w o r k   a r e a   a n d   w h e n   u s i n g   m e m o r y - b a c k e d   e m p t y D i r .   B u t   w h e n   u s i n g   m e m o r y   a s   a   v o l u m e ,   l i k e   m e m o r y - b a c k e d   e m p t y D i r ,   t h e r e   a r e   a d d i t i o n a l   p o i n t s   b e l o w   t h a t   y o u   s h o u l d   b e   c a r e f u l   o f :   F i l e s   s t o r e d   o n   a   m e m o r y - b a c k e d   v o l u m e   a r e   a l m o s t   e n t i r e l y   m a n a g e d   b y   t h e   u s e r   a p p l i c a t i o n .   U n l i k e   w h e n   u s e d   a s   a   w o r k   a r e a   f o r   a   p r o c e s s ,   y o u   c a n   n o t   r e l y   o n   t h i n g s   l i k e   l a n g u a g e - l e v e l   g a r b a g e   c o l l e c t i o n . T h e   p u r p o s e   o f   w r i t i n g   f i l e s   t o   a   v o l u m e   i s   t o   s a v e   d a t a   o r   p a s s   i t   b e t w e e n   a p p l i c a t i o n s .   N e i t h e r   K u b e r n e t e s   n o r   t h e   O S   m a y   a u t o m a t i c a l l y   d e l e t e   f i l e s   f r o m   a   v o l u m e ,   s o   m e m o r y   u s e d   b y   t h o s e   f i l e s   c a n   n o t   b e   r e c l a i m e d   w h e n   t h e   s y s t e m   o r   t h e   p o d   a r e   u n d e r   m e m o r y   p r e s s u r e . A   m e m o r y - b a c k e d   e m p t y D i r   i s   u s e f u l   b e c a u s e   o f   i t s   p e r f o r m a n c e ,   b u t   m e m o r y   i s   g e n e r a l l y   m u c h   s m a l l e r   i n   s i z e   a n d   m u c h   h i g h e r   i n   c o s t   t h a n   o t h e r   s t o r a g e   m e d i a ,   s u c h   a s   d i s k s   o r   S S D s .   U s i n g   l a r g e   a m o u n t s   o f   m e m o r y   f o r   e m p t y D i r   v o l u m e s   m a y


Question: What is Local ephemeral storage?

Answer: N o d e s   h a v e   l o c a l   e p h e m e r a l   s t o r a g e ,   b a c k e d   b y   l o c a l l y - a t t a c h e d   w r i t e a b l e   d e v i c e s   o r ,   s o m e t i m e s ,   b y   R A M .   " E p h e m e r a l "   m e a n s   t h a t   t h e r e   i s   n o   l o n g - t e r m   g u a r a n t e e   a b o u t   d u r a b i l i t y .   P o d s   u s e   e p h e m e r a l   l o c a l   s t o r a g e   f o r   s c r a t c h   s p a c e ,   c a c h i n g ,   a n d   f o r   l o g s .   T h e   k u b e l e t   c a n   p r o v i d e   s c r a t c h   s p a c e   t o   P o d s   u s i n g   l o c a l   e p h e m e r a l   s t o r a g e   t o   m o u n t   e m p t y D i r   v o l u m e s   i n t o   c o n t a i n e r s .   T h e   k u b e l e t   a l s o   u s e s   t h i s   k i n d   o f   s t o r a g e   t o   h o l d   n o d e - l e v e l   c o n t a i n e r   l o g s ,   c o n t a i n e r   i m a g e s ,   a n d   t h e   w r i t a b l e   l a y e r s   o f   r u n n i n g   c o n t a i n e r s .


Question: What is Note:?

Answer: T o   m a k e   t h e   r e s o u r c e   q u o t a   w o r k   o n   e p h e m e r a l - s t o r a g e ,   t w o   t h i n g s   n e e d   t o   b e   d o n e :   A n   a d m i n   s e t s   t h e   r e s o u r c e   q u o t a   f o r   e p h e m e r a l - s t o r a g e   i n   a   n a m e s p a c e . A   u s e r   n e e d s   t o   s p e c i f y   l i m i t s   f o r   t h e   e p h e m e r a l - s t o r a g e   r e s o u r c e   i n   t h e   P o d   s p e c .   I f   t h e   u s e r   d o e s n ' t   s p e c i f y   t h e   e p h e m e r a l - s t o r a g e   r e s o u r c e   l i m i t   i n   t h e   P o d   s p e c ,   t h e   r e s o u r c e   q u o t a   i s   n o t   e n f o r c e d   o n   e p h e m e r a l - s t o r a g e .   K u b e r n e t e s   l e t s   y o u   t r a c k ,   r e s e r v e   a n d   l i m i t   t h e   a m o u n t   o f   e p h e m e r a l   l o c a l   s t o r a g e   a   P o d   c a n   c o n s u m e .


Question: What is Configurations for local ephemeral storage?

Answer: K u b e r n e t e s   s u p p o r t s   t w o   w a y s   t o   c o n f i g u r e   l o c a l   e p h e m e r a l   s t o r a g e   o n   a   n o d e : I n   t h i s   c o n f i g u r a t i o n ,   y o u   p l a c e   a l l   d i f f e r e n t   k i n d s   o f   e p h e m e r a l   l o c a l   d a t a   ( e m p t y D i r   v o l u m e s ,   w r i t e a b l e   l a y e r s ,   c o n t a i n e r   i m a g e s ,   l o g s )   i n t o   o n e   f i l e s y s t e m .   T h e   m o s t   e f f e c t i v e   w a y   t o   c o n f i g u r e   t h e   k u b e l e t   m e a n s   d e d i c a t i n g   t h i s   f i l e s y s t e m   t o   K u b e r n e t e s   ( k u b e l e t )   d a t a . T h e   k u b e l e t   a l s o   w r i t e s   n o d e - l e v e l   c o n t a i n e r   l o g s   a n d   t r e a t s   t h e s e   s i m i l a r l y   t o   e p h e m e r a l   l o c a l   s t o r a g e . T h e   k u b e l e t   w r i t e s   l o g s   t o   f i l e s   i n s i d e   i t s   c o n f i g u r e d   l o g   d i r e c t o r y   ( / v a r / l o g   b y   d e f a u l t ) ;   a n d   h a s   a   b a s e   d i r e c t o r y   f o r   o t h e r   l o c a l l y   s t o r e d   d a t a   ( / v a r / l i b / k u b e l e t   b y   d e f a u l t ) . T y p i c a l l y ,   b o t h   / v a r / l i b / k u b e l e t   a n d   / v a r / l o g   a r e   o n   t h e   s y s t e m   r o o t   f i l e s y s t e m ,   a n d   t h e   k u b e l e t   i s   d e s i g n e d   w i t h   t h a t   l a y o u t   i n   m i n d . Y o u r   n o d e   c a n   h a v e   a s   m a n y   o t h e r   f i l e s y s t e m s ,   n o t   u s e d   f o r   K u b e r n e t e s ,   a s   y o u   l i k e . Y o u   h a v e   a   f i l e s y s t e m   o n   t h e   n o d e   t h a t   y o u ' r e   u s i n g   f o r   e p h e m e r a l   d a t a   t h a t   c o m e s   f r o m   r u n n i n g   P o d s :   l o g s ,   a n d   e m p t y D i r   v o l u m e s .   Y o u   c a n   u s e   t h i s   f i l e s y s t e m


Question: What is Setting requests and limits for local ephemeral storage?

Answer: Y o u   c a n   s p e c i f y   e p h e m e r a l - s t o r a g e   f o r   m a n a g i n g   l o c a l   e p h e m e r a l   s t o r a g e .   E a c h   c o n t a i n e r   o f   a   P o d   c a n   s p e c i f y   e i t h e r   o r   b o t h   o f   t h e   f o l l o w i n g :   s p e c . c o n t a i n e r s [ ] . r e s o u r c e s . l i m i t s . e p h e m e r a l - s t o r a g e s p e c . c o n t a i n e r s [ ] . r e s o u r c e s . r e q u e s t s . e p h e m e r a l - s t o r a g e   L i m i t s   a n d   r e q u e s t s   f o r   e p h e m e r a l - s t o r a g e   a r e   m e a s u r e d   i n   b y t e   q u a n t i t i e s .   Y o u   c a n   e x p r e s s   s t o r a g e   a s   a   p l a i n   i n t e g e r   o r   a s   a   f i x e d - p o i n t   n u m b e r   u s i n g   o n e   o f   t h e s e   s u f f i x e s :   E ,   P ,   T ,   G ,   M ,   k .   Y o u   c a n   a l s o   u s e   t h e   p o w e r - o f - t w o   e q u i v a l e n t s :   E i ,   P i ,   T i ,   G i ,   M i ,   K i .   F o r   e x a m p l e ,   t h e   f o l l o w i n g   q u a n t i t i e s   a l l   r e p r e s e n t   r o u g h l y   t h e   s a m e   v a l u e :   1 2 8 9 7 4 8 4 8 1 2 9 e 6 1 2 9 M 1 2 3 M i   P a y   a t t e n t i o n   t o   t h e   c a s e   o f   t h e   s u f f i x e s .   I f   y o u   r e q u e s t   4 0 0 m   o f   e p h e m e r a l - s t o r a g e ,   t h i s   i s   a   r e q u e s t   f o r   0 . 4   b y t e s .   S o m e o n e   w h o   t y p e s   t h a t   p r o b a b l y   m e a n t   t o   a s k   f o r   4 0 0   m e b i b y t e s   ( 4 0 0 M i )   o r   4 0 0   m e g a b y t e s   ( 4 0 0 M ) .   I n   t h e   f o l l o w i n g   e x a m p l e ,   t h e   P o d   h a s   t w o   c o n t a i n e r s .   E a c h   c o n t a i n e r   h a s   a   r e q u e s t   o f   2 G i B   o f   l o c a l   e p h e m e r a l   s t o r a g e .   E a c h   c o n t a i n e r   h a s   a   l i m i t   o f   4 G i B   o f   l o c a l   e p h e m e r a l   s t


Question: What is How Pods with ephemeral-storage requests are scheduled?

Answer: W h e n   y o u   c r e a t e   a   P o d ,   t h e   K u b e r n e t e s   s c h e d u l e r   s e l e c t s   a   n o d e   f o r   t h e   P o d   t o   r u n   o n .   E a c h   n o d e   h a s   a   m a x i m u m   a m o u n t   o f   l o c a l   e p h e m e r a l   s t o r a g e   i t   c a n   p r o v i d e   f o r   P o d s .   F o r   m o r e   i n f o r m a t i o n ,   s e e   N o d e   A l l o c a t a b l e .   T h e   s c h e d u l e r   e n s u r e s   t h a t   t h e   s u m   o f   t h e   r e s o u r c e   r e q u e s t s   o f   t h e   s c h e d u l e d   c o n t a i n e r s   i s   l e s s   t h a n   t h e   c a p a c i t y   o f   t h e   n o d e .


Question: What is Ephemeral storage consumption management?

Answer: I f   t h e   k u b e l e t   i s   m a n a g i n g   l o c a l   e p h e m e r a l   s t o r a g e   a s   a   r e s o u r c e ,   t h e n   t h e   k u b e l e t   m e a s u r e s   s t o r a g e   u s e   i n :   e m p t y D i r   v o l u m e s ,   e x c e p t   t m p f s   e m p t y D i r   v o l u m e s d i r e c t o r i e s   h o l d i n g   n o d e - l e v e l   l o g s w r i t e a b l e   c o n t a i n e r   l a y e r s   I f   a   P o d   i s   u s i n g   m o r e   e p h e m e r a l   s t o r a g e   t h a n   y o u   a l l o w   i t   t o ,   t h e   k u b e l e t   s e t s   a n   e v i c t i o n   s i g n a l   t h a t   t r i g g e r s   P o d   e v i c t i o n .   F o r   c o n t a i n e r - l e v e l   i s o l a t i o n ,   i f   a   c o n t a i n e r ' s   w r i t a b l e   l a y e r   a n d   l o g   u s a g e   e x c e e d s   i t s   s t o r a g e   l i m i t ,   t h e   k u b e l e t   m a r k s   t h e   P o d   f o r   e v i c t i o n .   F o r   p o d - l e v e l   i s o l a t i o n   t h e   k u b e l e t   w o r k s   o u t   a n   o v e r a l l   P o d   s t o r a g e   l i m i t   b y   s u m m i n g   t h e   l i m i t s   f o r   t h e   c o n t a i n e r s   i n   t h a t   P o d .   I n   t h i s   c a s e ,   i f   t h e   s u m   o f   t h e   l o c a l   e p h e m e r a l   s t o r a g e   u s a g e   f r o m   a l l   c o n t a i n e r s   a n d   a l s o   t h e   P o d ' s   e m p t y D i r   v o l u m e s   e x c e e d s   t h e   o v e r a l l   P o d   s t o r a g e   l i m i t ,   t h e n   t h e   k u b e l e t   a l s o   m a r k s   t h e   P o d   f o r   e v i c t i o n .


Question: What is Caution:?

Answer: I f   t h e   k u b e l e t   i s   n o t   m e a s u r i n g   l o c a l   e p h e m e r a l   s t o r a g e ,   t h e n   a   P o d   t h a t   e x c e e d s   i t s   l o c a l   s t o r a g e   l i m i t   w i l l   n o t   b e   e v i c t e d   f o r   b r e a c h i n g   l o c a l   s t o r a g e   r e s o u r c e   l i m i t s .   H o w e v e r ,   i f   t h e   f i l e s y s t e m   s p a c e   f o r   w r i t e a b l e   c o n t a i n e r   l a y e r s ,   n o d e - l e v e l   l o g s ,   o r   e m p t y D i r   v o l u m e s   f a l l s   l o w ,   t h e   n o d e   t a i n t s   i t s e l f   a s   s h o r t   o n   l o c a l   s t o r a g e   a n d   t h i s   t a i n t   t r i g g e r s   e v i c t i o n   f o r   a n y   P o d s   t h a t   d o n ' t   s p e c i f i c a l l y   t o l e r a t e   t h e   t a i n t .   S e e   t h e   s u p p o r t e d   c o n f i g u r a t i o n s   f o r   e p h e m e r a l   l o c a l   s t o r a g e .   T h e   k u b e l e t   s u p p o r t s   d i f f e r e n t   w a y s   t o   m e a s u r e   P o d   s t o r a g e   u s e :   T h e   k u b e l e t   p e r f o r m s   r e g u l a r ,   s c h e d u l e d   c h e c k s   t h a t   s c a n   e a c h   e m p t y D i r   v o l u m e ,   c o n t a i n e r   l o g   d i r e c t o r y ,   a n d   w r i t e a b l e   c o n t a i n e r   l a y e r . T h e   s c a n   m e a s u r e s   h o w   m u c h   s p a c e   i s   u s e d . N o t e : I n   t h i s   m o d e ,   t h e   k u b e l e t   d o e s   n o t   t r a c k   o p e n   f i l e   d e s c r i p t o r s   f o r   d e l e t e d   f i l e s . I f   y o u   ( o r   a   c o n t a i n e r )   c r e a t e   a   f i l e   i n s i d e   a n   e m p t y D i r   v o l u m e ,   s o m e t h i n g   t h e n   o p e n s   t h a t   f i l e ,   a n d   y o u   d e l e t e   t h e   f i l e   w h i l e   i t   i s   s t i l l   o p e n ,   t h e n   t h e   i n o d e   f o r   t h e   d e l e t e d   f i l e   s t a y s   u n t i


Question: What is Note:?

Answer: I n   t h i s   m o d e ,   t h e   k u b e l e t   d o e s   n o t   t r a c k   o p e n   f i l e   d e s c r i p t o r s   f o r   d e l e t e d   f i l e s .   I f   y o u   ( o r   a   c o n t a i n e r )   c r e a t e   a   f i l e   i n s i d e   a n   e m p t y D i r   v o l u m e ,   s o m e t h i n g   t h e n   o p e n s   t h a t   f i l e ,   a n d   y o u   d e l e t e   t h e   f i l e   w h i l e   i t   i s   s t i l l   o p e n ,   t h e n   t h e   i n o d e   f o r   t h e   d e l e t e d   f i l e   s t a y s   u n t i l   y o u   c l o s e   t h a t   f i l e   b u t   t h e   k u b e l e t   d o e s   n o t   c a t e g o r i z e   t h e   s p a c e   a s   i n   u s e .   F E A T U R E   S T A T E :   K u b e r n e t e s   v 1 . 3 1   [ b e t a ]   ( e n a b l e d   b y   d e f a u l t :   f a l s e ) P r o j e c t   q u o t a s   a r e   a n   o p e r a t i n g - s y s t e m   l e v e l   f e a t u r e   f o r   m a n a g i n g   s t o r a g e   u s e   o n   f i l e s y s t e m s .   W i t h   K u b e r n e t e s ,   y o u   c a n   e n a b l e   p r o j e c t   q u o t a s   f o r   m o n i t o r i n g   s t o r a g e   u s e .   M a k e   s u r e   t h a t   t h e   f i l e s y s t e m   b a c k i n g   t h e   e m p t y D i r   v o l u m e s ,   o n   t h e   n o d e ,   p r o v i d e s   p r o j e c t   q u o t a   s u p p o r t .   F o r   e x a m p l e ,   X F S   a n d   e x t 4 f s   o f f e r   p r o j e c t   q u o t a s . N o t e : P r o j e c t   q u o t a s   l e t   y o u   m o n i t o r   s t o r a g e   u s e ;   t h e y   d o   n o t   e n f o r c e   l i m i t s . K u b e r n e t e s   u s e s   p r o j e c t   I D s   s t a r t i n g   f r o m   1 0 4 8 5 7 6 .   T h e   I D s   i n   u s e   a r e   r e g i s t e r e d   i n   / e t c / p r o j e c t s   a n d   / e t c / p r o j i d .   I f   p r o j e c t   I D s   i n   t h i s   r a n g e   a r e   u s e d   f o r   o t h e r   p u r p o s e s   o n   t h e   s y s t


Question: What is Note:?

Answer: K u b e r n e t e s   u s e s   p r o j e c t   I D s   s t a r t i n g   f r o m   1 0 4 8 5 7 6 .   T h e   I D s   i n   u s e   a r e   r e g i s t e r e d   i n   / e t c / p r o j e c t s   a n d   / e t c / p r o j i d .   I f   p r o j e c t   I D s   i n   t h i s   r a n g e   a r e   u s e d   f o r   o t h e r   p u r p o s e s   o n   t h e   s y s t e m ,   t h o s e   p r o j e c t   I D s   m u s t   b e   r e g i s t e r e d   i n   / e t c / p r o j e c t s   a n d   / e t c / p r o j i d   s o   t h a t   K u b e r n e t e s   d o e s   n o t   u s e   t h e m .   Q u o t a s   a r e   f a s t e r   a n d   m o r e   a c c u r a t e   t h a n   d i r e c t o r y   s c a n n i n g .   W h e n   a   d i r e c t o r y   i s   a s s i g n e d   t o   a   p r o j e c t ,   a l l   f i l e s   c r e a t e d   u n d e r   a   d i r e c t o r y   a r e   c r e a t e d   i n   t h a t   p r o j e c t ,   a n d   t h e   k e r n e l   m e r e l y   h a s   t o   k e e p   t r a c k   o f   h o w   m a n y   b l o c k s   a r e   i n   u s e   b y   f i l e s   i n   t h a t   p r o j e c t .   I f   a   f i l e   i s   c r e a t e d   a n d   d e l e t e d ,   b u t   h a s   a n   o p e n   f i l e   d e s c r i p t o r ,   i t   c o n t i n u e s   t o   c o n s u m e   s p a c e .   Q u o t a   t r a c k i n g   r e c o r d s   t h a t   s p a c e   a c c u r a t e l y   w h e r e a s   d i r e c t o r y   s c a n s   o v e r l o o k   t h e   s t o r a g e   u s e d   b y   d e l e t e d   f i l e s .   T o   u s e   q u o t a s   t o   t r a c k   a   p o d ' s   r e s o u r c e   u s a g e ,   t h e   p o d   m u s t   b e   i n   a   u s e r   n a m e s p a c e .   W i t h i n   u s e r   n a m e s p a c e s ,   t h e   k e r n e l   r e s t r i c t s   c h a n g e s   t o   p r o j e c t I D s   o n   t h e   f i l e s y s t e m ,   e n s u r i n g   t h e   r e l i a b i l i t y   o f   s t o r a g e   m e t r i c s   c a l c u l a t e d   b y   q


Question: What is Extended resources?

Answer: E x t e n d e d   r e s o u r c e s   a r e   f u l l y - q u a l i f i e d   r e s o u r c e   n a m e s   o u t s i d e   t h e   k u b e r n e t e s . i o   d o m a i n .   T h e y   a l l o w   c l u s t e r   o p e r a t o r s   t o   a d v e r t i s e   a n d   u s e r s   t o   c o n s u m e   t h e   n o n - K u b e r n e t e s - b u i l t - i n   r e s o u r c e s .   T h e r e   a r e   t w o   s t e p s   r e q u i r e d   t o   u s e   E x t e n d e d   R e s o u r c e s .   F i r s t ,   t h e   c l u s t e r   o p e r a t o r   m u s t   a d v e r t i s e   a n   E x t e n d e d   R e s o u r c e .   S e c o n d ,   u s e r s   m u s t   r e q u e s t   t h e   E x t e n d e d   R e s o u r c e   i n   P o d s .


Question: What is Node-level extended resources?

Answer: N o d e - l e v e l   e x t e n d e d   r e s o u r c e s   a r e   t i e d   t o   n o d e s .


Question: What is Device plugin managed resources?

Answer: S e e   D e v i c e   P l u g i n   f o r   h o w   t o   a d v e r t i s e   d e v i c e   p l u g i n   m a n a g e d   r e s o u r c e s   o n   e a c h   n o d e .


Question: What is Other resources?

Answer: T o   a d v e r t i s e   a   n e w   n o d e - l e v e l   e x t e n d e d   r e s o u r c e ,   t h e   c l u s t e r   o p e r a t o r   c a n   s u b m i t   a   P A T C H   H T T P   r e q u e s t   t o   t h e   A P I   s e r v e r   t o   s p e c i f y   t h e   a v a i l a b l e   q u a n t i t y   i n   t h e   s t a t u s . c a p a c i t y   f o r   a   n o d e   i n   t h e   c l u s t e r .   A f t e r   t h i s   o p e r a t i o n ,   t h e   n o d e ' s   s t a t u s . c a p a c i t y   w i l l   i n c l u d e   a   n e w   r e s o u r c e .   T h e   s t a t u s . a l l o c a t a b l e   f i e l d   i s   u p d a t e d   a u t o m a t i c a l l y   w i t h   t h e   n e w   r e s o u r c e   a s y n c h r o n o u s l y   b y   t h e   k u b e l e t .   B e c a u s e   t h e   s c h e d u l e r   u s e s   t h e   n o d e ' s   s t a t u s . a l l o c a t a b l e   v a l u e   w h e n   e v a l u a t i n g   P o d   f i t n e s s ,   t h e   s c h e d u l e r   o n l y   t a k e s   a c c o u n t   o f   t h e   n e w   v a l u e   a f t e r   t h a t   a s y n c h r o n o u s   u p d a t e .   T h e r e   m a y   b e   a   s h o r t   d e l a y   b e t w e e n   p a t c h i n g   t h e   n o d e   c a p a c i t y   w i t h   a   n e w   r e s o u r c e   a n d   t h e   t i m e   w h e n   t h e   f i r s t   P o d   t h a t   r e q u e s t s   t h e   r e s o u r c e   c a n   b e   s c h e d u l e d   o n   t h a t   n o d e .   E x a m p l e :   H e r e   i s   a n   e x a m p l e   s h o w i n g   h o w   t o   u s e   c u r l   t o   f o r m   a n   H T T P   r e q u e s t   t h a t   a d v e r t i s e s   f i v e   " e x a m p l e . c o m / f o o "   r e s o u r c e s   o n   n o d e   k 8 s - n o d e - 1   w h o s e   m a s t e r   i s   k 8 s - m a s t e r .   c u r l   - - h e a d e r   " C o n t e n t - T y p e :   a p p l i c a t i o n / j s o n - p a t c h + j s o n "   \   - - r e q u e s t   P A T C H   \   - - d a t a   ' [ { " o p " :


Question: What is Cluster-level extended resources?

Answer: C l u s t e r - l e v e l   e x t e n d e d   r e s o u r c e s   a r e   n o t   t i e d   t o   n o d e s .   T h e y   a r e   u s u a l l y   m a n a g e d   b y   s c h e d u l e r   e x t e n d e r s ,   w h i c h   h a n d l e   t h e   r e s o u r c e   c o n s u m p t i o n   a n d   r e s o u r c e   q u o t a .   Y o u   c a n   s p e c i f y   t h e   e x t e n d e d   r e s o u r c e s   t h a t   a r e   h a n d l e d   b y   s c h e d u l e r   e x t e n d e r s   i n   s c h e d u l e r   c o n f i g u r a t i o n   E x a m p l e :   T h e   f o l l o w i n g   c o n f i g u r a t i o n   f o r   a   s c h e d u l e r   p o l i c y   i n d i c a t e s   t h a t   t h e   c l u s t e r - l e v e l   e x t e n d e d   r e s o u r c e   " e x a m p l e . c o m / f o o "   i s   h a n d l e d   b y   t h e   s c h e d u l e r   e x t e n d e r .   T h e   s c h e d u l e r   s e n d s   a   P o d   t o   t h e   s c h e d u l e r   e x t e n d e r   o n l y   i f   t h e   P o d   r e q u e s t s   " e x a m p l e . c o m / f o o " . T h e   i g n o r e d B y S c h e d u l e r   f i e l d   s p e c i f i e s   t h a t   t h e   s c h e d u l e r   d o e s   n o t   c h e c k   t h e   " e x a m p l e . c o m / f o o "   r e s o u r c e   i n   i t s   P o d F i t s R e s o u r c e s   p r e d i c a t e .   {   " k i n d " :   " P o l i c y " ,   " a p i V e r s i o n " :   " v 1 " ,   " e x t e n d e r s " :   [   {   " u r l P r e f i x " : " < e x t e n d e r - e n d p o i n t > " ,   " b i n d V e r b " :   " b i n d " ,   " m a n a g e d R e s o u r c e s " :   [   {   " n a m e " :   " e x a m p l e . c o m / f o o " ,   " i g n o r e d B y S c h e d u l e r " :   t r u e   }   ]   }   ]   }


Question: What is Extended resources allocation by DRA?

Answer: E x t e n d e d   r e s o u r c e s   a l l o c a t i o n   b y   D R A   a l l o w s   c l u s t e r   a d m i n i s t r a t o r s   t o   s p e c i f y   a n   e x t e n d e d R e s o u r c e N a m e   i n   D e v i c e C l a s s ,   t h e n   t h e   d e v i c e s   m a t c h i n g   t h e   D e v i c e C l a s s   c a n   b e   r e q u e s t e d   f r o m   a   p o d ' s   e x t e n d e d   r e s o u r c e   r e q u e s t s .   R e a d   m o r e   a b o u t   E x t e n d e d   R e s o u r c e   a l l o c a t i o n   b y   D R A .


Question: What is Consuming extended resources?

Answer: U s e r s   c a n   c o n s u m e   e x t e n d e d   r e s o u r c e s   i n   P o d   s p e c s   l i k e   C P U   a n d   m e m o r y .   T h e   s c h e d u l e r   t a k e s   c a r e   o f   t h e   r e s o u r c e   a c c o u n t i n g   s o   t h a t   n o   m o r e   t h a n   t h e   a v a i l a b l e   a m o u n t   i s   s i m u l t a n e o u s l y   a l l o c a t e d   t o   P o d s .   T h e   A P I   s e r v e r   r e s t r i c t s   q u a n t i t i e s   o f   e x t e n d e d   r e s o u r c e s   t o   w h o l e   n u m b e r s .   E x a m p l e s   o f   v a l i d   q u a n t i t i e s   a r e   3 ,   3 0 0 0 m   a n d   3 K i .   E x a m p l e s   o f   i n v a l i d   q u a n t i t i e s   a r e   0 . 5   a n d   1 5 0 0 m   ( b e c a u s e   1 5 0 0 m   w o u l d   r e s u l t   i n   1 . 5 ) .


Question: What is Note:?

Answer: T o   c o n s u m e   a n   e x t e n d e d   r e s o u r c e   i n   a   P o d ,   i n c l u d e   t h e   r e s o u r c e   n a m e   a s   a   k e y   i n   t h e   s p e c . c o n t a i n e r s [ ] . r e s o u r c e s . l i m i t s   m a p   i n   t h e   c o n t a i n e r   s p e c .


Question: What is Note:?

Answer: A   P o d   i s   s c h e d u l e d   o n l y   i f   a l l   o f   t h e   r e s o u r c e   r e q u e s t s   a r e   s a t i s f i e d ,   i n c l u d i n g   C P U ,   m e m o r y   a n d   a n y   e x t e n d e d   r e s o u r c e s .   T h e   P o d   r e m a i n s   i n   t h e   P E N D I N G   s t a t e   a s   l o n g   a s   t h e   r e s o u r c e   r e q u e s t   c a n n o t   b e   s a t i s f i e d .   E x a m p l e :   T h e   P o d   b e l o w   r e q u e s t s   2   C P U s   a n d   1   " e x a m p l e . c o m / f o o "   ( a n   e x t e n d e d   r e s o u r c e ) .   a p i V e r s i o n :   v 1   k i n d :   P o d   m e t a d a t a :   n a m e :   m y - p o d   s p e c :   c o n t a i n e r s :   -   n a m e :   m y - c o n t a i n e r   i m a g e :   m y i m a g e   r e s o u r c e s :   r e q u e s t s :   c p u :   2   e x a m p l e . c o m / f o o :   1   l i m i t s :   e x a m p l e . c o m / f o o :   1


Question: What is PID limiting?

Answer: P r o c e s s   I D   ( P I D )   l i m i t s   a l l o w   f o r   t h e   c o n f i g u r a t i o n   o f   a   k u b e l e t   t o   l i m i t   t h e   n u m b e r   o f   P I D s   t h a t   a   g i v e n   P o d   c a n   c o n s u m e .   S e e   P I D   L i m i t i n g   f o r   i n f o r m a t i o n .


Question: What is My Pods are pending with event message FailedScheduling?

Answer: I f   t h e   s c h e d u l e r   c a n n o t   f i n d   a n y   n o d e   w h e r e   a   P o d   c a n   f i t ,   t h e   P o d   r e m a i n s   u n s c h e d u l e d   u n t i l   a   p l a c e   c a n   b e   f o u n d .   A n   E v e n t   i s   p r o d u c e d   e a c h   t i m e   t h e   s c h e d u l e r   f a i l s   t o   f i n d   a   p l a c e   f o r   t h e   P o d .   Y o u   c a n   u s e   k u b e c t l   t o   v i e w   t h e   e v e n t s   f o r   a   P o d ;   f o r   e x a m p l e :   k u b e c t l   d e s c r i b e   p o d   f r o n t e n d   |   g r e p   - A   9 9 9 9 9 9 9 9 9 9   E v e n t s   E v e n t s :   T y p e   R e a s o n   A g e   F r o m   M e s s a g e   - - - -   - - - - - -   - - - -   - - - -   - - - - - - -   W a r n i n g   F a i l e d S c h e d u l i n g   2 3 s   d e f a u l t - s c h e d u l e r   0 / 4 2   n o d e s   a v a i l a b l e :   i n s u f f i c i e n t   c p u   I n   t h e   p r e c e d i n g   e x a m p l e ,   t h e   P o d   n a m e d   " f r o n t e n d "   f a i l s   t o   b e   s c h e d u l e d   d u e   t o   i n s u f f i c i e n t   C P U   r e s o u r c e   o n   a n y   n o d e .   S i m i l a r   e r r o r   m e s s a g e s   c a n   a l s o   s u g g e s t   f a i l u r e   d u e   t o   i n s u f f i c i e n t   m e m o r y   ( P o d E x c e e d s F r e e M e m o r y ) .   I n   g e n e r a l ,   i f   a   P o d   i s   p e n d i n g   w i t h   a   m e s s a g e   o f   t h i s   t y p e ,   t h e r e   a r e   s e v e r a l   t h i n g s   t o   t r y :   A d d   m o r e   n o d e s   t o   t h e   c l u s t e r . T e r m i n a t e   u n n e e d e d   P o d s   t o   m a k e   r o o m   f o r   p e n d i n g   P o d s . C h e c k   t h a t   t h e   P o d   i s   n o t   l a r g e r   t h a n   a l l   t h e   n o d e s .   F o r   e x a m p l e ,   i f   a l l   t h e   n o d e s   h a v e   a   c a p a c i t y   o f   c p u :   1 ,   t h e n   a   P o d   w i t h   a   r e q u e s t


Question: What is My container is terminated?

Answer: Y o u r   c o n t a i n e r   m i g h t   g e t   t e r m i n a t e d   b e c a u s e   i t   i s   r e s o u r c e - s t a r v e d .   T o   c h e c k   w h e t h e r   a   c o n t a i n e r   i s   b e i n g   k i l l e d   b e c a u s e   i t   i s   h i t t i n g   a   r e s o u r c e   l i m i t ,   c a l l   k u b e c t l   d e s c r i b e   p o d   o n   t h e   P o d   o f   i n t e r e s t :   k u b e c t l   d e s c r i b e   p o d   s i m m e m l e a k - h r a 9 9   T h e   o u t p u t   i s   s i m i l a r   t o :   N a m e :   s i m m e m l e a k - h r a 9 9   N a m e s p a c e :   d e f a u l t   I m a g e ( s ) :   s a a d a l i / s i m m e m l e a k   N o d e :   k u b e r n e t e s - n o d e - t f 0 f / 1 0 . 2 4 0 . 2 1 6 . 6 6   L a b e l s :   n a m e = s i m m e m l e a k   S t a t u s :   R u n n i n g   R e a s o n :   M e s s a g e :   I P :   1 0 . 2 4 4 . 2 . 7 5   C o n t a i n e r s :   s i m m e m l e a k :   I m a g e :   s a a d a l i / s i m m e m l e a k : l a t e s t   L i m i t s :   c p u :   1 0 0 m   m e m o r y :   5 0 M i   S t a t e :   R u n n i n g   S t a r t e d :   T u e ,   0 7   J u l   2 0 1 9   1 2 : 5 4 : 4 1   - 0 7 0 0   L a s t   S t a t e :   T e r m i n a t e d   R e a s o n :   O O M K i l l e d   E x i t   C o d e :   1 3 7   S t a r t e d :   F r i ,   0 7   J u l   2 0 1 9   1 2 : 5 4 : 3 0   - 0 7 0 0   F i n i s h e d :   F r i ,   0 7   J u l   2 0 1 9   1 2 : 5 4 : 3 3   - 0 7 0 0   R e a d y :   F a l s e   R e s t a r t   C o u n t :   5   C o n d i t i o n s :   T y p e   S t a t u s   R e a d y   F a l s e   E v e n t s :   T y p e   R e a s o n   A g e   F r o m   M e s s a g e   - - - -   - - - - - -   - - - -   - - - -   - - - - - - -   N o r m a l   S c h e d u l e d   4 2 s   d e f a u l t - s c h e d u l e r   S u c c e s s f u l l y   a s s i g n e d   s i m m e m l e a k - h r a 9 9   t o   k u b e r n e t e s - n o d e - t f 0 f   N o r m a l   P u l l e d   4 1 s   k u b e l e t   C o n t


Question: What is What's next?

Answer: G e t   h a n d s - o n   e x p e r i e n c e   a s s i g n i n g   M e m o r y   r e s o u r c e s   t o   c o n t a i n e r s   a n d   P o d s . G e t   h a n d s - o n   e x p e r i e n c e   a s s i g n i n g   C P U   r e s o u r c e s   t o   c o n t a i n e r s   a n d   P o d s . R e a d   h o w   t h e   A P I   r e f e r e n c e   d e f i n e s   a   c o n t a i n e r   a n d   i t s   r e s o u r c e   r e q u i r e m e n t s R e a d   a b o u t   p r o j e c t   q u o t a s   i n   X F S R e a d   m o r e   a b o u t   t h e   k u b e - s c h e d u l e r   c o n f i g u r a t i o n   r e f e r e n c e   ( v 1 ) R e a d   m o r e   a b o u t   Q u a l i t y   o f   S e r v i c e   c l a s s e s   f o r   P o d s R e a d   m o r e   a b o u t   E x t e n d e d   R e s o u r c e   a l l o c a t i o n   b y   D R A


Question: What is Use Kube-router for NetworkPolicy?

Answer: Use Kube-router for NetworkPolicyThis page shows how to use Kube-router for NetworkPolicy.Before you beginYou need to have a Kubernetes cluster running. If you do not already have a cluster, you can create one by using any of the cluster installers like Kops, Bootkube, Kubeadm etc.Installing Kube-router addonThe Kube-router Addon comes with a Network Policy Controller that watches Kubernetes API server for any NetworkPolicy and pods updated and configures iptables rules and ipsets to allow or block traffic as directed by the policies. Please follow the trying Kube-router with cluster installers guide to install Kube-router addon.What's nextOnce you have installed the Kube-router addon, you can follow the Declare Network Policy to try out Kubernetes NetworkPolicy.


Question: How does Use Kube-router for NetworkPolicy work?

Answer: Use Kube-router for NetworkPolicyThis page shows how to use Kube-router for NetworkPolicy.Before you beginYou need to have a Kubernetes cluster running. If you do not already have a cluster, you can create one by using any of the cluster installers like Kops, Bootkube, Kubeadm etc.Installing Kube-router addonThe Kube-router Addon comes with a Network Policy Controller that watches Kubernetes API server for any NetworkPolicy and pods updated and configures iptables rules and ipsets to allow or block traffic as directed by the policies. Please follow the trying Kube-router with cluster installers guide to install Kube-router addon.What's nextOnce you have installed the Kube-router addon, you can follow the Declare Network Policy to try out Kubernetes NetworkPolicy.


Question: When would you use Use Kube-router for NetworkPolicy?

Answer: Use Kube-router for NetworkPolicyThis page shows how to use Kube-router for NetworkPolicy.Before you beginYou need to have a Kubernetes cluster running. If you do not already have a cluster, you can create one by using any of the cluster installers like Kops, Bootkube, Kubeadm etc.Installing Kube-router addonThe Kube-router Addon comes with a Network Policy Controller that watches Kubernetes API server for any NetworkPolicy and pods updated and configures iptables rules and ipsets to allow or block traffic as directed by the policies. Please follow the trying Kube-router with cluster installers guide to install Kube-router addon.What's nextOnce you have installed the Kube-router addon, you can follow the Declare Network Policy to try out Kubernetes NetworkPolicy.


Question: What are the benefits of Use Kube-router for NetworkPolicy?

Answer: Use Kube-router for NetworkPolicyThis page shows how to use Kube-router for NetworkPolicy.Before you beginYou need to have a Kubernetes cluster running. If you do not already have a cluster, you can create one by using any of the cluster installers like Kops, Bootkube, Kubeadm etc.Installing Kube-router addonThe Kube-router Addon comes with a Network Policy Controller that watches Kubernetes API server for any NetworkPolicy and pods updated and configures iptables rules and ipsets to allow or block traffic as directed by the policies. Please follow the trying Kube-router with cluster installers guide to install Kube-router addon.What's nextOnce you have installed the Kube-router addon, you can follow the Declare Network Policy to try out Kubernetes NetworkPolicy.


Question: What is Use Kube-router for NetworkPolicy?

Answer: T h i s   p a g e   s h o w s   h o w   t o   u s e   K u b e - r o u t e r   f o r   N e t w o r k P o l i c y .


Question: What is Before you begin?

Answer: Y o u   n e e d   t o   h a v e   a   K u b e r n e t e s   c l u s t e r   r u n n i n g .   I f   y o u   d o   n o t   a l r e a d y   h a v e   a   c l u s t e r ,   y o u   c a n   c r e a t e   o n e   b y   u s i n g   a n y   o f   t h e   c l u s t e r   i n s t a l l e r s   l i k e   K o p s ,   B o o t k u b e ,   K u b e a d m   e t c .


Question: What is Installing Kube-router addon?

Answer: T h e   K u b e - r o u t e r   A d d o n   c o m e s   w i t h   a   N e t w o r k   P o l i c y   C o n t r o l l e r   t h a t   w a t c h e s   K u b e r n e t e s   A P I   s e r v e r   f o r   a n y   N e t w o r k P o l i c y   a n d   p o d s   u p d a t e d   a n d   c o n f i g u r e s   i p t a b l e s   r u l e s   a n d   i p s e t s   t o   a l l o w   o r   b l o c k   t r a f f i c   a s   d i r e c t e d   b y   t h e   p o l i c i e s .   P l e a s e   f o l l o w   t h e   t r y i n g   K u b e - r o u t e r   w i t h   c l u s t e r   i n s t a l l e r s   g u i d e   t o   i n s t a l l   K u b e - r o u t e r   a d d o n .


Question: What is What's next?

Answer: O n c e   y o u   h a v e   i n s t a l l e d   t h e   K u b e - r o u t e r   a d d o n ,   y o u   c a n   f o l l o w   t h e   D e c l a r e   N e t w o r k   P o l i c y   t o   t r y   o u t   K u b e r n e t e s   N e t w o r k P o l i c y .


Question: What is Configure Minimum and Maximum CPU Constraints for a Namespace?

Answer: Configure Minimum and Maximum CPU Constraints for a NamespaceDefine a range of valid CPU resource limits for a namespace, so that every new Pod in that namespace falls within the range you configure.This page shows how to set minimum and maximum values for the CPU resources used by containers and Pods in a namespace. You specify minimum and maximum CPU values in a LimitRange object. If a Pod does not meet the constraints imposed by the LimitRange, it cannot be created in the namespace.Before you beginYou need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster. It is recommended to run this tutorial on a cluster with at least two nodes that are not acting as control plane hosts. If you do not already have a cluster, you can create one by using minikube or you can use one of these Kubernetes playgrounds:iximiuz LabsKillercodaKodeKloudPlay with KubernetesYou must have access to create namespaces in your cluster.Each node in your cluster must have at least 1.0 CPU available for Pods. See meaning of CPU to learn what Kubernetes means by “1 CPU”.Create a namespaceCreate a namespace so that the resources you create in this exercise are isolated from the rest of your cluster.kubectl create namespace constraints-cpu-example Create a LimitRange and a PodHere's a manifest for an example LimitRange:admin/resource/cpu-constraints.yaml apiVersion: v1 kind: LimitRange metadata: name: cpu-min-max-demo-lr spec: limits: - max: cpu: "800m" min: cpu: "200m" type: Container Create the LimitRange:kubectl apply -f https://k8s.io/examples/admin/resource/cpu-constraints.yaml --namespace=constraints-cpu-example View detailed information about the LimitRange:kubectl get limitrange cpu-min-max-demo-lr --output=yaml --namespace=constraints-cpu-example The output shows the minimum and maximum CPU constraints as expected. But notice that even though you didn't specify default values in the configuration file for the LimitRange, they were created automatically.limits: - default: cpu: 800m defaultRequest: cpu: 800m max: cpu: 800m min: cpu: 200m type: Container Now whenever you create a Pod in the constraints-cpu-example namespace (or some other client of the Kubernetes API creates an equivalent Pod), Kubernetes performs these steps:If any container in that Pod does not specify its own CPU request and limit, the control plane assigns the default CPU request and limit to that container.Verify that every container in that Pod specifies a CPU request that is greater than or equal to 200 millicpu.Verify that every container in that Pod specifies a CPU limit that is less than or equal to 800 millicpu.Note:When creating a LimitRange object, you can specify limits on huge-pages or GPUs as well. However, when both default and defaultRequest are specified on these resources, the two values must be the same.Here's a manifest for a Pod that has one container. The container manifest specifies a CPU request of 500 millicpu and a


Question: How does Configure Minimum and Maximum CPU Constraints for a Namespace work?

Answer: Configure Minimum and Maximum CPU Constraints for a NamespaceDefine a range of valid CPU resource limits for a namespace, so that every new Pod in that namespace falls within the range you configure.This page shows how to set minimum and maximum values for the CPU resources used by containers and Pods in a namespace. You specify minimum and maximum CPU values in a LimitRange object. If a Pod does not meet the constraints imposed by the LimitRange, it cannot be created in the namespace.Before you beginYou need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster. It is recommended to run this tutorial on a cluster with at least two nodes that are not acting as control plane hosts. If you do not already have a cluster, you can create one by using minikube or you can use one of these Kubernetes playgrounds:iximiuz LabsKillercodaKodeKloudPlay with KubernetesYou must have access to create namespaces in your cluster.Each node in your cluster must have at least 1.0 CPU available for Pods. See meaning of CPU to learn what Kubernetes means by “1 CPU”.Create a namespaceCreate a namespace so that the resources you create in this exercise are isolated from the rest of your cluster.kubectl create namespace constraints-cpu-example Create a LimitRange and a PodHere's a manifest for an example LimitRange:admin/resource/cpu-constraints.yaml apiVersion: v1 kind: LimitRange metadata: name: cpu-min-max-demo-lr spec: limits: - max: cpu: "800m" min: cpu: "200m" type: Container Create the LimitRange:kubectl apply -f https://k8s.io/examples/admin/resource/cpu-constraints.yaml --namespace=constraints-cpu-example View detailed information about the LimitRange:kubectl get limitrange cpu-min-max-demo-lr --output=yaml --namespace=constraints-cpu-example The output shows the minimum and maximum CPU constraints as expected. But notice that even though you didn't specify default values in the configuration file for the LimitRange, they were created automatically.limits: - default: cpu: 800m defaultRequest: cpu: 800m max: cpu: 800m min: cpu: 200m type: Container Now whenever you create a Pod in the constraints-cpu-example namespace (or some other client of the Kubernetes API creates an equivalent Pod), Kubernetes performs these steps:If any container in that Pod does not specify its own CPU request and limit, the control plane assigns the default CPU request and limit to that container.Verify that every container in that Pod specifies a CPU request that is greater than or equal to 200 millicpu.Verify that every container in that Pod specifies a CPU limit that is less than or equal to 800 millicpu.Note:When creating a LimitRange object, you can specify limits on huge-pages or GPUs as well. However, when both default and defaultRequest are specified on these resources, the two values must be the same.Here's a manifest for a Pod that has one container. The container manifest specifies a CPU request of 500 millicpu and a


Question: When would you use Configure Minimum and Maximum CPU Constraints for a Namespace?

Answer: Configure Minimum and Maximum CPU Constraints for a NamespaceDefine a range of valid CPU resource limits for a namespace, so that every new Pod in that namespace falls within the range you configure.This page shows how to set minimum and maximum values for the CPU resources used by containers and Pods in a namespace. You specify minimum and maximum CPU values in a LimitRange object. If a Pod does not meet the constraints imposed by the LimitRange, it cannot be created in the namespace.Before you beginYou need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster. It is recommended to run this tutorial on a cluster with at least two nodes that are not acting as control plane hosts. If you do not already have a cluster, you can create one by using minikube or you can use one of these Kubernetes playgrounds:iximiuz LabsKillercodaKodeKloudPlay with KubernetesYou must have access to create namespaces in your cluster.Each node in your cluster must have at least 1.0 CPU available for Pods. See meaning of CPU to learn what Kubernetes means by “1 CPU”.Create a namespaceCreate a namespace so that the resources you create in this exercise are isolated from the rest of your cluster.kubectl create namespace constraints-cpu-example Create a LimitRange and a PodHere's a manifest for an example LimitRange:admin/resource/cpu-constraints.yaml apiVersion: v1 kind: LimitRange metadata: name: cpu-min-max-demo-lr spec: limits: - max: cpu: "800m" min: cpu: "200m" type: Container Create the LimitRange:kubectl apply -f https://k8s.io/examples/admin/resource/cpu-constraints.yaml --namespace=constraints-cpu-example View detailed information about the LimitRange:kubectl get limitrange cpu-min-max-demo-lr --output=yaml --namespace=constraints-cpu-example The output shows the minimum and maximum CPU constraints as expected. But notice that even though you didn't specify default values in the configuration file for the LimitRange, they were created automatically.limits: - default: cpu: 800m defaultRequest: cpu: 800m max: cpu: 800m min: cpu: 200m type: Container Now whenever you create a Pod in the constraints-cpu-example namespace (or some other client of the Kubernetes API creates an equivalent Pod), Kubernetes performs these steps:If any container in that Pod does not specify its own CPU request and limit, the control plane assigns the default CPU request and limit to that container.Verify that every container in that Pod specifies a CPU request that is greater than or equal to 200 millicpu.Verify that every container in that Pod specifies a CPU limit that is less than or equal to 800 millicpu.Note:When creating a LimitRange object, you can specify limits on huge-pages or GPUs as well. However, when both default and defaultRequest are specified on these resources, the two values must be the same.Here's a manifest for a Pod that has one container. The container manifest specifies a CPU request of 500 millicpu and a


Question: What are the benefits of Configure Minimum and Maximum CPU Constraints for a Namespace?

Answer: Configure Minimum and Maximum CPU Constraints for a NamespaceDefine a range of valid CPU resource limits for a namespace, so that every new Pod in that namespace falls within the range you configure.This page shows how to set minimum and maximum values for the CPU resources used by containers and Pods in a namespace. You specify minimum and maximum CPU values in a LimitRange object. If a Pod does not meet the constraints imposed by the LimitRange, it cannot be created in the namespace.Before you beginYou need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster. It is recommended to run this tutorial on a cluster with at least two nodes that are not acting as control plane hosts. If you do not already have a cluster, you can create one by using minikube or you can use one of these Kubernetes playgrounds:iximiuz LabsKillercodaKodeKloudPlay with KubernetesYou must have access to create namespaces in your cluster.Each node in your cluster must have at least 1.0 CPU available for Pods. See meaning of CPU to learn what Kubernetes means by “1 CPU”.Create a namespaceCreate a namespace so that the resources you create in this exercise are isolated from the rest of your cluster.kubectl create namespace constraints-cpu-example Create a LimitRange and a PodHere's a manifest for an example LimitRange:admin/resource/cpu-constraints.yaml apiVersion: v1 kind: LimitRange metadata: name: cpu-min-max-demo-lr spec: limits: - max: cpu: "800m" min: cpu: "200m" type: Container Create the LimitRange:kubectl apply -f https://k8s.io/examples/admin/resource/cpu-constraints.yaml --namespace=constraints-cpu-example View detailed information about the LimitRange:kubectl get limitrange cpu-min-max-demo-lr --output=yaml --namespace=constraints-cpu-example The output shows the minimum and maximum CPU constraints as expected. But notice that even though you didn't specify default values in the configuration file for the LimitRange, they were created automatically.limits: - default: cpu: 800m defaultRequest: cpu: 800m max: cpu: 800m min: cpu: 200m type: Container Now whenever you create a Pod in the constraints-cpu-example namespace (or some other client of the Kubernetes API creates an equivalent Pod), Kubernetes performs these steps:If any container in that Pod does not specify its own CPU request and limit, the control plane assigns the default CPU request and limit to that container.Verify that every container in that Pod specifies a CPU request that is greater than or equal to 200 millicpu.Verify that every container in that Pod specifies a CPU limit that is less than or equal to 800 millicpu.Note:When creating a LimitRange object, you can specify limits on huge-pages or GPUs as well. However, when both default and defaultRequest are specified on these resources, the two values must be the same.Here's a manifest for a Pod that has one container. The container manifest specifies a CPU request of 500 millicpu and a


Question: What is Configure Minimum and Maximum CPU Constraints for a Namespace?

Answer: T h i s   p a g e   s h o w s   h o w   t o   s e t   m i n i m u m   a n d   m a x i m u m   v a l u e s   f o r   t h e   C P U   r e s o u r c e s   u s e d   b y   c o n t a i n e r s   a n d   P o d s   i n   a   n a m e s p a c e .   Y o u   s p e c i f y   m i n i m u m   a n d   m a x i m u m   C P U   v a l u e s   i n   a   L i m i t R a n g e   o b j e c t .   I f   a   P o d   d o e s   n o t   m e e t   t h e   c o n s t r a i n t s   i m p o s e d   b y   t h e   L i m i t R a n g e ,   i t   c a n n o t   b e   c r e a t e d   i n   t h e   n a m e s p a c e .


Question: What is Before you begin?

Answer: Y o u   n e e d   t o   h a v e   a   K u b e r n e t e s   c l u s t e r ,   a n d   t h e   k u b e c t l   c o m m a n d - l i n e   t o o l   m u s t   b e   c o n f i g u r e d   t o   c o m m u n i c a t e   w i t h   y o u r   c l u s t e r .   I t   i s   r e c o m m e n d e d   t o   r u n   t h i s   t u t o r i a l   o n   a   c l u s t e r   w i t h   a t   l e a s t   t w o   n o d e s   t h a t   a r e   n o t   a c t i n g   a s   c o n t r o l   p l a n e   h o s t s .   I f   y o u   d o   n o t   a l r e a d y   h a v e   a   c l u s t e r ,   y o u   c a n   c r e a t e   o n e   b y   u s i n g   m i n i k u b e   o r   y o u   c a n   u s e   o n e   o f   t h e s e   K u b e r n e t e s   p l a y g r o u n d s :   i x i m i u z   L a b s K i l l e r c o d a K o d e K l o u d P l a y   w i t h   K u b e r n e t e s   Y o u   m u s t   h a v e   a c c e s s   t o   c r e a t e   n a m e s p a c e s   i n   y o u r   c l u s t e r .   E a c h   n o d e   i n   y o u r   c l u s t e r   m u s t   h a v e   a t   l e a s t   1 . 0   C P U   a v a i l a b l e   f o r   P o d s .   S e e   m e a n i n g   o f   C P U   t o   l e a r n   w h a t   K u b e r n e t e s   m e a n s   b y   “ 1   C P U ” .


Question: What is Create a namespace?

Answer: C r e a t e   a   n a m e s p a c e   s o   t h a t   t h e   r e s o u r c e s   y o u   c r e a t e   i n   t h i s   e x e r c i s e   a r e   i s o l a t e d   f r o m   t h e   r e s t   o f   y o u r   c l u s t e r .   k u b e c t l   c r e a t e   n a m e s p a c e   c o n s t r a i n t s - c p u - e x a m p l e


Question: What is Create a LimitRange and a Pod?

Answer: H e r e ' s   a   m a n i f e s t   f o r   a n   e x a m p l e   L i m i t R a n g e :   a p i V e r s i o n :   v 1   k i n d :   L i m i t R a n g e   m e t a d a t a :   n a m e :   c p u - m i n - m a x - d e m o - l r   s p e c :   l i m i t s :   -   m a x :   c p u :   " 8 0 0 m "   m i n :   c p u :   " 2 0 0 m "   t y p e :   C o n t a i n e r   C r e a t e   t h e   L i m i t R a n g e :   k u b e c t l   a p p l y   - f   h t t p s : / / k 8 s . i o / e x a m p l e s / a d m i n / r e s o u r c e / c p u - c o n s t r a i n t s . y a m l   - - n a m e s p a c e = c o n s t r a i n t s - c p u - e x a m p l e   V i e w   d e t a i l e d   i n f o r m a t i o n   a b o u t   t h e   L i m i t R a n g e :   k u b e c t l   g e t   l i m i t r a n g e   c p u - m i n - m a x - d e m o - l r   - - o u t p u t = y a m l   - - n a m e s p a c e = c o n s t r a i n t s - c p u - e x a m p l e   T h e   o u t p u t   s h o w s   t h e   m i n i m u m   a n d   m a x i m u m   C P U   c o n s t r a i n t s   a s   e x p e c t e d .   B u t   n o t i c e   t h a t   e v e n   t h o u g h   y o u   d i d n ' t   s p e c i f y   d e f a u l t   v a l u e s   i n   t h e   c o n f i g u r a t i o n   f i l e   f o r   t h e   L i m i t R a n g e ,   t h e y   w e r e   c r e a t e d   a u t o m a t i c a l l y .   l i m i t s :   -   d e f a u l t :   c p u :   8 0 0 m   d e f a u l t R e q u e s t :   c p u :   8 0 0 m   m a x :   c p u :   8 0 0 m   m i n :   c p u :   2 0 0 m   t y p e :   C o n t a i n e r   N o w   w h e n e v e r   y o u   c r e a t e   a   P o d   i n   t h e   c o n s t r a i n t s - c p u - e x a m p l e   n a m e s p a c e   ( o r   s o m e   o t h e r   c l i e n t   o f   t h e   K u b e r n e t e s   A P I   c r e a t e s   a n   e q u i v a l e n t   P o d ) ,   K u b e r n e t e s   p e r f o r m s   t h e s e   s t e p s :   I f   a n y   c o n t a i n e r   i n   t h a t   P o d   d o e s   n o t   s p e c i f y   i t s   o w n   C P


Question: What is Note:?

Answer: H e r e ' s   a   m a n i f e s t   f o r   a   P o d   t h a t   h a s   o n e   c o n t a i n e r .   T h e   c o n t a i n e r   m a n i f e s t   s p e c i f i e s   a   C P U   r e q u e s t   o f   5 0 0   m i l l i c p u   a n d   a   C P U   l i m i t   o f   8 0 0   m i l l i c p u .   T h e s e   s a t i s f y   t h e   m i n i m u m   a n d   m a x i m u m   C P U   c o n s t r a i n t s   i m p o s e d   b y   t h e   L i m i t R a n g e   f o r   t h i s   n a m e s p a c e .   a p i V e r s i o n :   v 1   k i n d :   P o d   m e t a d a t a :   n a m e :   c o n s t r a i n t s - c p u - d e m o   s p e c :   c o n t a i n e r s :   -   n a m e :   c o n s t r a i n t s - c p u - d e m o - c t r   i m a g e :   n g i n x   r e s o u r c e s :   l i m i t s :   c p u :   " 8 0 0 m "   r e q u e s t s :   c p u :   " 5 0 0 m "   C r e a t e   t h e   P o d :   k u b e c t l   a p p l y   - f   h t t p s : / / k 8 s . i o / e x a m p l e s / a d m i n / r e s o u r c e / c p u - c o n s t r a i n t s - p o d . y a m l   - - n a m e s p a c e = c o n s t r a i n t s - c p u - e x a m p l e   V e r i f y   t h a t   t h e   P o d   i s   r u n n i n g   a n d   t h a t   i t s   c o n t a i n e r   i s   h e a l t h y :   k u b e c t l   g e t   p o d   c o n s t r a i n t s - c p u - d e m o   - - n a m e s p a c e = c o n s t r a i n t s - c p u - e x a m p l e   V i e w   d e t a i l e d   i n f o r m a t i o n   a b o u t   t h e   P o d :   k u b e c t l   g e t   p o d   c o n s t r a i n t s - c p u - d e m o   - - o u t p u t = y a m l   - - n a m e s p a c e = c o n s t r a i n t s - c p u - e x a m p l e   T h e   o u t p u t   s h o w s   t h a t   t h e   P o d ' s   o n l y   c o n t a i n e r   h a s   a   C P U   r e q u e s t   o f   5 0 0   m i l l i c p u   a n d   C P U   l i m i t   o f   8 0 0   m i l l i c p u .   T h e s e   s a t i s f y   t h e   c o n s t r a i n t s   i m p o s e d   b y   t h e   L i m i t R a n g e .   r e s o


Question: What is Delete the Pod?

Answer: k u b e c t l   d e l e t e   p o d   c o n s t r a i n t s - c p u - d e m o   - - n a m e s p a c e = c o n s t r a i n t s - c p u - e x a m p l e


Question: What is Attempt to create a Pod that exceeds the maximum CPU constraint?

Answer: H e r e ' s   a   m a n i f e s t   f o r   a   P o d   t h a t   h a s   o n e   c o n t a i n e r .   T h e   c o n t a i n e r   s p e c i f i e s   a   C P U   r e q u e s t   o f   5 0 0   m i l l i c p u   a n d   a   c p u   l i m i t   o f   1 . 5   c p u .   a p i V e r s i o n :   v 1   k i n d :   P o d   m e t a d a t a :   n a m e :   c o n s t r a i n t s - c p u - d e m o - 2   s p e c :   c o n t a i n e r s :   -   n a m e :   c o n s t r a i n t s - c p u - d e m o - 2 - c t r   i m a g e :   n g i n x   r e s o u r c e s :   l i m i t s :   c p u :   " 1 . 5 "   r e q u e s t s :   c p u :   " 5 0 0 m "   A t t e m p t   t o   c r e a t e   t h e   P o d :   k u b e c t l   a p p l y   - f   h t t p s : / / k 8 s . i o / e x a m p l e s / a d m i n / r e s o u r c e / c p u - c o n s t r a i n t s - p o d - 2 . y a m l   - - n a m e s p a c e = c o n s t r a i n t s - c p u - e x a m p l e   T h e   o u t p u t   s h o w s   t h a t   t h e   P o d   d o e s   n o t   g e t   c r e a t e d ,   b e c a u s e   i t   d e f i n e s   a n   u n a c c e p t a b l e   c o n t a i n e r .   T h a t   c o n t a i n e r   i s   n o t   a c c e p t a b l e   b e c a u s e   i t   s p e c i f i e s   a   C P U   l i m i t   t h a t   i s   t o o   l a r g e :   E r r o r   f r o m   s e r v e r   ( F o r b i d d e n ) :   e r r o r   w h e n   c r e a t i n g   " e x a m p l e s / a d m i n / r e s o u r c e / c p u - c o n s t r a i n t s - p o d - 2 . y a m l " :   p o d s   " c o n s t r a i n t s - c p u - d e m o - 2 "   i s   f o r b i d d e n :   m a x i m u m   c p u   u s a g e   p e r   C o n t a i n e r   i s   8 0 0 m ,   b u t   l i m i t   i s   1 5 0 0 m .


Question: What is Attempt to create a Pod that does not meet the minimum CPU request?

Answer: H e r e ' s   a   m a n i f e s t   f o r   a   P o d   t h a t   h a s   o n e   c o n t a i n e r .   T h e   c o n t a i n e r   s p e c i f i e s   a   C P U   r e q u e s t   o f   1 0 0   m i l l i c p u   a n d   a   C P U   l i m i t   o f   8 0 0   m i l l i c p u .   a p i V e r s i o n :   v 1   k i n d :   P o d   m e t a d a t a :   n a m e :   c o n s t r a i n t s - c p u - d e m o - 3   s p e c :   c o n t a i n e r s :   -   n a m e :   c o n s t r a i n t s - c p u - d e m o - 3 - c t r   i m a g e :   n g i n x   r e s o u r c e s :   l i m i t s :   c p u :   " 8 0 0 m "   r e q u e s t s :   c p u :   " 1 0 0 m "   A t t e m p t   t o   c r e a t e   t h e   P o d :   k u b e c t l   a p p l y   - f   h t t p s : / / k 8 s . i o / e x a m p l e s / a d m i n / r e s o u r c e / c p u - c o n s t r a i n t s - p o d - 3 . y a m l   - - n a m e s p a c e = c o n s t r a i n t s - c p u - e x a m p l e   T h e   o u t p u t   s h o w s   t h a t   t h e   P o d   d o e s   n o t   g e t   c r e a t e d ,   b e c a u s e   i t   d e f i n e s   a n   u n a c c e p t a b l e   c o n t a i n e r .   T h a t   c o n t a i n e r   i s   n o t   a c c e p t a b l e   b e c a u s e   i t   s p e c i f i e s   a   C P U   r e q u e s t   t h a t   i s   l o w e r   t h a n   t h e   e n f o r c e d   m i n i m u m :   E r r o r   f r o m   s e r v e r   ( F o r b i d d e n ) :   e r r o r   w h e n   c r e a t i n g   " e x a m p l e s / a d m i n / r e s o u r c e / c p u - c o n s t r a i n t s - p o d - 3 . y a m l " :   p o d s   " c o n s t r a i n t s - c p u - d e m o - 3 "   i s   f o r b i d d e n :   m i n i m u m   c p u   u s a g e   p e r   C o n t a i n e r   i s   2 0 0 m ,   b u t   r e q u e s t   i s   1 0 0 m .


Question: What is Create a Pod that does not specify any CPU request or limit?

Answer: H e r e ' s   a   m a n i f e s t   f o r   a   P o d   t h a t   h a s   o n e   c o n t a i n e r .   T h e   c o n t a i n e r   d o e s   n o t   s p e c i f y   a   C P U   r e q u e s t ,   n o r   d o e s   i t   s p e c i f y   a   C P U   l i m i t .   a p i V e r s i o n :   v 1   k i n d :   P o d   m e t a d a t a :   n a m e :   c o n s t r a i n t s - c p u - d e m o - 4   s p e c :   c o n t a i n e r s :   -   n a m e :   c o n s t r a i n t s - c p u - d e m o - 4 - c t r   i m a g e :   v i s h / s t r e s s   C r e a t e   t h e   P o d :   k u b e c t l   a p p l y   - f   h t t p s : / / k 8 s . i o / e x a m p l e s / a d m i n / r e s o u r c e / c p u - c o n s t r a i n t s - p o d - 4 . y a m l   - - n a m e s p a c e = c o n s t r a i n t s - c p u - e x a m p l e   V i e w   d e t a i l e d   i n f o r m a t i o n   a b o u t   t h e   P o d :   k u b e c t l   g e t   p o d   c o n s t r a i n t s - c p u - d e m o - 4   - - n a m e s p a c e = c o n s t r a i n t s - c p u - e x a m p l e   - - o u t p u t = y a m l   T h e   o u t p u t   s h o w s   t h a t   t h e   P o d ' s   s i n g l e   c o n t a i n e r   h a s   a   C P U   r e q u e s t   o f   8 0 0   m i l l i c p u   a n d   a   C P U   l i m i t   o f   8 0 0   m i l l i c p u .   H o w   d i d   t h a t   c o n t a i n e r   g e t   t h o s e   v a l u e s ?   r e s o u r c e s :   l i m i t s :   c p u :   8 0 0 m   r e q u e s t s :   c p u :   8 0 0 m   B e c a u s e   t h a t   c o n t a i n e r   d i d   n o t   s p e c i f y   i t s   o w n   C P U   r e q u e s t   a n d   l i m i t ,   t h e   c o n t r o l   p l a n e   a p p l i e d   t h e   d e f a u l t   C P U   r e q u e s t   a n d   l i m i t   f r o m   t h e   L i m i t R a n g e   f o r   t h i s   n a m e s p a c e .   A t   t h i s   p o i n t ,   y o u r   P o d   m a y   o r   m a y   n o t   b e   r u n n i n g .   R e c a l l   t h a t   a   p r e r e q u i s i t e   f o r   t h i s   t a s k


Question: What is Enforcement of minimum and maximum CPU constraints?

Answer: T h e   m a x i m u m   a n d   m i n i m u m   C P U   c o n s t r a i n t s   i m p o s e d   o n   a   n a m e s p a c e   b y   a   L i m i t R a n g e   a r e   e n f o r c e d   o n l y   w h e n   a   P o d   i s   c r e a t e d   o r   u p d a t e d .   I f   y o u   c h a n g e   t h e   L i m i t R a n g e ,   i t   d o e s   n o t   a f f e c t   P o d s   t h a t   w e r e   c r e a t e d   p r e v i o u s l y .


Question: What is Motivation for minimum and maximum CPU constraints?

Answer: A s   a   c l u s t e r   a d m i n i s t r a t o r ,   y o u   m i g h t   w a n t   t o   i m p o s e   r e s t r i c t i o n s   o n   t h e   C P U   r e s o u r c e s   t h a t   P o d s   c a n   u s e .   F o r   e x a m p l e :   E a c h   N o d e   i n   a   c l u s t e r   h a s   2   C P U .   Y o u   d o   n o t   w a n t   t o   a c c e p t   a n y   P o d   t h a t   r e q u e s t s   m o r e   t h a n   2   C P U ,   b e c a u s e   n o   N o d e   i n   t h e   c l u s t e r   c a n   s u p p o r t   t h e   r e q u e s t . A   c l u s t e r   i s   s h a r e d   b y   y o u r   p r o d u c t i o n   a n d   d e v e l o p m e n t   d e p a r t m e n t s .   Y o u   w a n t   t o   a l l o w   p r o d u c t i o n   w o r k l o a d s   t o   c o n s u m e   u p   t o   3   C P U ,   b u t   y o u   w a n t   d e v e l o p m e n t   w o r k l o a d s   t o   b e   l i m i t e d   t o   1   C P U .   Y o u   c r e a t e   s e p a r a t e   n a m e s p a c e s   f o r   p r o d u c t i o n   a n d   d e v e l o p m e n t ,   a n d   y o u   a p p l y   C P U   c o n s t r a i n t s   t o   e a c h   n a m e s p a c e .   E a c h   N o d e   i n   a   c l u s t e r   h a s   2   C P U .   Y o u   d o   n o t   w a n t   t o   a c c e p t   a n y   P o d   t h a t   r e q u e s t s   m o r e   t h a n   2   C P U ,   b e c a u s e   n o   N o d e   i n   t h e   c l u s t e r   c a n   s u p p o r t   t h e   r e q u e s t .   A   c l u s t e r   i s   s h a r e d   b y   y o u r   p r o d u c t i o n   a n d   d e v e l o p m e n t   d e p a r t m e n t s .   Y o u   w a n t   t o   a l l o w   p r o d u c t i o n   w o r k l o a d s   t o   c o n s u m e   u p   t o   3   C P U ,   b u t   y o u   w a n t   d e v e l o p m e n t   w o r k l o a d s   t o   b e   l i m i t e d   t o   1   C P U .   Y o u   c r e a t e   s e p a r a t e   n a m e s p a c e s   f o r   p r o d u c t i o n   a n d   d e v e l o p m e n t ,   a n d   y o u   a p p l y   C P U


Question: What is Clean up?

Answer: D e l e t e   y o u r   n a m e s p a c e :   k u b e c t l   d e l e t e   n a m e s p a c e   c o n s t r a i n t s - c p u - e x a m p l e


Question: What is For cluster administrators?

Answer: C o n f i g u r e   D e f a u l t   M e m o r y   R e q u e s t s   a n d   L i m i t s   f o r   a   N a m e s p a c e C o n f i g u r e   D e f a u l t   C P U   R e q u e s t s   a n d   L i m i t s   f o r   a   N a m e s p a c e C o n f i g u r e   M i n i m u m   a n d   M a x i m u m   M e m o r y   C o n s t r a i n t s   f o r   a   N a m e s p a c e C o n f i g u r e   M e m o r y   a n d   C P U   Q u o t a s   f o r   a   N a m e s p a c e C o n f i g u r e   a   P o d   Q u o t a   f o r   a   N a m e s p a c e C o n f i g u r e   Q u o t a s   f o r   A P I   O b j e c t s   C o n f i g u r e   D e f a u l t   M e m o r y   R e q u e s t s   a n d   L i m i t s   f o r   a   N a m e s p a c e   C o n f i g u r e   D e f a u l t   C P U   R e q u e s t s   a n d   L i m i t s   f o r   a   N a m e s p a c e   C o n f i g u r e   M i n i m u m   a n d   M a x i m u m   M e m o r y   C o n s t r a i n t s   f o r   a   N a m e s p a c e   C o n f i g u r e   M e m o r y   a n d   C P U   Q u o t a s   f o r   a   N a m e s p a c e   C o n f i g u r e   a   P o d   Q u o t a   f o r   a   N a m e s p a c e   C o n f i g u r e   Q u o t a s   f o r   A P I   O b j e c t s


Question: What is For app developers?

Answer: A s s i g n   M e m o r y   R e s o u r c e s   t o   C o n t a i n e r s   a n d   P o d s A s s i g n   C P U   R e s o u r c e s   t o   C o n t a i n e r s   a n d   P o d s A s s i g n   P o d - l e v e l   C P U   a n d   m e m o r y   r e s o u r c e s C o n f i g u r e   Q u a l i t y   o f   S e r v i c e   f o r   P o d s   A s s i g n   M e m o r y   R e s o u r c e s   t o   C o n t a i n e r s   a n d   P o d s   A s s i g n   C P U   R e s o u r c e s   t o   C o n t a i n e r s   a n d   P o d s   A s s i g n   P o d - l e v e l   C P U   a n d   m e m o r y   r e s o u r c e s   C o n f i g u r e   Q u a l i t y   o f   S e r v i c e   f o r   P o d s