Question: What are the benefits of Configure Memory and CPU Quotas for a Namespace?

Answer: Configure Memory and CPU Quotas for a NamespaceDefine overall memory and CPU resource limits for a namespace.This page shows how to set quotas for the total amount memory and CPU that can be used by all Pods running in a namespace. You specify quotas in a ResourceQuota object.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 GiB of memory.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 quota-mem-cpu-example Create a ResourceQuotaHere is a manifest for an example ResourceQuota:admin/resource/quota-mem-cpu.yaml apiVersion: v1 kind: ResourceQuota metadata: name: mem-cpu-demo spec: hard: requests.cpu: "1" requests.memory: 1Gi limits.cpu: "2" limits.memory: 2Gi Create the ResourceQuota:kubectl apply -f https://k8s.io/examples/admin/resource/quota-mem-cpu.yaml --namespace=quota-mem-cpu-example View detailed information about the ResourceQuota:kubectl get resourcequota mem-cpu-demo --namespace=quota-mem-cpu-example --output=yaml The ResourceQuota places these requirements on the quota-mem-cpu-example namespace:For every Pod in the namespace, each container must have a memory request, memory limit, cpu request, and cpu limit.The memory request total for all Pods in that namespace must not exceed 1 GiB.The memory limit total for all Pods in that namespace must not exceed 2 GiB.The CPU request total for all Pods in that namespace must not exceed 1 cpu.The CPU limit total for all Pods in that namespace must not exceed 2 cpu.See meaning of CPU to learn what Kubernetes means by “1 CPU”.Create a PodHere is a manifest for an example Pod:admin/resource/quota-mem-cpu-pod.yaml apiVersion: v1 kind: Pod metadata: name: quota-mem-cpu-demo spec: containers: - name: quota-mem-cpu-demo-ctr image: nginx resources: limits: memory: "800Mi" cpu: "800m" requests: memory: "600Mi" cpu: "400m" Create the Pod:kubectl apply -f https://k8s.io/examples/admin/resource/quota-mem-cpu-pod.yaml --namespace=quota-mem-cpu-example Verify that the Pod is running and that its (only) container is healthy:kubectl get pod quota-mem-cpu-demo --namespace=quota-mem-cpu-example Once again, view detailed information about the ResourceQuota:kubectl get resourcequota mem-cpu-demo --namespace=quota-mem-cpu-example --output=yaml The output shows the quota along with how much of the quota has been used. You can see that the memory and CPU requests and limits for your Pod do not exceed the quota.status: hard: limits


Question: What is Configure Memory and CPU Quotas 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   q u o t a s   f o r   t h e   t o t a l   a m o u n t   m e m o r y   a n d   C P U   t h a t   c a n   b e   u s e d   b y   a l l   P o d s   r u n n i n g   i n   a   n a m e s p a c e .   Y o u   s p e c i f y   q u o t a s   i n   a   R e s o u r c e Q u o t a   o b j e c t .


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   G i B   o f   m e m o r y .


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   q u o t a - m e m - c p u - e x a m p l e


Question: What is Create a ResourceQuota?

Answer: H e r e   i s   a   m a n i f e s t   f o r   a n   e x a m p l e   R e s o u r c e Q u o t a :   a p i V e r s i o n :   v 1   k i n d :   R e s o u r c e Q u o t a   m e t a d a t a :   n a m e :   m e m - c p u - d e m o   s p e c :   h a r d :   r e q u e s t s . c p u :   " 1 "   r e q u e s t s . m e m o r y :   1 G i   l i m i t s . c p u :   " 2 "   l i m i t s . m e m o r y :   2 G i   C r e a t e   t h e   R e s o u r c e Q u o t a :   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 / q u o t a - m e m - c p u . y a m l   - - n a m e s p a c e = q u o t a - m e m - 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   R e s o u r c e Q u o t a :   k u b e c t l   g e t   r e s o u r c e q u o t a   m e m - c p u - d e m o   - - n a m e s p a c e = q u o t a - m e m - c p u - e x a m p l e   - - o u t p u t = y a m l   T h e   R e s o u r c e Q u o t a   p l a c e s   t h e s e   r e q u i r e m e n t s   o n   t h e   q u o t a - m e m - c p u - e x a m p l e   n a m e s p a c e :   F o r   e v e r y   P o d   i n   t h e   n a m e s p a c e ,   e a c h   c o n t a i n e r   m u s t   h a v e   a   m e m o r y   r e q u e s t ,   m e m o r y   l i m i t ,   c p u   r e q u e s t ,   a n d   c p u   l i m i t . T h e   m e m o r y   r e q u e s t   t o t a l   f o r   a l l   P o d s   i n   t h a t   n a m e s p a c e   m u s t   n o t   e x c e e d   1   G i B . T h e   m e m o r y   l i m i t   t o t a l   f o r   a l l   P o d s   i n   t h a t   n a m e s p a c e   m u s t   n o t   e x c e e d   2   G i B . T h e   C P U   r e q u e s t   t o t a l   f o r   a l l   P o d s   i n   t h a t   n a m e s p a c e   m u s t   n o t   e x c e e d   1   c p u . T h e   C P U   l i m i t   t o t a l   f o r   a l l   P o d s   i n   t h a t   n a m e s p a c e   m u s t   n o t   e x c e e d   2   c p u .   S e e   m e a n i n g   o f   C P U   t o   l e a


Question: What is Create a Pod?

Answer: H e r e   i s   a   m a n i f e s t   f o r   a n   e x a m p l e   P o d :   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 :   q u o t a - m e m - 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 :   q u o t a - m e m - 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 :   m e m o r y :   " 8 0 0 M i "   c p u :   " 8 0 0 m "   r e q u e s t s :   m e m o r y :   " 6 0 0 M i "   c p u :   " 4 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 / q u o t a - m e m - c p u - p o d . y a m l   - - n a m e s p a c e = q u o t a - m e m - 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   ( o n l y )   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   q u o t a - m e m - c p u - d e m o   - - n a m e s p a c e = q u o t a - m e m - c p u - e x a m p l e   O n c e   a g a i n ,   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   R e s o u r c e Q u o t a :   k u b e c t l   g e t   r e s o u r c e q u o t a   m e m - c p u - d e m o   - - n a m e s p a c e = q u o t a - m e m - 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 e   q u o t a   a l o n g   w i t h   h o w   m u c h   o f   t h e   q u o t a   h a s   b e e n   u s e d .   Y o u   c a n   s e e   t h a t   t h e   m e m o r y   a n d   C P U   r e q u e s t s   a n d   l i m i t s   f o r   y o u r   P o d   d o   n o t   e x c e e d   t h e   q u o t a .   s t a t u s :   h a r d :   l i m i t s . c p u :   " 2 "   l i m i t s . m e m o r y :   2 G i   r e q u e s t s . c p u :   " 1 "   r e q u e s t s . m e m o r y :   1 G i   u s e d :   l i m i t s . c p u :   8 0 0 m   l i m i t s . m e m o r y :   8 0 0 M i   r e q u e s t s . c p u :   4 0 0 m   r e q u e s t s . m e m o


Question: What is Attempt to create a second Pod?

Answer: H e r e   i s   a   m a n i f e s t   f o r   a   s e c o n d   P o d :   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 :   q u o t a - m e m - 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 :   q u o t a - m e m - c p u - d e m o - 2 - c t r   i m a g e :   r e d i s   r e s o u r c e s :   l i m i t s :   m e m o r y :   " 1 G i "   c p u :   " 8 0 0 m "   r e q u e s t s :   m e m o r y :   " 7 0 0 M i "   c p u :   " 4 0 0 m "   I n   t h e   m a n i f e s t ,   y o u   c a n   s e e   t h a t   t h e   P o d   h a s   a   m e m o r y   r e q u e s t   o f   7 0 0   M i B .   N o t i c e   t h a t   t h e   s u m   o f   t h e   u s e d   m e m o r y   r e q u e s t   a n d   t h i s   n e w   m e m o r y   r e q u e s t   e x c e e d s   t h e   m e m o r y   r e q u e s t   q u o t a :   6 0 0   M i B   +   7 0 0   M i B   >   1   G i B .   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 / q u o t a - m e m - c p u - p o d - 2 . y a m l   - - n a m e s p a c e = q u o t a - m e m - c p u - e x a m p l e   T h e   s e c o n d   P o d   d o e s   n o t   g e t   c r e a t e d .   T h e   o u t p u t   s h o w s   t h a t   c r e a t i n g   t h e   s e c o n d   P o d   w o u l d   c a u s e   t h e   m e m o r y   r e q u e s t   t o t a l   t o   e x c e e d   t h e   m e m o r y   r e q u e s t   q u o t a .   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 / q u o t a - m e m - c p u - p o d - 2 . y a m l " :   p o d s   " q u o t a - m e m - c p u - d e m o - 2 "   i s   f o r b i d d e n :   e x c e e d e d   q u o t a :   m e m - c p u - d e m o ,   r e q u e s t e d :   r e q u e s t s . m e m o r y = 7 0 0 M i , u s e d :   r e q u e s t s . m e m o r y = 6 0 0 M i ,   l i m i t e d :


Question: What is Discussion?

Answer: A s   y o u   h a v e   s e e n   i n   t h i s   e x e r c i s e ,   y o u   c a n   u s e   a   R e s o u r c e Q u o t a   t o   r e s t r i c t   t h e   m e m o r y   r e q u e s t   t o t a l   f o r   a l l   P o d s   r u n n i n g   i n   a   n a m e s p a c e .   Y o u   c a n   a l s o   r e s t r i c t   t h e   t o t a l s   f o r   m e m o r y   l i m i t ,   c p u   r e q u e s t ,   a n d   c p u   l i m i t .   I n s t e a d   o f   m a n a g i n g   t o t a l   r e s o u r c e   u s e   w i t h i n   a   n a m e s p a c e ,   y o u   m i g h t   w a n t   t o   r e s t r i c t   i n d i v i d u a l   P o d s ,   o r   t h e   c o n t a i n e r s   i n   t h o s e   P o d s .   T o   a c h i e v e   t h a t   k i n d   o f   l i m i t i n g ,   u s e   a   L i m i t R a n g e .


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   q u o t a - m e m - 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 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   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 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   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


Question: What is Node?

Answer: NodeNode is a worker node in Kubernetes.apiVersion: v1import "k8s.io/api/core/v1"NodeNode is a worker node in Kubernetes. Each node will have a unique identifier in the cache (i.e. in etcd).apiVersion: v1kind: Nodemetadata (ObjectMeta)Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadataspec (NodeSpec)Spec defines the behavior of a node. https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-statusstatus (NodeStatus)Most recently observed status of the node. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-statusNodeSpecNodeSpec describes the attributes that a node is created with.configSource (NodeConfigSource)Deprecated: Previously used to specify the source of the node's configuration for the DynamicKubeletConfig feature. This feature is removed.NodeConfigSource specifies a source of node configuration. Exactly one subfield (excluding metadata) must be non-nil. This API is deprecated since 1.22configSource.configMap (ConfigMapNodeConfigSource)ConfigMap is a reference to a Node's ConfigMapConfigMapNodeConfigSource contains the information to reference a ConfigMap as a config source for the Node. This API is deprecated since 1.22: https://git.k8s.io/enhancements/keps/sig-node/281-dynamic-kubelet-configurationconfigSource.configMap.kubeletConfigKey (string), requiredKubeletConfigKey declares which key of the referenced ConfigMap corresponds to the KubeletConfiguration structure This field is required in all cases.configSource.configMap.name (string), requiredName is the metadata.name of the referenced ConfigMap. This field is required in all cases.configSource.configMap.namespace (string), requiredNamespace is the metadata.namespace of the referenced ConfigMap. This field is required in all cases.configSource.configMap.resourceVersion (string)ResourceVersion is the metadata.ResourceVersion of the referenced ConfigMap. This field is forbidden in Node.Spec, and required in Node.Status.configSource.configMap.uid (string)UID is the metadata.UID of the referenced ConfigMap. This field is forbidden in Node.Spec, and required in Node.Status.externalID (string)Deprecated. Not all kubelets will set this field. Remove field after 1.13. see: https://issues.k8s.io/61966podCIDR (string)PodCIDR represents the pod IP range assigned to the node.podCIDRs ([]string)Set: unique values will be kept during a mergepodCIDRs represents the IP ranges assigned to the node for usage by Pods on that node. If this field is specified, the 0th entry must match the podCIDR field. It may contain at most 1 value for each of IPv4 and IPv6.providerID (string)ID of the node assigned by the cloud provider in the format: <ProviderName>://<ProviderSpecificNodeID>taints ([]Taint)Atomic: will be replaced during a mergeIf specified, the node's taints.The node this Taint is attached to


Question: How does Node work?

Answer: NodeNode is a worker node in Kubernetes.apiVersion: v1import "k8s.io/api/core/v1"NodeNode is a worker node in Kubernetes. Each node will have a unique identifier in the cache (i.e. in etcd).apiVersion: v1kind: Nodemetadata (ObjectMeta)Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadataspec (NodeSpec)Spec defines the behavior of a node. https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-statusstatus (NodeStatus)Most recently observed status of the node. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-statusNodeSpecNodeSpec describes the attributes that a node is created with.configSource (NodeConfigSource)Deprecated: Previously used to specify the source of the node's configuration for the DynamicKubeletConfig feature. This feature is removed.NodeConfigSource specifies a source of node configuration. Exactly one subfield (excluding metadata) must be non-nil. This API is deprecated since 1.22configSource.configMap (ConfigMapNodeConfigSource)ConfigMap is a reference to a Node's ConfigMapConfigMapNodeConfigSource contains the information to reference a ConfigMap as a config source for the Node. This API is deprecated since 1.22: https://git.k8s.io/enhancements/keps/sig-node/281-dynamic-kubelet-configurationconfigSource.configMap.kubeletConfigKey (string), requiredKubeletConfigKey declares which key of the referenced ConfigMap corresponds to the KubeletConfiguration structure This field is required in all cases.configSource.configMap.name (string), requiredName is the metadata.name of the referenced ConfigMap. This field is required in all cases.configSource.configMap.namespace (string), requiredNamespace is the metadata.namespace of the referenced ConfigMap. This field is required in all cases.configSource.configMap.resourceVersion (string)ResourceVersion is the metadata.ResourceVersion of the referenced ConfigMap. This field is forbidden in Node.Spec, and required in Node.Status.configSource.configMap.uid (string)UID is the metadata.UID of the referenced ConfigMap. This field is forbidden in Node.Spec, and required in Node.Status.externalID (string)Deprecated. Not all kubelets will set this field. Remove field after 1.13. see: https://issues.k8s.io/61966podCIDR (string)PodCIDR represents the pod IP range assigned to the node.podCIDRs ([]string)Set: unique values will be kept during a mergepodCIDRs represents the IP ranges assigned to the node for usage by Pods on that node. If this field is specified, the 0th entry must match the podCIDR field. It may contain at most 1 value for each of IPv4 and IPv6.providerID (string)ID of the node assigned by the cloud provider in the format: <ProviderName>://<ProviderSpecificNodeID>taints ([]Taint)Atomic: will be replaced during a mergeIf specified, the node's taints.The node this Taint is attached to


Question: When would you use Node?

Answer: NodeNode is a worker node in Kubernetes.apiVersion: v1import "k8s.io/api/core/v1"NodeNode is a worker node in Kubernetes. Each node will have a unique identifier in the cache (i.e. in etcd).apiVersion: v1kind: Nodemetadata (ObjectMeta)Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadataspec (NodeSpec)Spec defines the behavior of a node. https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-statusstatus (NodeStatus)Most recently observed status of the node. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-statusNodeSpecNodeSpec describes the attributes that a node is created with.configSource (NodeConfigSource)Deprecated: Previously used to specify the source of the node's configuration for the DynamicKubeletConfig feature. This feature is removed.NodeConfigSource specifies a source of node configuration. Exactly one subfield (excluding metadata) must be non-nil. This API is deprecated since 1.22configSource.configMap (ConfigMapNodeConfigSource)ConfigMap is a reference to a Node's ConfigMapConfigMapNodeConfigSource contains the information to reference a ConfigMap as a config source for the Node. This API is deprecated since 1.22: https://git.k8s.io/enhancements/keps/sig-node/281-dynamic-kubelet-configurationconfigSource.configMap.kubeletConfigKey (string), requiredKubeletConfigKey declares which key of the referenced ConfigMap corresponds to the KubeletConfiguration structure This field is required in all cases.configSource.configMap.name (string), requiredName is the metadata.name of the referenced ConfigMap. This field is required in all cases.configSource.configMap.namespace (string), requiredNamespace is the metadata.namespace of the referenced ConfigMap. This field is required in all cases.configSource.configMap.resourceVersion (string)ResourceVersion is the metadata.ResourceVersion of the referenced ConfigMap. This field is forbidden in Node.Spec, and required in Node.Status.configSource.configMap.uid (string)UID is the metadata.UID of the referenced ConfigMap. This field is forbidden in Node.Spec, and required in Node.Status.externalID (string)Deprecated. Not all kubelets will set this field. Remove field after 1.13. see: https://issues.k8s.io/61966podCIDR (string)PodCIDR represents the pod IP range assigned to the node.podCIDRs ([]string)Set: unique values will be kept during a mergepodCIDRs represents the IP ranges assigned to the node for usage by Pods on that node. If this field is specified, the 0th entry must match the podCIDR field. It may contain at most 1 value for each of IPv4 and IPv6.providerID (string)ID of the node assigned by the cloud provider in the format: <ProviderName>://<ProviderSpecificNodeID>taints ([]Taint)Atomic: will be replaced during a mergeIf specified, the node's taints.The node this Taint is attached to


Question: What are the benefits of Node?

Answer: NodeNode is a worker node in Kubernetes.apiVersion: v1import "k8s.io/api/core/v1"NodeNode is a worker node in Kubernetes. Each node will have a unique identifier in the cache (i.e. in etcd).apiVersion: v1kind: Nodemetadata (ObjectMeta)Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadataspec (NodeSpec)Spec defines the behavior of a node. https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-statusstatus (NodeStatus)Most recently observed status of the node. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-statusNodeSpecNodeSpec describes the attributes that a node is created with.configSource (NodeConfigSource)Deprecated: Previously used to specify the source of the node's configuration for the DynamicKubeletConfig feature. This feature is removed.NodeConfigSource specifies a source of node configuration. Exactly one subfield (excluding metadata) must be non-nil. This API is deprecated since 1.22configSource.configMap (ConfigMapNodeConfigSource)ConfigMap is a reference to a Node's ConfigMapConfigMapNodeConfigSource contains the information to reference a ConfigMap as a config source for the Node. This API is deprecated since 1.22: https://git.k8s.io/enhancements/keps/sig-node/281-dynamic-kubelet-configurationconfigSource.configMap.kubeletConfigKey (string), requiredKubeletConfigKey declares which key of the referenced ConfigMap corresponds to the KubeletConfiguration structure This field is required in all cases.configSource.configMap.name (string), requiredName is the metadata.name of the referenced ConfigMap. This field is required in all cases.configSource.configMap.namespace (string), requiredNamespace is the metadata.namespace of the referenced ConfigMap. This field is required in all cases.configSource.configMap.resourceVersion (string)ResourceVersion is the metadata.ResourceVersion of the referenced ConfigMap. This field is forbidden in Node.Spec, and required in Node.Status.configSource.configMap.uid (string)UID is the metadata.UID of the referenced ConfigMap. This field is forbidden in Node.Spec, and required in Node.Status.externalID (string)Deprecated. Not all kubelets will set this field. Remove field after 1.13. see: https://issues.k8s.io/61966podCIDR (string)PodCIDR represents the pod IP range assigned to the node.podCIDRs ([]string)Set: unique values will be kept during a mergepodCIDRs represents the IP ranges assigned to the node for usage by Pods on that node. If this field is specified, the 0th entry must match the podCIDR field. It may contain at most 1 value for each of IPv4 and IPv6.providerID (string)ID of the node assigned by the cloud provider in the format: <ProviderName>://<ProviderSpecificNodeID>taints ([]Taint)Atomic: will be replaced during a mergeIf specified, the node's taints.The node this Taint is attached to


Question: What is Node?

Answer: a p i V e r s i o n :   v 1   i m p o r t   " k 8 s . i o / a p i / c o r e / v 1 "


Question: What is Node?

Answer: N o d e   i s   a   w o r k e r   n o d e   i n   K u b e r n e t e s .   E a c h   n o d e   w i l l   h a v e   a   u n i q u e   i d e n t i f i e r   i n   t h e   c a c h e   ( i . e .   i n   e t c d ) .   a p i V e r s i o n :   v 1 k i n d :   N o d e m e t a d a t a   ( O b j e c t M e t a ) S t a n d a r d   o b j e c t ' s   m e t a d a t a .   M o r e   i n f o :   h t t p s : / / g i t . k 8 s . i o / c o m m u n i t y / c o n t r i b u t o r s / d e v e l / s i g - a r c h i t e c t u r e / a p i - c o n v e n t i o n s . m d # m e t a d a t a s p e c   ( N o d e S p e c ) S p e c   d e f i n e s   t h e   b e h a v i o r   o f   a   n o d e .   h t t p s : / / g i t . k 8 s . i o / c o m m u n i t y / c o n t r i b u t o r s / d e v e l / s i g - a r c h i t e c t u r e / a p i - c o n v e n t i o n s . m d # s p e c - a n d - s t a t u s s t a t u s   ( N o d e S t a t u s ) M o s t   r e c e n t l y   o b s e r v e d   s t a t u s   o f   t h e   n o d e .   P o p u l a t e d   b y   t h e   s y s t e m .   R e a d - o n l y .   M o r e   i n f o :   h t t p s : / / g i t . k 8 s . i o / c o m m u n i t y / c o n t r i b u t o r s / d e v e l / s i g - a r c h i t e c t u r e / a p i - c o n v e n t i o n s . m d # s p e c - a n d - s t a t u s   a p i V e r s i o n :   v 1   k i n d :   N o d e   m e t a d a t a   ( O b j e c t M e t a )   S t a n d a r d   o b j e c t ' s   m e t a d a t a .   M o r e   i n f o :   h t t p s : / / g i t . k 8 s . i o / c o m m u n i t y / c o n t r i b u t o r s / d e v e l / s i g - a r c h i t e c t u r e / a p i - c o n v e n t i o n s . m d # m e t a d a t a   s p e c   ( N o d e S p e c )   S p e c   d e f i n e s   t h e   b e h a v i o r   o f   a   n o d e .   h t t p s : / / g i t . k 8 s . i o / c o m m u n i t y / c o n t r i b u t o r s / d e v e l / s i g - a r c h i t e c t u r e / a p i - c o n v e n t i o n s . m d # s p e c - a n d - s t a t u s   s t a t u s   ( N o d e S t a t u s )   M o s t


Question: What is NodeSpec?

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


Question: What is NodeStatus?

Answer: N o d e S t a t u s   i s   i n f o r m a t i o n   a b o u t   t h e   c u r r e n t   s t a t u s   o f   a   n o d e .   a d d r e s s e s   ( [ ] N o d e A d d r e s s ) P a t c h   s t r a t e g y :   m e r g e   o n   k e y   t y p e M a p :   u n i q u e   v a l u e s   o n   k e y   t y p e   w i l l   b e   k e p t   d u r i n g   a   m e r g e L i s t   o f   a d d r e s s e s   r e a c h a b l e   t o   t h e   n o d e .   Q u e r i e d   f r o m   c l o u d   p r o v i d e r ,   i f   a v a i l a b l e .   M o r e   i n f o :   h t t p s : / / k u b e r n e t e s . i o / d o c s / r e f e r e n c e / n o d e / n o d e - s t a t u s / # a d d r e s s e s   N o t e :   T h i s   f i e l d   i s   d e c l a r e d   a s   m e r g e a b l e ,   b u t   t h e   m e r g e   k e y   i s   n o t   s u f f i c i e n t l y   u n i q u e ,   w h i c h   c a n   c a u s e   d a t a   c o r r u p t i o n   w h e n   i t   i s   m e r g e d .   C a l l e r s   s h o u l d   i n s t e a d   u s e   a   f u l l - r e p l a c e m e n t   p a t c h .   S e e   h t t p s : / / p r . k 8 s . i o / 7 9 3 9 1   f o r   a n   e x a m p l e .   C o n s u m e r s   s h o u l d   a s s u m e   t h a t   a d d r e s s e s   c a n   c h a n g e   d u r i n g   t h e   l i f e t i m e   o f   a   N o d e .   H o w e v e r ,   t h e r e   a r e   s o m e   e x c e p t i o n s   w h e r e   t h i s   m a y   n o t   b e   p o s s i b l e ,   s u c h   a s   P o d s   t h a t   i n h e r i t   a   N o d e ' s   a d d r e s s   i n   i t s   o w n   s t a t u s   o r   c o n s u m e r s   o f   t h e   d o w n w a r d   A P I   ( s t a t u s . h o s t I P ) . N o d e A d d r e s s   c o n t a i n s   i n f o r m a t i o n   f o r   t h e   n o d e ' s   a d d r e s s . a d d r e s s e s . a d d r e s s   ( s t r i n g ) ,   r e q u i r e d T h e   n o d e   a d d r e s s . a d d r e s s e s . t y p e   ( s t r i n g ) ,   r e q u i r e d N o d e   a d d r e s s   t y p e ,   o n e   o f


Question: What is NodeList?

Answer: N o d e L i s t   i s   t h e   w h o l e   l i s t   o f   a l l   N o d e s   w h i c h   h a v e   b e e n   r e g i s t e r e d   w i t h   m a s t e r .   a p i V e r s i o n :   v 1 k i n d :   N o d e L i s t m e t a d a t a   ( L i s t M e t a ) S t a n d a r d   l i s t   m e t a d a t a .   M o r e   i n f o :   h t t p s : / / g i t . k 8 s . i o / c o m m u n i t y / c o n t r i b u t o r s / d e v e l / s i g - a r c h i t e c t u r e / a p i - c o n v e n t i o n s . m d # t y p e s - k i n d s i t e m s   ( [ ] N o d e ) ,   r e q u i r e d L i s t   o f   n o d e s   a p i V e r s i o n :   v 1   k i n d :   N o d e L i s t   m e t a d a t a   ( L i s t M e t a )   S t a n d a r d   l i s t   m e t a d a t a .   M o r e   i n f o :   h t t p s : / / g i t . k 8 s . i o / c o m m u n i t y / c o n t r i b u t o r s / d e v e l / s i g - a r c h i t e c t u r e / a p i - c o n v e n t i o n s . m d # t y p e s - k i n d s   i t e m s   ( [ ] N o d e ) ,   r e q u i r e d   L i s t   o f   n o d e s


Question: What is HTTP Request?

Answer: G E T   / a p i / v 1 / n o d e s / { n a m e }


Question: What is Parameters?

Answer: n a m e   ( i n   p a t h ) :   s t r i n g ,   r e q u i r e d n a m e   o f   t h e   N o d e p r e t t y   ( i n   q u e r y ) :   s t r i n g p r e t t y   n a m e   ( i n   p a t h ) :   s t r i n g ,   r e q u i r e d   n a m e   o f   t h e   N o d e   p r e t t y   ( i n   q u e r y ) :   s t r i n g   p r e t t y


Question: What is Response?

Answer: 2 0 0   ( N o d e ) :   O K   4 0 1 :   U n a u t h o r i z e d


Question: What is HTTP Request?

Answer: G E T   / a p i / v 1 / n o d e s / { n a m e } / s t a t u s


Question: What is Parameters?

Answer: n a m e   ( i n   p a t h ) :   s t r i n g ,   r e q u i r e d n a m e   o f   t h e   N o d e p r e t t y   ( i n   q u e r y ) :   s t r i n g p r e t t y   n a m e   ( i n   p a t h ) :   s t r i n g ,   r e q u i r e d   n a m e   o f   t h e   N o d e   p r e t t y   ( i n   q u e r y ) :   s t r i n g   p r e t t y


Question: What is Response?

Answer: 2 0 0   ( N o d e ) :   O K   4 0 1 :   U n a u t h o r i z e d


Question: What is HTTP Request?

Answer: G E T   / a p i / v 1 / n o d e s


Question: What is Parameters?

Answer: a l l o w W a t c h B o o k m a r k s   ( i n   q u e r y ) :   b o o l e a n a l l o w W a t c h B o o k m a r k s c o n t i n u e   ( i n   q u e r y ) :   s t r i n g c o n t i n u e f i e l d S e l e c t o r   ( i n   q u e r y ) :   s t r i n g f i e l d S e l e c t o r l a b e l S e l e c t o r   ( i n   q u e r y ) :   s t r i n g l a b e l S e l e c t o r l i m i t   ( i n   q u e r y ) :   i n t e g e r l i m i t p r e t t y   ( i n   q u e r y ) :   s t r i n g p r e t t y r e s o u r c e V e r s i o n   ( i n   q u e r y ) :   s t r i n g r e s o u r c e V e r s i o n r e s o u r c e V e r s i o n M a t c h   ( i n   q u e r y ) :   s t r i n g r e s o u r c e V e r s i o n M a t c h s e n d I n i t i a l E v e n t s   ( i n   q u e r y ) :   b o o l e a n s e n d I n i t i a l E v e n t s t i m e o u t S e c o n d s   ( i n   q u e r y ) :   i n t e g e r t i m e o u t S e c o n d s w a t c h   ( i n   q u e r y ) :   b o o l e a n w a t c h   a l l o w W a t c h B o o k m a r k s   ( i n   q u e r y ) :   b o o l e a n   a l l o w W a t c h B o o k m a r k s   c o n t i n u e   ( i n   q u e r y ) :   s t r i n g   c o n t i n u e   f i e l d S e l e c t o r   ( i n   q u e r y ) :   s t r i n g   f i e l d S e l e c t o r   l a b e l S e l e c t o r   ( i n   q u e r y ) :   s t r i n g   l a b e l S e l e c t o r   l i m i t   ( i n   q u e r y ) :   i n t e g e r   l i m i t   p r e t t y   ( i n   q u e r y ) :   s t r i n g   p r e t t y   r e s o u r c e V e r s i o n   ( i n   q u e r y ) :   s t r i n g   r e s o u r c e V e r s i o n   r e s o u r c e V e r s i o n M a t c h   ( i n   q u e r y ) :   s t r i n g   r e s o u r c e V e r s i o n M a t c h   s e n d I n i t i a l E v e n t s   ( i n   q u e r y ) :   b o o l e a n   s e n d I n i t i a l E v e n t s   t i m e o u t S e c o n d s   ( i n   q u e r y ) :   i n t e g e r   t i m e o u t S e c o n d s   w a t c h   ( i n   q u e r y ) :   b o o l e a n   w a t c h


Question: What is Response?

Answer: 2 0 0   ( N o d e L i s t ) :   O K   4 0 1 :   U n a u t h o r i z e d


Question: What is HTTP Request?

Answer: P O S T   / a p i / v 1 / n o d e s


Question: What is Parameters?

Answer: b o d y :   N o d e ,   r e q u i r e d d r y R u n   ( i n   q u e r y ) :   s t r i n g d r y R u n f i e l d M a n a g e r   ( i n   q u e r y ) :   s t r i n g f i e l d M a n a g e r f i e l d V a l i d a t i o n   ( i n   q u e r y ) :   s t r i n g f i e l d V a l i d a t i o n p r e t t y   ( i n   q u e r y ) :   s t r i n g p r e t t y   b o d y :   N o d e ,   r e q u i r e d   d r y R u n   ( i n   q u e r y ) :   s t r i n g   d r y R u n   f i e l d M a n a g e r   ( i n   q u e r y ) :   s t r i n g   f i e l d M a n a g e r   f i e l d V a l i d a t i o n   ( i n   q u e r y ) :   s t r i n g   f i e l d V a l i d a t i o n   p r e t t y   ( i n   q u e r y ) :   s t r i n g   p r e t t y


Question: What is Response?

Answer: 2 0 0   ( N o d e ) :   O K   2 0 1   ( N o d e ) :   C r e a t e d   2 0 2   ( N o d e ) :   A c c e p t e d   4 0 1 :   U n a u t h o r i z e d


Question: What is HTTP Request?

Answer: P U T   / a p i / v 1 / n o d e s / { n a m e }


Question: What is Parameters?

Answer: n a m e   ( i n   p a t h ) :   s t r i n g ,   r e q u i r e d n a m e   o f   t h e   N o d e b o d y :   N o d e ,   r e q u i r e d d r y R u n   ( i n   q u e r y ) :   s t r i n g d r y R u n f i e l d M a n a g e r   ( i n   q u e r y ) :   s t r i n g f i e l d M a n a g e r f i e l d V a l i d a t i o n   ( i n   q u e r y ) :   s t r i n g f i e l d V a l i d a t i o n p r e t t y   ( i n   q u e r y ) :   s t r i n g p r e t t y   n a m e   ( i n   p a t h ) :   s t r i n g ,   r e q u i r e d   n a m e   o f   t h e   N o d e   b o d y :   N o d e ,   r e q u i r e d   d r y R u n   ( i n   q u e r y ) :   s t r i n g   d r y R u n   f i e l d M a n a g e r   ( i n   q u e r y ) :   s t r i n g   f i e l d M a n a g e r   f i e l d V a l i d a t i o n   ( i n   q u e r y ) :   s t r i n g   f i e l d V a l i d a t i o n   p r e t t y   ( i n   q u e r y ) :   s t r i n g   p r e t t y


Question: What is Response?

Answer: 2 0 0   ( N o d e ) :   O K   2 0 1   ( N o d e ) :   C r e a t e d   4 0 1 :   U n a u t h o r i z e d


Question: What is HTTP Request?

Answer: P U T   / a p i / v 1 / n o d e s / { n a m e } / s t a t u s


Question: What is Parameters?

Answer: n a m e   ( i n   p a t h ) :   s t r i n g ,   r e q u i r e d n a m e   o f   t h e   N o d e b o d y :   N o d e ,   r e q u i r e d d r y R u n   ( i n   q u e r y ) :   s t r i n g d r y R u n f i e l d M a n a g e r   ( i n   q u e r y ) :   s t r i n g f i e l d M a n a g e r f i e l d V a l i d a t i o n   ( i n   q u e r y ) :   s t r i n g f i e l d V a l i d a t i o n p r e t t y   ( i n   q u e r y ) :   s t r i n g p r e t t y   n a m e   ( i n   p a t h ) :   s t r i n g ,   r e q u i r e d   n a m e   o f   t h e   N o d e   b o d y :   N o d e ,   r e q u i r e d   d r y R u n   ( i n   q u e r y ) :   s t r i n g   d r y R u n   f i e l d M a n a g e r   ( i n   q u e r y ) :   s t r i n g   f i e l d M a n a g e r   f i e l d V a l i d a t i o n   ( i n   q u e r y ) :   s t r i n g   f i e l d V a l i d a t i o n   p r e t t y   ( i n   q u e r y ) :   s t r i n g   p r e t t y


Question: What is Response?

Answer: 2 0 0   ( N o d e ) :   O K   2 0 1   ( N o d e ) :   C r e a t e d   4 0 1 :   U n a u t h o r i z e d


Question: What is HTTP Request?

Answer: P A T C H   / a p i / v 1 / n o d e s / { n a m e }


Question: What is Parameters?

Answer: n a m e   ( i n   p a t h ) :   s t r i n g ,   r e q u i r e d n a m e   o f   t h e   N o d e b o d y :   P a t c h ,   r e q u i r e d d r y R u n   ( i n   q u e r y ) :   s t r i n g d r y R u n f i e l d M a n a g e r   ( i n   q u e r y ) :   s t r i n g f i e l d M a n a g e r f i e l d V a l i d a t i o n   ( i n   q u e r y ) :   s t r i n g f i e l d V a l i d a t i o n f o r c e   ( i n   q u e r y ) :   b o o l e a n f o r c e p r e t t y   ( i n   q u e r y ) :   s t r i n g p r e t t y   n a m e   ( i n   p a t h ) :   s t r i n g ,   r e q u i r e d   n a m e   o f   t h e   N o d e   b o d y :   P a t c h ,   r e q u i r e d   d r y R u n   ( i n   q u e r y ) :   s t r i n g   d r y R u n   f i e l d M a n a g e r   ( i n   q u e r y ) :   s t r i n g   f i e l d M a n a g e r   f i e l d V a l i d a t i o n   ( i n   q u e r y ) :   s t r i n g   f i e l d V a l i d a t i o n   f o r c e   ( i n   q u e r y ) :   b o o l e a n   f o r c e   p r e t t y   ( i n   q u e r y ) :   s t r i n g   p r e t t y


Question: What is Response?

Answer: 2 0 0   ( N o d e ) :   O K   2 0 1   ( N o d e ) :   C r e a t e d   4 0 1 :   U n a u t h o r i z e d


Question: What is HTTP Request?

Answer: P A T C H   / a p i / v 1 / n o d e s / { n a m e } / s t a t u s


Question: What is Parameters?

Answer: n a m e   ( i n   p a t h ) :   s t r i n g ,   r e q u i r e d n a m e   o f   t h e   N o d e b o d y :   P a t c h ,   r e q u i r e d d r y R u n   ( i n   q u e r y ) :   s t r i n g d r y R u n f i e l d M a n a g e r   ( i n   q u e r y ) :   s t r i n g f i e l d M a n a g e r f i e l d V a l i d a t i o n   ( i n   q u e r y ) :   s t r i n g f i e l d V a l i d a t i o n f o r c e   ( i n   q u e r y ) :   b o o l e a n f o r c e p r e t t y   ( i n   q u e r y ) :   s t r i n g p r e t t y   n a m e   ( i n   p a t h ) :   s t r i n g ,   r e q u i r e d   n a m e   o f   t h e   N o d e   b o d y :   P a t c h ,   r e q u i r e d   d r y R u n   ( i n   q u e r y ) :   s t r i n g   d r y R u n   f i e l d M a n a g e r   ( i n   q u e r y ) :   s t r i n g   f i e l d M a n a g e r   f i e l d V a l i d a t i o n   ( i n   q u e r y ) :   s t r i n g   f i e l d V a l i d a t i o n   f o r c e   ( i n   q u e r y ) :   b o o l e a n   f o r c e   p r e t t y   ( i n   q u e r y ) :   s t r i n g   p r e t t y


Question: What is Response?

Answer: 2 0 0   ( N o d e ) :   O K   2 0 1   ( N o d e ) :   C r e a t e d   4 0 1 :   U n a u t h o r i z e d


Question: What is HTTP Request?

Answer: D E L E T E   / a p i / v 1 / n o d e s / { n a m e }


Question: What is Parameters?

Answer: n a m e   ( i n   p a t h ) :   s t r i n g ,   r e q u i r e d n a m e   o f   t h e   N o d e b o d y :   D e l e t e O p t i o n s d r y R u n   ( i n   q u e r y ) :   s t r i n g d r y R u n g r a c e P e r i o d S e c o n d s   ( i n   q u e r y ) :   i n t e g e r g r a c e P e r i o d S e c o n d s i g n o r e S t o r e R e a d E r r o r W i t h C l u s t e r B r e a k i n g P o t e n t i a l   ( i n   q u e r y ) :   b o o l e a n i g n o r e S t o r e R e a d E r r o r W i t h C l u s t e r B r e a k i n g P o t e n t i a l p r e t t y   ( i n   q u e r y ) :   s t r i n g p r e t t y p r o p a g a t i o n P o l i c y   ( i n   q u e r y ) :   s t r i n g p r o p a g a t i o n P o l i c y   n a m e   ( i n   p a t h ) :   s t r i n g ,   r e q u i r e d   n a m e   o f   t h e   N o d e   b o d y :   D e l e t e O p t i o n s   d r y R u n   ( i n   q u e r y ) :   s t r i n g   d r y R u n   g r a c e P e r i o d S e c o n d s   ( i n   q u e r y ) :   i n t e g e r   g r a c e P e r i o d S e c o n d s   i g n o r e S t o r e R e a d E r r o r W i t h C l u s t e r B r e a k i n g P o t e n t i a l   ( i n   q u e r y ) :   b o o l e a n   i g n o r e S t o r e R e a d E r r o r W i t h C l u s t e r B r e a k i n g P o t e n t i a l   p r e t t y   ( i n   q u e r y ) :   s t r i n g   p r e t t y   p r o p a g a t i o n P o l i c y   ( i n   q u e r y ) :   s t r i n g   p r o p a g a t i o n P o l i c y


Question: What is Response?

Answer: 2 0 0   ( S t a t u s ) :   O K   2 0 2   ( S t a t u s ) :   A c c e p t e d   4 0 1 :   U n a u t h o r i z e d


Question: What is HTTP Request?

Answer: D E L E T E   / a p i / v 1 / n o d e s


Question: What is Parameters?

Answer: b o d y :   D e l e t e O p t i o n s c o n t i n u e   ( i n   q u e r y ) :   s t r i n g c o n t i n u e d r y R u n   ( i n   q u e r y ) :   s t r i n g d r y R u n f i e l d S e l e c t o r   ( i n   q u e r y ) :   s t r i n g f i e l d S e l e c t o r g r a c e P e r i o d S e c o n d s   ( i n   q u e r y ) :   i n t e g e r g r a c e P e r i o d S e c o n d s i g n o r e S t o r e R e a d E r r o r W i t h C l u s t e r B r e a k i n g P o t e n t i a l   ( i n   q u e r y ) :   b o o l e a n i g n o r e S t o r e R e a d E r r o r W i t h C l u s t e r B r e a k i n g P o t e n t i a l l a b e l S e l e c t o r   ( i n   q u e r y ) :   s t r i n g l a b e l S e l e c t o r l i m i t   ( i n   q u e r y ) :   i n t e g e r l i m i t p r e t t y   ( i n   q u e r y ) :   s t r i n g p r e t t y p r o p a g a t i o n P o l i c y   ( i n   q u e r y ) :   s t r i n g p r o p a g a t i o n P o l i c y r e s o u r c e V e r s i o n   ( i n   q u e r y ) :   s t r i n g r e s o u r c e V e r s i o n r e s o u r c e V e r s i o n M a t c h   ( i n   q u e r y ) :   s t r i n g r e s o u r c e V e r s i o n M a t c h s e n d I n i t i a l E v e n t s   ( i n   q u e r y ) :   b o o l e a n s e n d I n i t i a l E v e n t s t i m e o u t S e c o n d s   ( i n   q u e r y ) :   i n t e g e r t i m e o u t S e c o n d s   b o d y :   D e l e t e O p t i o n s   c o n t i n u e   ( i n   q u e r y ) :   s t r i n g   c o n t i n u e   d r y R u n   ( i n   q u e r y ) :   s t r i n g   d r y R u n   f i e l d S e l e c t o r   ( i n   q u e r y ) :   s t r i n g   f i e l d S e l e c t o r   g r a c e P e r i o d S e c o n d s   ( i n   q u e r y ) :   i n t e g e r   g r a c e P e r i o d S e c o n d s   i g n o r e S t o r e R e a d E r r o r W i t h C l u s t e r B r e a k i n g P o t e n t i a l   ( i n   q u e r y ) :   b o o l e a n   i g n o r e S t o r e R e a d E r r o r W i t h C l u s t e r B r e a k i n g P o t e n t i a l   l a b e l S e l e c t o r   (


Question: What is Response?

Answer: 2 0 0   ( S t a t u s ) :   O K   4 0 1 :   U n a u t h o r i z e d   T h i s   p a g e   i s   a u t o m a t i c a l l y   g e n e r a t e d .   I f   y o u   p l a n   t o   r e p o r t   a n   i s s u e   w i t h   t h i s   p a g e ,   m e n t i o n   t h a t   t h e   p a g e   i s   a u t o - g e n e r a t e d   i n   y o u r   i s s u e   d e s c r i p t i o n .   T h e   f i x   m a y   n e e d   t o   h a p p e n   e l s e w h e r e   i n   t h e   K u b e r n e t e s   p r o j e c t .


Question: What is LocalSubjectAccessReview?

Answer: LocalSubjectAccessReviewLocalSubjectAccessReview checks whether or not a user or group can perform an action in a given namespace.apiVersion: authorization.k8s.io/v1import "k8s.io/api/authorization/v1"LocalSubjectAccessReviewLocalSubjectAccessReview checks whether or not a user or group can perform an action in a given namespace. Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions checking.apiVersion: authorization.k8s.io/v1kind: LocalSubjectAccessReviewmetadata (ObjectMeta)Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadataspec (SubjectAccessReviewSpec), requiredSpec holds information about the request being evaluated. spec.namespace must be equal to the namespace you made the request against. If empty, it is defaulted.status (SubjectAccessReviewStatus)Status is filled in by the server and indicates whether the request is allowed or notOperationscreate create a LocalSubjectAccessReviewHTTP RequestPOST /apis/authorization.k8s.io/v1/namespaces/{namespace}/localsubjectaccessreviewsParametersnamespace (in path): string, requirednamespacebody: LocalSubjectAccessReview, requireddryRun (in query): stringdryRunfieldManager (in query): stringfieldManagerfieldValidation (in query): stringfieldValidationpretty (in query): stringprettyResponse200 (LocalSubjectAccessReview): OK201 (LocalSubjectAccessReview): Created202 (LocalSubjectAccessReview): Accepted401: UnauthorizedThis page is automatically generated.If you plan to report an issue with this page, mention that the page is auto-generated in your issue description. The fix may need to happen elsewhere in the Kubernetes project.


Question: How does LocalSubjectAccessReview work?

Answer: LocalSubjectAccessReviewLocalSubjectAccessReview checks whether or not a user or group can perform an action in a given namespace.apiVersion: authorization.k8s.io/v1import "k8s.io/api/authorization/v1"LocalSubjectAccessReviewLocalSubjectAccessReview checks whether or not a user or group can perform an action in a given namespace. Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions checking.apiVersion: authorization.k8s.io/v1kind: LocalSubjectAccessReviewmetadata (ObjectMeta)Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadataspec (SubjectAccessReviewSpec), requiredSpec holds information about the request being evaluated. spec.namespace must be equal to the namespace you made the request against. If empty, it is defaulted.status (SubjectAccessReviewStatus)Status is filled in by the server and indicates whether the request is allowed or notOperationscreate create a LocalSubjectAccessReviewHTTP RequestPOST /apis/authorization.k8s.io/v1/namespaces/{namespace}/localsubjectaccessreviewsParametersnamespace (in path): string, requirednamespacebody: LocalSubjectAccessReview, requireddryRun (in query): stringdryRunfieldManager (in query): stringfieldManagerfieldValidation (in query): stringfieldValidationpretty (in query): stringprettyResponse200 (LocalSubjectAccessReview): OK201 (LocalSubjectAccessReview): Created202 (LocalSubjectAccessReview): Accepted401: UnauthorizedThis page is automatically generated.If you plan to report an issue with this page, mention that the page is auto-generated in your issue description. The fix may need to happen elsewhere in the Kubernetes project.


Question: When would you use LocalSubjectAccessReview?

Answer: LocalSubjectAccessReviewLocalSubjectAccessReview checks whether or not a user or group can perform an action in a given namespace.apiVersion: authorization.k8s.io/v1import "k8s.io/api/authorization/v1"LocalSubjectAccessReviewLocalSubjectAccessReview checks whether or not a user or group can perform an action in a given namespace. Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions checking.apiVersion: authorization.k8s.io/v1kind: LocalSubjectAccessReviewmetadata (ObjectMeta)Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadataspec (SubjectAccessReviewSpec), requiredSpec holds information about the request being evaluated. spec.namespace must be equal to the namespace you made the request against. If empty, it is defaulted.status (SubjectAccessReviewStatus)Status is filled in by the server and indicates whether the request is allowed or notOperationscreate create a LocalSubjectAccessReviewHTTP RequestPOST /apis/authorization.k8s.io/v1/namespaces/{namespace}/localsubjectaccessreviewsParametersnamespace (in path): string, requirednamespacebody: LocalSubjectAccessReview, requireddryRun (in query): stringdryRunfieldManager (in query): stringfieldManagerfieldValidation (in query): stringfieldValidationpretty (in query): stringprettyResponse200 (LocalSubjectAccessReview): OK201 (LocalSubjectAccessReview): Created202 (LocalSubjectAccessReview): Accepted401: UnauthorizedThis page is automatically generated.If you plan to report an issue with this page, mention that the page is auto-generated in your issue description. The fix may need to happen elsewhere in the Kubernetes project.


Question: What are the benefits of LocalSubjectAccessReview?

Answer: LocalSubjectAccessReviewLocalSubjectAccessReview checks whether or not a user or group can perform an action in a given namespace.apiVersion: authorization.k8s.io/v1import "k8s.io/api/authorization/v1"LocalSubjectAccessReviewLocalSubjectAccessReview checks whether or not a user or group can perform an action in a given namespace. Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions checking.apiVersion: authorization.k8s.io/v1kind: LocalSubjectAccessReviewmetadata (ObjectMeta)Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadataspec (SubjectAccessReviewSpec), requiredSpec holds information about the request being evaluated. spec.namespace must be equal to the namespace you made the request against. If empty, it is defaulted.status (SubjectAccessReviewStatus)Status is filled in by the server and indicates whether the request is allowed or notOperationscreate create a LocalSubjectAccessReviewHTTP RequestPOST /apis/authorization.k8s.io/v1/namespaces/{namespace}/localsubjectaccessreviewsParametersnamespace (in path): string, requirednamespacebody: LocalSubjectAccessReview, requireddryRun (in query): stringdryRunfieldManager (in query): stringfieldManagerfieldValidation (in query): stringfieldValidationpretty (in query): stringprettyResponse200 (LocalSubjectAccessReview): OK201 (LocalSubjectAccessReview): Created202 (LocalSubjectAccessReview): Accepted401: UnauthorizedThis page is automatically generated.If you plan to report an issue with this page, mention that the page is auto-generated in your issue description. The fix may need to happen elsewhere in the Kubernetes project.


Question: What is LocalSubjectAccessReview?

Answer: a p i V e r s i o n :   a u t h o r i z a t i o n . k 8 s . i o / v 1   i m p o r t   " k 8 s . i o / a p i / a u t h o r i z a t i o n / v 1 "


Question: What is LocalSubjectAccessReview?

Answer: L o c a l S u b j e c t A c c e s s R e v i e w   c h e c k s   w h e t h e r   o r   n o t   a   u s e r   o r   g r o u p   c a n   p e r f o r m   a n   a c t i o n   i n   a   g i v e n   n a m e s p a c e .   H a v i n g   a   n a m e s p a c e   s c o p e d   r e s o u r c e   m a k e s   i t   m u c h   e a s i e r   t o   g r a n t   n a m e s p a c e   s c o p e d   p o l i c y   t h a t   i n c l u d e s   p e r m i s s i o n s   c h e c k i n g .   a p i V e r s i o n :   a u t h o r i z a t i o n . k 8 s . i o / v 1 k i n d :   L o c a l S u b j e c t A c c e s s R e v i e w m e t a d a t a   ( O b j e c t M e t a ) S t a n d a r d   l i s t   m e t a d a t a .   M o r e   i n f o :   h t t p s : / / g i t . k 8 s . i o / c o m m u n i t y / c o n t r i b u t o r s / d e v e l / s i g - a r c h i t e c t u r e / a p i - c o n v e n t i o n s . m d # m e t a d a t a s p e c   ( S u b j e c t A c c e s s R e v i e w S p e c ) ,   r e q u i r e d S p e c   h o l d s   i n f o r m a t i o n   a b o u t   t h e   r e q u e s t   b e i n g   e v a l u a t e d .   s p e c . n a m e s p a c e   m u s t   b e   e q u a l   t o   t h e   n a m e s p a c e   y o u   m a d e   t h e   r e q u e s t   a g a i n s t .   I f   e m p t y ,   i t   i s   d e f a u l t e d . s t a t u s   ( S u b j e c t A c c e s s R e v i e w S t a t u s ) S t a t u s   i s   f i l l e d   i n   b y   t h e   s e r v e r   a n d   i n d i c a t e s   w h e t h e r   t h e   r e q u e s t   i s   a l l o w e d   o r   n o t   a p i V e r s i o n :   a u t h o r i z a t i o n . k 8 s . i o / v 1   k i n d :   L o c a l S u b j e c t A c c e s s R e v i e w   m e t a d a t a   ( O b j e c t M e t a )   S t a n d a r d   l i s t   m e t a d a t a .   M o r e   i n f o :   h t t p s : / / g i t . k 8 s . i o / c o m m u n i t y / c o n t r i b u t o r s / d e v e l / s i g - a r c h i t e c t u r e / a p i - c o n v e n t i o n s . m d # m e t a d a t a   s p e c   ( S u b j e c t A c c e s


Question: What is HTTP Request?

Answer: P O S T   / a p i s / a u t h o r i z a t i o n . k 8 s . i o / v 1 / n a m e s p a c e s / { n a m e s p a c e } / l o c a l s u b j e c t a c c e s s r e v i e w s


Question: What is Parameters?

Answer: n a m e s p a c e   ( i n   p a t h ) :   s t r i n g ,   r e q u i r e d n a m e s p a c e b o d y :   L o c a l S u b j e c t A c c e s s R e v i e w ,   r e q u i r e d d r y R u n   ( i n   q u e r y ) :   s t r i n g d r y R u n f i e l d M a n a g e r   ( i n   q u e r y ) :   s t r i n g f i e l d M a n a g e r f i e l d V a l i d a t i o n   ( i n   q u e r y ) :   s t r i n g f i e l d V a l i d a t i o n p r e t t y   ( i n   q u e r y ) :   s t r i n g p r e t t y   n a m e s p a c e   ( i n   p a t h ) :   s t r i n g ,   r e q u i r e d   n a m e s p a c e   b o d y :   L o c a l S u b j e c t A c c e s s R e v i e w ,   r e q u i r e d   d r y R u n   ( i n   q u e r y ) :   s t r i n g   d r y R u n   f i e l d M a n a g e r   ( i n   q u e r y ) :   s t r i n g   f i e l d M a n a g e r   f i e l d V a l i d a t i o n   ( i n   q u e r y ) :   s t r i n g   f i e l d V a l i d a t i o n   p r e t t y   ( i n   q u e r y ) :   s t r i n g   p r e t t y


Question: What is Response?

Answer: 2 0 0   ( L o c a l S u b j e c t A c c e s s R e v i e w ) :   O K   2 0 1   ( L o c a l S u b j e c t A c c e s s R e v i e w ) :   C r e a t e d   2 0 2   ( L o c a l S u b j e c t A c c e s s R e v i e w ) :   A c c e p t e d   4 0 1 :   U n a u t h o r i z e d   T h i s   p a g e   i s   a u t o m a t i c a l l y   g e n e r a t e d .   I f   y o u   p l a n   t o   r e p o r t   a n   i s s u e   w i t h   t h i s   p a g e ,   m e n t i o n   t h a t   t h e   p a g e   i s   a u t o - g e n e r a t e d   i n   y o u r   i s s u e   d e s c r i p t i o n .   T h e   f i x   m a y   n e e d   t o   h a p p e n   e l s e w h e r e   i n   t h e   K u b e r n e t e s   p r o j e c t .


Question: What is Accessing Clusters?

Answer: Accessing ClustersThis topic discusses multiple ways to interact with clusters.Accessing for the first time with kubectlWhen accessing the Kubernetes API for the first time, we suggest using the Kubernetes CLI, kubectl.To access a cluster, you need to know the location of the cluster and have credentials to access it. Typically, this is automatically set-up when you work through a Getting started guide, or someone else set up the cluster and provided you with credentials and a location.Check the location and credentials that kubectl knows about with this command:kubectl config view Many of the examples provide an introduction to using kubectl, and complete documentation is found in the kubectl reference.Directly accessing the REST APIKubectl handles locating and authenticating to the apiserver. If you want to directly access the REST API with an http client like curl or wget, or a browser, there are several ways to locate and authenticate:Run kubectl in proxy mode.Recommended approach.Uses stored apiserver location.Verifies identity of apiserver using self-signed cert. No MITM possible.Authenticates to apiserver.In future, may do intelligent client-side load-balancing and failover.Provide the location and credentials directly to the http client.Alternate approach.Works with some types of client code that are confused by using a proxy.Need to import a root cert into your browser to protect against MITM.Using kubectl proxyThe following command runs kubectl in a mode where it acts as a reverse proxy. It handles locating the apiserver and authenticating. Run it like this:kubectl proxy --port=8080 See kubectl proxy for more details.Then you can explore the API with curl, wget, or a browser, replacing localhost with [::1] for IPv6, like so:curl http://localhost:8080/api/ The output is similar to this:{ "kind": "APIVersions", "versions": [ "v1" ], "serverAddressByClientCIDRs": [ { "clientCIDR": "0.0.0.0/0", "serverAddress": "10.0.1.149:443" } ] } Without kubectl proxyUse kubectl apply and kubectl describe secret... to create a token for the default service account with grep/cut:First, create the Secret, requesting a token for the default ServiceAccount:kubectl apply -f - <<EOF apiVersion: v1 kind: Secret metadata: name: default-token annotations: kubernetes.io/service-account.name: default type: kubernetes.io/service-account-token EOF


Question: How does Accessing Clusters work?

Answer: Accessing ClustersThis topic discusses multiple ways to interact with clusters.Accessing for the first time with kubectlWhen accessing the Kubernetes API for the first time, we suggest using the Kubernetes CLI, kubectl.To access a cluster, you need to know the location of the cluster and have credentials to access it. Typically, this is automatically set-up when you work through a Getting started guide, or someone else set up the cluster and provided you with credentials and a location.Check the location and credentials that kubectl knows about with this command:kubectl config view Many of the examples provide an introduction to using kubectl, and complete documentation is found in the kubectl reference.Directly accessing the REST APIKubectl handles locating and authenticating to the apiserver. If you want to directly access the REST API with an http client like curl or wget, or a browser, there are several ways to locate and authenticate:Run kubectl in proxy mode.Recommended approach.Uses stored apiserver location.Verifies identity of apiserver using self-signed cert. No MITM possible.Authenticates to apiserver.In future, may do intelligent client-side load-balancing and failover.Provide the location and credentials directly to the http client.Alternate approach.Works with some types of client code that are confused by using a proxy.Need to import a root cert into your browser to protect against MITM.Using kubectl proxyThe following command runs kubectl in a mode where it acts as a reverse proxy. It handles locating the apiserver and authenticating. Run it like this:kubectl proxy --port=8080 See kubectl proxy for more details.Then you can explore the API with curl, wget, or a browser, replacing localhost with [::1] for IPv6, like so:curl http://localhost:8080/api/ The output is similar to this:{ "kind": "APIVersions", "versions": [ "v1" ], "serverAddressByClientCIDRs": [ { "clientCIDR": "0.0.0.0/0", "serverAddress": "10.0.1.149:443" } ] } Without kubectl proxyUse kubectl apply and kubectl describe secret... to create a token for the default service account with grep/cut:First, create the Secret, requesting a token for the default ServiceAccount:kubectl apply -f - <<EOF apiVersion: v1 kind: Secret metadata: name: default-token annotations: kubernetes.io/service-account.name: default type: kubernetes.io/service-account-token EOF


Question: When would you use Accessing Clusters?

Answer: Accessing ClustersThis topic discusses multiple ways to interact with clusters.Accessing for the first time with kubectlWhen accessing the Kubernetes API for the first time, we suggest using the Kubernetes CLI, kubectl.To access a cluster, you need to know the location of the cluster and have credentials to access it. Typically, this is automatically set-up when you work through a Getting started guide, or someone else set up the cluster and provided you with credentials and a location.Check the location and credentials that kubectl knows about with this command:kubectl config view Many of the examples provide an introduction to using kubectl, and complete documentation is found in the kubectl reference.Directly accessing the REST APIKubectl handles locating and authenticating to the apiserver. If you want to directly access the REST API with an http client like curl or wget, or a browser, there are several ways to locate and authenticate:Run kubectl in proxy mode.Recommended approach.Uses stored apiserver location.Verifies identity of apiserver using self-signed cert. No MITM possible.Authenticates to apiserver.In future, may do intelligent client-side load-balancing and failover.Provide the location and credentials directly to the http client.Alternate approach.Works with some types of client code that are confused by using a proxy.Need to import a root cert into your browser to protect against MITM.Using kubectl proxyThe following command runs kubectl in a mode where it acts as a reverse proxy. It handles locating the apiserver and authenticating. Run it like this:kubectl proxy --port=8080 See kubectl proxy for more details.Then you can explore the API with curl, wget, or a browser, replacing localhost with [::1] for IPv6, like so:curl http://localhost:8080/api/ The output is similar to this:{ "kind": "APIVersions", "versions": [ "v1" ], "serverAddressByClientCIDRs": [ { "clientCIDR": "0.0.0.0/0", "serverAddress": "10.0.1.149:443" } ] } Without kubectl proxyUse kubectl apply and kubectl describe secret... to create a token for the default service account with grep/cut:First, create the Secret, requesting a token for the default ServiceAccount:kubectl apply -f - <<EOF apiVersion: v1 kind: Secret metadata: name: default-token annotations: kubernetes.io/service-account.name: default type: kubernetes.io/service-account-token EOF


Question: What are the benefits of Accessing Clusters?

Answer: Accessing ClustersThis topic discusses multiple ways to interact with clusters.Accessing for the first time with kubectlWhen accessing the Kubernetes API for the first time, we suggest using the Kubernetes CLI, kubectl.To access a cluster, you need to know the location of the cluster and have credentials to access it. Typically, this is automatically set-up when you work through a Getting started guide, or someone else set up the cluster and provided you with credentials and a location.Check the location and credentials that kubectl knows about with this command:kubectl config view Many of the examples provide an introduction to using kubectl, and complete documentation is found in the kubectl reference.Directly accessing the REST APIKubectl handles locating and authenticating to the apiserver. If you want to directly access the REST API with an http client like curl or wget, or a browser, there are several ways to locate and authenticate:Run kubectl in proxy mode.Recommended approach.Uses stored apiserver location.Verifies identity of apiserver using self-signed cert. No MITM possible.Authenticates to apiserver.In future, may do intelligent client-side load-balancing and failover.Provide the location and credentials directly to the http client.Alternate approach.Works with some types of client code that are confused by using a proxy.Need to import a root cert into your browser to protect against MITM.Using kubectl proxyThe following command runs kubectl in a mode where it acts as a reverse proxy. It handles locating the apiserver and authenticating. Run it like this:kubectl proxy --port=8080 See kubectl proxy for more details.Then you can explore the API with curl, wget, or a browser, replacing localhost with [::1] for IPv6, like so:curl http://localhost:8080/api/ The output is similar to this:{ "kind": "APIVersions", "versions": [ "v1" ], "serverAddressByClientCIDRs": [ { "clientCIDR": "0.0.0.0/0", "serverAddress": "10.0.1.149:443" } ] } Without kubectl proxyUse kubectl apply and kubectl describe secret... to create a token for the default service account with grep/cut:First, create the Secret, requesting a token for the default ServiceAccount:kubectl apply -f - <<EOF apiVersion: v1 kind: Secret metadata: name: default-token annotations: kubernetes.io/service-account.name: default type: kubernetes.io/service-account-token EOF


Question: What is Accessing Clusters?

Answer: T h i s   t o p i c   d i s c u s s e s   m u l t i p l e   w a y s   t o   i n t e r a c t   w i t h   c l u s t e r s .


Question: What is Accessing for the first time with kubectl?

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


Question: What is Directly accessing the REST API?

Answer: K u b e c t l   h a n d l e s   l o c a t i n g   a n d   a u t h e n t i c a t i n g   t o   t h e   a p i s e r v e r .   I f   y o u   w a n t   t o   d i r e c t l y   a c c e s s   t h e   R E S T   A P I   w i t h   a n   h t t p   c l i e n t   l i k e   c u r l   o r   w g e t ,   o r   a   b r o w s e r ,   t h e r e   a r e   s e v e r a l   w a y s   t o   l o c a t e   a n d   a u t h e n t i c a t e :   R u n   k u b e c t l   i n   p r o x y   m o d e . R e c o m m e n d e d   a p p r o a c h . U s e s   s t o r e d   a p i s e r v e r   l o c a t i o n . V e r i f i e s   i d e n t i t y   o f   a p i s e r v e r   u s i n g   s e l f - s i g n e d   c e r t .   N o   M I T M   p o s s i b l e . A u t h e n t i c a t e s   t o   a p i s e r v e r . I n   f u t u r e ,   m a y   d o   i n t e l l i g e n t   c l i e n t - s i d e   l o a d - b a l a n c i n g   a n d   f a i l o v e r . P r o v i d e   t h e   l o c a t i o n   a n d   c r e d e n t i a l s   d i r e c t l y   t o   t h e   h t t p   c l i e n t . A l t e r n a t e   a p p r o a c h . W o r k s   w i t h   s o m e   t y p e s   o f   c l i e n t   c o d e   t h a t   a r e   c o n f u s e d   b y   u s i n g   a   p r o x y . N e e d   t o   i m p o r t   a   r o o t   c e r t   i n t o   y o u r   b r o w s e r   t o   p r o t e c t   a g a i n s t   M I T M .   R e c o m m e n d e d   a p p r o a c h . U s e s   s t o r e d   a p i s e r v e r   l o c a t i o n . V e r i f i e s   i d e n t i t y   o f   a p i s e r v e r   u s i n g   s e l f - s i g n e d   c e r t .   N o   M I T M   p o s s i b l e . A u t h e n t i c a t e s   t o   a p i s e r v e r . I n   f u t u r e ,   m a y   d o   i n t e l l i g e n t   c l i e n t - s i d e   l o a d - b a l a n c i n g   a n d   f a i l o v e r .   A l t e r n a t e   a p p r o a c h . W o r k s   w i t h   s o m e   t y p e s   o f   c l i e n t   c o d e   t h a t   a r e   c o n f u s e d   b y   u s i n g   a   p r o x y . N e e d


Question: What is Using kubectl proxy?

Answer: T h e   f o l l o w i n g   c o m m a n d   r u n s   k u b e c t l   i n   a   m o d e   w h e r e   i t   a c t s   a s   a   r e v e r s e   p r o x y .   I t   h a n d l e s   l o c a t i n g   t h e   a p i s e r v e r   a n d   a u t h e n t i c a t i n g .   R u n   i t   l i k e   t h i s :   k u b e c t l   p r o x y   - - p o r t = 8 0 8 0   S e e   k u b e c t l   p r o x y   f o r   m o r e   d e t a i l s .   T h e n   y o u   c a n   e x p l o r e   t h e   A P I   w i t h   c u r l ,   w g e t ,   o r   a   b r o w s e r ,   r e p l a c i n g   l o c a l h o s t   w i t h   [ : : 1 ]   f o r   I P v 6 ,   l i k e   s o :   c u r l   h t t p : / / l o c a l h o s t : 8 0 8 0 / a p i /   T h e   o u t p u t   i s   s i m i l a r   t o   t h i s :   {   " k i n d " :   " A P I V e r s i o n s " ,   " v e r s i o n s " :   [   " v 1 "   ] ,   " s e r v e r A d d r e s s B y C l i e n t C I D R s " :   [   {   " c l i e n t C I D R " :   " 0 . 0 . 0 . 0 / 0 " ,   " s e r v e r A d d r e s s " :   " 1 0 . 0 . 1 . 1 4 9 : 4 4 3 "   }   ]   }


Question: What is Without kubectl proxy?

Answer: U s e   k u b e c t l   a p p l y   a n d   k u b e c t l   d e s c r i b e   s e c r e t . . .   t o   c r e a t e   a   t o k e n   f o r   t h e   d e f a u l t   s e r v i c e   a c c o u n t   w i t h   g r e p / c u t :   F i r s t ,   c r e a t e   t h e   S e c r e t ,   r e q u e s t i n g   a   t o k e n   f o r   t h e   d e f a u l t   S e r v i c e A c c o u n t :   k u b e c t l   a p p l y   - f   -   < < E O F   a p i V e r s i o n :   v 1   k i n d :   S e c r e t   m e t a d a t a :   n a m e :   d e f a u l t - t o k e n   a n n o t a t i o n s :   k u b e r n e t e s . i o / s e r v i c e - a c c o u n t . n a m e :   d e f a u l t   t y p e :   k u b e r n e t e s . i o / s e r v i c e - a c c o u n t - t o k e n   E O F   N e x t ,   w a i t   f o r   t h e   t o k e n   c o n t r o l l e r   t o   p o p u l a t e   t h e   S e c r e t   w i t h   a   t o k e n :   w h i l e   !   k u b e c t l   d e s c r i b e   s e c r e t   d e f a u l t - t o k e n   |   g r e p   - E   ' ^ t o k e n '   > / d e v / n u l l ;   d o   e c h o   " w a i t i n g   f o r   t o k e n . . . "   > & 2   s l e e p   1   d o n e   C a p t u r e   a n d   u s e   t h e   g e n e r a t e d   t o k e n :   A P I S E R V E R = $ ( k u b e c t l   c o n f i g   v i e w   - - m i n i f y   |   g r e p   s e r v e r   |   c u t   - f   2 -   - d   " : "   |   t r   - d   "   " )   T O K E N = $ ( k u b e c t l   d e s c r i b e   s e c r e t   d e f a u l t - t o k e n   |   g r e p   - E   ' ^ t o k e n '   |   c u t   - f 2   - d ' : '   |   t r   - d   "   " )   c u r l   $ A P I S E R V E R / a p i   - - h e a d e r   " A u t h o r i z a t i o n :   B e a r e r   $ T O K E N "   - - i n s e c u r e   T h e   o u t p u t   i s   s i m i l a r   t o   t h i s :   {   " k i n d " :   " A P I V e r s i o n s " ,   " v e r s i o n s " :   [   " v 1 "   ] ,   " s e r v e r A d d r e s s B y C l i e n t C I D R s " :   [   {   " c l i e n t C I D R " :   " 0 . 0 . 0 . 0 / 0


Question: What is Programmatic access to the API?

Answer: K u b e r n e t e s   o f f i c i a l l y   s u p p o r t s   G o   a n d   P y t h o n   c l i e n t   l i b r a r i e s .


Question: What is Go client?

Answer: T o   g e t   t h e   l i b r a r y ,   r u n   t h e   f o l l o w i n g   c o m m a n d :   g o   g e t   k 8 s . i o / c l i e n t - g o @ k u b e r n e t e s - < k u b e r n e t e s - v e r s i o n - n u m b e r > ,   s e e   I N S T A L L . m d   f o r   d e t a i l e d   i n s t a l l a t i o n   i n s t r u c t i o n s .   S e e   h t t p s : / / g i t h u b . c o m / k u b e r n e t e s / c l i e n t - g o   t o   s e e   w h i c h   v e r s i o n s   a r e   s u p p o r t e d . W r i t e   a n   a p p l i c a t i o n   a t o p   o f   t h e   c l i e n t - g o   c l i e n t s .   N o t e   t h a t   c l i e n t - g o   d e f i n e s   i t s   o w n   A P I   o b j e c t s ,   s o   i f   n e e d e d ,   p l e a s e   i m p o r t   A P I   d e f i n i t i o n s   f r o m   c l i e n t - g o   r a t h e r   t h a n   f r o m   t h e   m a i n   r e p o s i t o r y ,   e . g . ,   i m p o r t   " k 8 s . i o / c l i e n t - g o / k u b e r n e t e s "   i s   c o r r e c t .   T h e   G o   c l i e n t   c a n   u s e   t h e   s a m e   k u b e c o n f i g   f i l e   a s   t h e   k u b e c t l   C L I   d o e s   t o   l o c a t e   a n d   a u t h e n t i c a t e   t o   t h e   a p i s e r v e r .   S e e   t h i s   e x a m p l e .   I f   t h e   a p p l i c a t i o n   i s   d e p l o y e d   a s   a   P o d   i n   t h e   c l u s t e r ,   p l e a s e   r e f e r   t o   t h e   n e x t   s e c t i o n .


Question: What is Python client?

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


Question: What is Other languages?

Answer: T h e r e   a r e   c l i e n t   l i b r a r i e s   f o r   a c c e s s i n g   t h e   A P I   f r o m   o t h e r   l a n g u a g e s .   S e e   d o c u m e n t a t i o n   f o r   o t h e r   l i b r a r i e s   f o r   h o w   t h e y   a u t h e n t i c a t e .


Question: What is Accessing the API from a Pod?

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


Question: What is Accessing services running on the cluster?

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


Question: What is Requesting redirects?

Answer: T h e   r e d i r e c t   c a p a b i l i t i e s   h a v e   b e e n   d e p r e c a t e d   a n d   r e m o v e d .   P l e a s e   u s e   a   p r o x y   ( s e e   b e l o w )   i n s t e a d .


Question: What is So many proxies?

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


Question: What is Configure a Pod Quota for a Namespace?

Answer: Configure a Pod Quota for a NamespaceRestrict how many Pods you can create within a namespace.This page shows how to set a quota for the total number of Pods that can run in a Namespace. You specify quotas in a ResourceQuota object.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.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 quota-pod-example Create a ResourceQuotaHere is an example manifest for a ResourceQuota:admin/resource/quota-pod.yaml apiVersion: v1 kind: ResourceQuota metadata: name: pod-demo spec: hard: pods: "2" Create the ResourceQuota:kubectl apply -f https://k8s.io/examples/admin/resource/quota-pod.yaml --namespace=quota-pod-example View detailed information about the ResourceQuota:kubectl get resourcequota pod-demo --namespace=quota-pod-example --output=yaml The output shows that the namespace has a quota of two Pods, and that currently there are no Pods; that is, none of the quota is used.spec: hard: pods: "2" status: hard: pods: "2" used: pods: "0" Here is an example manifest for a Deployment:admin/resource/quota-pod-deployment.yaml apiVersion: apps/v1 kind: Deployment metadata: name: pod-quota-demo spec: selector: matchLabels: purpose: quota-demo replicas: 3 template: metadata: labels: purpose: quota-demo spec: containers: - name: pod-quota-demo image: nginx In that manifest, replicas: 3 tells Kubernetes to attempt to create three new Pods, all running the same application.Create the Deployment:kubectl apply -f https://k8s.io/examples/admin/resource/quota-pod-deployment.yaml --namespace=quota-pod-example View detailed information about the Deployment:kubectl get deployment pod-quota-demo --namespace=quota-pod-example --output=yaml The output shows that even though the Deployment specifies three replicas, only two Pods were created because of the quota you defined earlier:spec: ... replicas: 3 ... status: availableReplicas: 2 ... lastUpdateTime: 2021-04-02T20:57:05Z message: 'unable to create pods: pods "pod-quota-demo-1650323038-" is forbidden: exceeded quota: pod-demo, requested: pods=1, used: pods=2, limited: pods=2' Choice of resourceIn this task you have defined a ResourceQuota that limited the total number of Pods, but you could also limit the total number of other kinds of object. For example, you might decide to limit how many CronJobs that can live in a single namespace.Clean upDelete your namespace:kubectl delete namespace quota-pod-example What's nextFor cluster administrato


Question: How does Configure a Pod Quota for a Namespace work?

Answer: Configure a Pod Quota for a NamespaceRestrict how many Pods you can create within a namespace.This page shows how to set a quota for the total number of Pods that can run in a Namespace. You specify quotas in a ResourceQuota object.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.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 quota-pod-example Create a ResourceQuotaHere is an example manifest for a ResourceQuota:admin/resource/quota-pod.yaml apiVersion: v1 kind: ResourceQuota metadata: name: pod-demo spec: hard: pods: "2" Create the ResourceQuota:kubectl apply -f https://k8s.io/examples/admin/resource/quota-pod.yaml --namespace=quota-pod-example View detailed information about the ResourceQuota:kubectl get resourcequota pod-demo --namespace=quota-pod-example --output=yaml The output shows that the namespace has a quota of two Pods, and that currently there are no Pods; that is, none of the quota is used.spec: hard: pods: "2" status: hard: pods: "2" used: pods: "0" Here is an example manifest for a Deployment:admin/resource/quota-pod-deployment.yaml apiVersion: apps/v1 kind: Deployment metadata: name: pod-quota-demo spec: selector: matchLabels: purpose: quota-demo replicas: 3 template: metadata: labels: purpose: quota-demo spec: containers: - name: pod-quota-demo image: nginx In that manifest, replicas: 3 tells Kubernetes to attempt to create three new Pods, all running the same application.Create the Deployment:kubectl apply -f https://k8s.io/examples/admin/resource/quota-pod-deployment.yaml --namespace=quota-pod-example View detailed information about the Deployment:kubectl get deployment pod-quota-demo --namespace=quota-pod-example --output=yaml The output shows that even though the Deployment specifies three replicas, only two Pods were created because of the quota you defined earlier:spec: ... replicas: 3 ... status: availableReplicas: 2 ... lastUpdateTime: 2021-04-02T20:57:05Z message: 'unable to create pods: pods "pod-quota-demo-1650323038-" is forbidden: exceeded quota: pod-demo, requested: pods=1, used: pods=2, limited: pods=2' Choice of resourceIn this task you have defined a ResourceQuota that limited the total number of Pods, but you could also limit the total number of other kinds of object. For example, you might decide to limit how many CronJobs that can live in a single namespace.Clean upDelete your namespace:kubectl delete namespace quota-pod-example What's nextFor cluster administrato


Question: When would you use Configure a Pod Quota for a Namespace?

Answer: Configure a Pod Quota for a NamespaceRestrict how many Pods you can create within a namespace.This page shows how to set a quota for the total number of Pods that can run in a Namespace. You specify quotas in a ResourceQuota object.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.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 quota-pod-example Create a ResourceQuotaHere is an example manifest for a ResourceQuota:admin/resource/quota-pod.yaml apiVersion: v1 kind: ResourceQuota metadata: name: pod-demo spec: hard: pods: "2" Create the ResourceQuota:kubectl apply -f https://k8s.io/examples/admin/resource/quota-pod.yaml --namespace=quota-pod-example View detailed information about the ResourceQuota:kubectl get resourcequota pod-demo --namespace=quota-pod-example --output=yaml The output shows that the namespace has a quota of two Pods, and that currently there are no Pods; that is, none of the quota is used.spec: hard: pods: "2" status: hard: pods: "2" used: pods: "0" Here is an example manifest for a Deployment:admin/resource/quota-pod-deployment.yaml apiVersion: apps/v1 kind: Deployment metadata: name: pod-quota-demo spec: selector: matchLabels: purpose: quota-demo replicas: 3 template: metadata: labels: purpose: quota-demo spec: containers: - name: pod-quota-demo image: nginx In that manifest, replicas: 3 tells Kubernetes to attempt to create three new Pods, all running the same application.Create the Deployment:kubectl apply -f https://k8s.io/examples/admin/resource/quota-pod-deployment.yaml --namespace=quota-pod-example View detailed information about the Deployment:kubectl get deployment pod-quota-demo --namespace=quota-pod-example --output=yaml The output shows that even though the Deployment specifies three replicas, only two Pods were created because of the quota you defined earlier:spec: ... replicas: 3 ... status: availableReplicas: 2 ... lastUpdateTime: 2021-04-02T20:57:05Z message: 'unable to create pods: pods "pod-quota-demo-1650323038-" is forbidden: exceeded quota: pod-demo, requested: pods=1, used: pods=2, limited: pods=2' Choice of resourceIn this task you have defined a ResourceQuota that limited the total number of Pods, but you could also limit the total number of other kinds of object. For example, you might decide to limit how many CronJobs that can live in a single namespace.Clean upDelete your namespace:kubectl delete namespace quota-pod-example What's nextFor cluster administrato


Question: What are the benefits of Configure a Pod Quota for a Namespace?

Answer: Configure a Pod Quota for a NamespaceRestrict how many Pods you can create within a namespace.This page shows how to set a quota for the total number of Pods that can run in a Namespace. You specify quotas in a ResourceQuota object.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.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 quota-pod-example Create a ResourceQuotaHere is an example manifest for a ResourceQuota:admin/resource/quota-pod.yaml apiVersion: v1 kind: ResourceQuota metadata: name: pod-demo spec: hard: pods: "2" Create the ResourceQuota:kubectl apply -f https://k8s.io/examples/admin/resource/quota-pod.yaml --namespace=quota-pod-example View detailed information about the ResourceQuota:kubectl get resourcequota pod-demo --namespace=quota-pod-example --output=yaml The output shows that the namespace has a quota of two Pods, and that currently there are no Pods; that is, none of the quota is used.spec: hard: pods: "2" status: hard: pods: "2" used: pods: "0" Here is an example manifest for a Deployment:admin/resource/quota-pod-deployment.yaml apiVersion: apps/v1 kind: Deployment metadata: name: pod-quota-demo spec: selector: matchLabels: purpose: quota-demo replicas: 3 template: metadata: labels: purpose: quota-demo spec: containers: - name: pod-quota-demo image: nginx In that manifest, replicas: 3 tells Kubernetes to attempt to create three new Pods, all running the same application.Create the Deployment:kubectl apply -f https://k8s.io/examples/admin/resource/quota-pod-deployment.yaml --namespace=quota-pod-example View detailed information about the Deployment:kubectl get deployment pod-quota-demo --namespace=quota-pod-example --output=yaml The output shows that even though the Deployment specifies three replicas, only two Pods were created because of the quota you defined earlier:spec: ... replicas: 3 ... status: availableReplicas: 2 ... lastUpdateTime: 2021-04-02T20:57:05Z message: 'unable to create pods: pods "pod-quota-demo-1650323038-" is forbidden: exceeded quota: pod-demo, requested: pods=1, used: pods=2, limited: pods=2' Choice of resourceIn this task you have defined a ResourceQuota that limited the total number of Pods, but you could also limit the total number of other kinds of object. For example, you might decide to limit how many CronJobs that can live in a single namespace.Clean upDelete your namespace:kubectl delete namespace quota-pod-example What's nextFor cluster administrato


Question: What is Configure a Pod Quota 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   a   q u o t a   f o r   t h e   t o t a l   n u m b e r   o f   P o d s   t h a t   c a n   r u n   i n   a   N a m e s p a c e .   Y o u   s p e c i f y   q u o t a s   i n   a   R e s o u r c e Q u o t a   o b j e c t .


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 .


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   q u o t a - p o d - e x a m p l e


Question: What is Create a ResourceQuota?

Answer: H e r e   i s   a n   e x a m p l e   m a n i f e s t   f o r   a   R e s o u r c e Q u o t a :   a p i V e r s i o n :   v 1   k i n d :   R e s o u r c e Q u o t a   m e t a d a t a :   n a m e :   p o d - d e m o   s p e c :   h a r d :   p o d s :   " 2 "   C r e a t e   t h e   R e s o u r c e Q u o t a :   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 / q u o t a - p o d . y a m l   - - n a m e s p a c e = q u o t a - p o d - 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   R e s o u r c e Q u o t a :   k u b e c t l   g e t   r e s o u r c e q u o t a   p o d - d e m o   - - n a m e s p a c e = q u o t a - p o d - 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   n a m e s p a c e   h a s   a   q u o t a   o f   t w o   P o d s ,   a n d   t h a t   c u r r e n t l y   t h e r e   a r e   n o   P o d s ;   t h a t   i s ,   n o n e   o f   t h e   q u o t a   i s   u s e d .   s p e c :   h a r d :   p o d s :   " 2 "   s t a t u s :   h a r d :   p o d s :   " 2 "   u s e d :   p o d s :   " 0 "   H e r e   i s   a n   e x a m p l e   m a n i f e s t   f o r   a   D e p l o y m e n t :   a p i V e r s i o n :   a p p s / v 1   k i n d :   D e p l o y m e n t   m e t a d a t a :   n a m e :   p o d - q u o t a - d e m o   s p e c :   s e l e c t o r :   m a t c h L a b e l s :   p u r p o s e :   q u o t a - d e m o   r e p l i c a s :   3   t e m p l a t e :   m e t a d a t a :   l a b e l s :   p u r p o s e :   q u o t a - d e m o   s p e c :   c o n t a i n e r s :   -   n a m e :   p o d - q u o t a - d e m o   i m a g e :   n g i n x   I n   t h a t   m a n i f e s t ,   r e p l i c a s :   3   t e l l s   K u b e r n e t e s   t o   a t t e m p t   t o   c r e a t e   t h r e e   n e w   P o d s ,   a l l   r u n n i n g   t h e   s a m e   a p p l i c a t i o n .   C r e a t e   t h e   D e p l o y m e n


Question: What is Choice of resource?

Answer: I n   t h i s   t a s k   y o u   h a v e   d e f i n e d   a   R e s o u r c e Q u o t a   t h a t   l i m i t e d   t h e   t o t a l   n u m b e r   o f   P o d s ,   b u t   y o u   c o u l d   a l s o   l i m i t   t h e   t o t a l   n u m b e r   o f   o t h e r   k i n d s   o f   o b j e c t .   F o r   e x a m p l e ,   y o u   m i g h t   d e c i d e   t o   l i m i t   h o w   m a n y   C r o n J o b s   t h a t   c a n   l i v e   i n   a   s i n g l e   n a m e s p a c e .


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   q u o t a - p o d - 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 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   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   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 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   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   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