Question: What is Generating Reference Pages for Kubernetes Components and Tools?

Answer: Generating Reference Pages for Kubernetes Components and ToolsThis page shows how to build the Kubernetes component and tool reference pages.Before you beginStart with the Prerequisites section in the Reference Documentation Quickstart guide.Follow the Reference Documentation Quickstart to generate the Kubernetes component and tool reference pages.What's nextGenerating Reference Documentation QuickstartGenerating Reference Documentation for kubectl CommandsGenerating Reference Documentation for the Kubernetes APIContributing to the Upstream Kubernetes Project for Documentation


Question: How does Generating Reference Pages for Kubernetes Components and Tools work?

Answer: Generating Reference Pages for Kubernetes Components and ToolsThis page shows how to build the Kubernetes component and tool reference pages.Before you beginStart with the Prerequisites section in the Reference Documentation Quickstart guide.Follow the Reference Documentation Quickstart to generate the Kubernetes component and tool reference pages.What's nextGenerating Reference Documentation QuickstartGenerating Reference Documentation for kubectl CommandsGenerating Reference Documentation for the Kubernetes APIContributing to the Upstream Kubernetes Project for Documentation


Question: When would you use Generating Reference Pages for Kubernetes Components and Tools?

Answer: Generating Reference Pages for Kubernetes Components and ToolsThis page shows how to build the Kubernetes component and tool reference pages.Before you beginStart with the Prerequisites section in the Reference Documentation Quickstart guide.Follow the Reference Documentation Quickstart to generate the Kubernetes component and tool reference pages.What's nextGenerating Reference Documentation QuickstartGenerating Reference Documentation for kubectl CommandsGenerating Reference Documentation for the Kubernetes APIContributing to the Upstream Kubernetes Project for Documentation


Question: What are the benefits of Generating Reference Pages for Kubernetes Components and Tools?

Answer: Generating Reference Pages for Kubernetes Components and ToolsThis page shows how to build the Kubernetes component and tool reference pages.Before you beginStart with the Prerequisites section in the Reference Documentation Quickstart guide.Follow the Reference Documentation Quickstart to generate the Kubernetes component and tool reference pages.What's nextGenerating Reference Documentation QuickstartGenerating Reference Documentation for kubectl CommandsGenerating Reference Documentation for the Kubernetes APIContributing to the Upstream Kubernetes Project for Documentation


Question: What is Generating Reference Pages for Kubernetes Components and Tools?

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


Question: What is Before you begin?

Answer: S t a r t   w i t h   t h e   P r e r e q u i s i t e s   s e c t i o n   i n   t h e   R e f e r e n c e   D o c u m e n t a t i o n   Q u i c k s t a r t   g u i d e .   F o l l o w   t h e   R e f e r e n c e   D o c u m e n t a t i o n   Q u i c k s t a r t   t o   g e n e r a t e   t h e   K u b e r n e t e s   c o m p o n e n t   a n d   t o o l   r e f e r e n c e   p a g e s .


Question: What is What's next?

Answer: G e n e r a t i n g   R e f e r e n c e   D o c u m e n t a t i o n   Q u i c k s t a r t G e n e r a t i n g   R e f e r e n c e   D o c u m e n t a t i o n   f o r   k u b e c t l   C o m m a n d s G e n e r a t i n g   R e f e r e n c e   D o c u m e n t a t i o n   f o r   t h e   K u b e r n e t e s   A P I C o n t r i b u t i n g   t o   t h e   U p s t r e a m   K u b e r n e t e s   P r o j e c t   f o r   D o c u m e n t a t i o n


Question: What is Limit Storage Consumption?

Answer: Limit Storage ConsumptionThis example demonstrates how to limit the amount of storage consumed in a namespace.The following resources are used in the demonstration: ResourceQuota, LimitRange, and PersistentVolumeClaim.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 KubernetesTo check the version, enter kubectl version.Scenario: Limiting Storage ConsumptionThe cluster-admin is operating a cluster on behalf of a user population and the admin wants to control how much storage a single namespace can consume in order to control cost.The admin would like to limit:The number of persistent volume claims in a namespaceThe amount of storage each claim can requestThe amount of cumulative storage the namespace can haveLimitRange to limit requests for storageAdding a LimitRange to a namespace enforces storage request sizes to a minimum and maximum. Storage is requested via PersistentVolumeClaim. The admission controller that enforces limit ranges will reject any PVC that is above or below the values set by the admin.In this example, a PVC requesting 10Gi of storage would be rejected because it exceeds the 2Gi max.apiVersion: v1 kind: LimitRange metadata: name: storagelimits spec: limits: - type: PersistentVolumeClaim max: storage: 2Gi min: storage: 1Gi Minimum storage requests are used when the underlying storage provider requires certain minimums. For example, AWS EBS volumes have a 1Gi minimum requirement.ResourceQuota to limit PVC count and cumulative storage capacityAdmins can limit the number of PVCs in a namespace as well as the cumulative capacity of those PVCs. New PVCs that exceed either maximum value will be rejected.In this example, a 6th PVC in the namespace would be rejected because it exceeds the maximum count of 5. Alternatively, a 5Gi maximum quota when combined with the 2Gi max limit above, cannot have 3 PVCs where each has 2Gi. That would be 6Gi requested for a namespace capped at 5Gi.apiVersion: v1 kind: ResourceQuota metadata: name: storagequota spec: hard: persistentvolumeclaims: "5" requests.storage: "5Gi" SummaryA limit range can put a ceiling on how much storage is requested while a resource quota can effectively cap the storage consumed by a namespace through claim counts and cumulative storage capacity. The allows a cluster-admin to plan their cluster's storage budget without risk of any one project going over their allotment.


Question: How does Limit Storage Consumption work?

Answer: Limit Storage ConsumptionThis example demonstrates how to limit the amount of storage consumed in a namespace.The following resources are used in the demonstration: ResourceQuota, LimitRange, and PersistentVolumeClaim.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 KubernetesTo check the version, enter kubectl version.Scenario: Limiting Storage ConsumptionThe cluster-admin is operating a cluster on behalf of a user population and the admin wants to control how much storage a single namespace can consume in order to control cost.The admin would like to limit:The number of persistent volume claims in a namespaceThe amount of storage each claim can requestThe amount of cumulative storage the namespace can haveLimitRange to limit requests for storageAdding a LimitRange to a namespace enforces storage request sizes to a minimum and maximum. Storage is requested via PersistentVolumeClaim. The admission controller that enforces limit ranges will reject any PVC that is above or below the values set by the admin.In this example, a PVC requesting 10Gi of storage would be rejected because it exceeds the 2Gi max.apiVersion: v1 kind: LimitRange metadata: name: storagelimits spec: limits: - type: PersistentVolumeClaim max: storage: 2Gi min: storage: 1Gi Minimum storage requests are used when the underlying storage provider requires certain minimums. For example, AWS EBS volumes have a 1Gi minimum requirement.ResourceQuota to limit PVC count and cumulative storage capacityAdmins can limit the number of PVCs in a namespace as well as the cumulative capacity of those PVCs. New PVCs that exceed either maximum value will be rejected.In this example, a 6th PVC in the namespace would be rejected because it exceeds the maximum count of 5. Alternatively, a 5Gi maximum quota when combined with the 2Gi max limit above, cannot have 3 PVCs where each has 2Gi. That would be 6Gi requested for a namespace capped at 5Gi.apiVersion: v1 kind: ResourceQuota metadata: name: storagequota spec: hard: persistentvolumeclaims: "5" requests.storage: "5Gi" SummaryA limit range can put a ceiling on how much storage is requested while a resource quota can effectively cap the storage consumed by a namespace through claim counts and cumulative storage capacity. The allows a cluster-admin to plan their cluster's storage budget without risk of any one project going over their allotment.


Question: When would you use Limit Storage Consumption?

Answer: Limit Storage ConsumptionThis example demonstrates how to limit the amount of storage consumed in a namespace.The following resources are used in the demonstration: ResourceQuota, LimitRange, and PersistentVolumeClaim.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 KubernetesTo check the version, enter kubectl version.Scenario: Limiting Storage ConsumptionThe cluster-admin is operating a cluster on behalf of a user population and the admin wants to control how much storage a single namespace can consume in order to control cost.The admin would like to limit:The number of persistent volume claims in a namespaceThe amount of storage each claim can requestThe amount of cumulative storage the namespace can haveLimitRange to limit requests for storageAdding a LimitRange to a namespace enforces storage request sizes to a minimum and maximum. Storage is requested via PersistentVolumeClaim. The admission controller that enforces limit ranges will reject any PVC that is above or below the values set by the admin.In this example, a PVC requesting 10Gi of storage would be rejected because it exceeds the 2Gi max.apiVersion: v1 kind: LimitRange metadata: name: storagelimits spec: limits: - type: PersistentVolumeClaim max: storage: 2Gi min: storage: 1Gi Minimum storage requests are used when the underlying storage provider requires certain minimums. For example, AWS EBS volumes have a 1Gi minimum requirement.ResourceQuota to limit PVC count and cumulative storage capacityAdmins can limit the number of PVCs in a namespace as well as the cumulative capacity of those PVCs. New PVCs that exceed either maximum value will be rejected.In this example, a 6th PVC in the namespace would be rejected because it exceeds the maximum count of 5. Alternatively, a 5Gi maximum quota when combined with the 2Gi max limit above, cannot have 3 PVCs where each has 2Gi. That would be 6Gi requested for a namespace capped at 5Gi.apiVersion: v1 kind: ResourceQuota metadata: name: storagequota spec: hard: persistentvolumeclaims: "5" requests.storage: "5Gi" SummaryA limit range can put a ceiling on how much storage is requested while a resource quota can effectively cap the storage consumed by a namespace through claim counts and cumulative storage capacity. The allows a cluster-admin to plan their cluster's storage budget without risk of any one project going over their allotment.


Question: What are the benefits of Limit Storage Consumption?

Answer: Limit Storage ConsumptionThis example demonstrates how to limit the amount of storage consumed in a namespace.The following resources are used in the demonstration: ResourceQuota, LimitRange, and PersistentVolumeClaim.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 KubernetesTo check the version, enter kubectl version.Scenario: Limiting Storage ConsumptionThe cluster-admin is operating a cluster on behalf of a user population and the admin wants to control how much storage a single namespace can consume in order to control cost.The admin would like to limit:The number of persistent volume claims in a namespaceThe amount of storage each claim can requestThe amount of cumulative storage the namespace can haveLimitRange to limit requests for storageAdding a LimitRange to a namespace enforces storage request sizes to a minimum and maximum. Storage is requested via PersistentVolumeClaim. The admission controller that enforces limit ranges will reject any PVC that is above or below the values set by the admin.In this example, a PVC requesting 10Gi of storage would be rejected because it exceeds the 2Gi max.apiVersion: v1 kind: LimitRange metadata: name: storagelimits spec: limits: - type: PersistentVolumeClaim max: storage: 2Gi min: storage: 1Gi Minimum storage requests are used when the underlying storage provider requires certain minimums. For example, AWS EBS volumes have a 1Gi minimum requirement.ResourceQuota to limit PVC count and cumulative storage capacityAdmins can limit the number of PVCs in a namespace as well as the cumulative capacity of those PVCs. New PVCs that exceed either maximum value will be rejected.In this example, a 6th PVC in the namespace would be rejected because it exceeds the maximum count of 5. Alternatively, a 5Gi maximum quota when combined with the 2Gi max limit above, cannot have 3 PVCs where each has 2Gi. That would be 6Gi requested for a namespace capped at 5Gi.apiVersion: v1 kind: ResourceQuota metadata: name: storagequota spec: hard: persistentvolumeclaims: "5" requests.storage: "5Gi" SummaryA limit range can put a ceiling on how much storage is requested while a resource quota can effectively cap the storage consumed by a namespace through claim counts and cumulative storage capacity. The allows a cluster-admin to plan their cluster's storage budget without risk of any one project going over their allotment.


Question: What is Limit Storage Consumption?

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


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 T o   c h e c k   t h e   v e r s i o n ,   e n t e r   k u b e c t l   v e r s i o n .   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   T o   c h e c k   t h e   v e r s i o n ,   e n t e r   k u b e c t l   v e r s i o n .


Question: What is Scenario: Limiting Storage Consumption?

Answer: T h e   c l u s t e r - a d m i n   i s   o p e r a t i n g   a   c l u s t e r   o n   b e h a l f   o f   a   u s e r   p o p u l a t i o n   a n d   t h e   a d m i n   w a n t s   t o   c o n t r o l   h o w   m u c h   s t o r a g e   a   s i n g l e   n a m e s p a c e   c a n   c o n s u m e   i n   o r d e r   t o   c o n t r o l   c o s t .   T h e   a d m i n   w o u l d   l i k e   t o   l i m i t :   T h e   n u m b e r   o f   p e r s i s t e n t   v o l u m e   c l a i m s   i n   a   n a m e s p a c e T h e   a m o u n t   o f   s t o r a g e   e a c h   c l a i m   c a n   r e q u e s t T h e   a m o u n t   o f   c u m u l a t i v e   s t o r a g e   t h e   n a m e s p a c e   c a n   h a v e


Question: What is LimitRange to limit requests for storage?

Answer: A d d i n g   a   L i m i t R a n g e   t o   a   n a m e s p a c e   e n f o r c e s   s t o r a g e   r e q u e s t   s i z e s   t o   a   m i n i m u m   a n d   m a x i m u m .   S t o r a g e   i s   r e q u e s t e d   v i a   P e r s i s t e n t V o l u m e C l a i m .   T h e   a d m i s s i o n   c o n t r o l l e r   t h a t   e n f o r c e s   l i m i t   r a n g e s   w i l l   r e j e c t   a n y   P V C   t h a t   i s   a b o v e   o r   b e l o w   t h e   v a l u e s   s e t   b y   t h e   a d m i n .   I n   t h i s   e x a m p l e ,   a   P V C   r e q u e s t i n g   1 0 G i   o f   s t o r a g e   w o u l d   b e   r e j e c t e d   b e c a u s e   i t   e x c e e d s   t h e   2 G i   m a x .   a p i V e r s i o n :   v 1   k i n d :   L i m i t R a n g e   m e t a d a t a :   n a m e :   s t o r a g e l i m i t s   s p e c :   l i m i t s :   -   t y p e :   P e r s i s t e n t V o l u m e C l a i m   m a x :   s t o r a g e :   2 G i   m i n :   s t o r a g e :   1 G i   M i n i m u m   s t o r a g e   r e q u e s t s   a r e   u s e d   w h e n   t h e   u n d e r l y i n g   s t o r a g e   p r o v i d e r   r e q u i r e s   c e r t a i n   m i n i m u m s .   F o r   e x a m p l e ,   A W S   E B S   v o l u m e s   h a v e   a   1 G i   m i n i m u m   r e q u i r e m e n t .


Question: What is ResourceQuota to limit PVC count and cumulative storage capacity?

Answer: A d m i n s   c a n   l i m i t   t h e   n u m b e r   o f   P V C s   i n   a   n a m e s p a c e   a s   w e l l   a s   t h e   c u m u l a t i v e   c a p a c i t y   o f   t h o s e   P V C s .   N e w   P V C s   t h a t   e x c e e d   e i t h e r   m a x i m u m   v a l u e   w i l l   b e   r e j e c t e d .   I n   t h i s   e x a m p l e ,   a   6 t h   P V C   i n   t h e   n a m e s p a c e   w o u l d   b e   r e j e c t e d   b e c a u s e   i t   e x c e e d s   t h e   m a x i m u m   c o u n t   o f   5 .   A l t e r n a t i v e l y ,   a   5 G i   m a x i m u m   q u o t a   w h e n   c o m b i n e d   w i t h   t h e   2 G i   m a x   l i m i t   a b o v e ,   c a n n o t   h a v e   3   P V C s   w h e r e   e a c h   h a s   2 G i .   T h a t   w o u l d   b e   6 G i   r e q u e s t e d   f o r   a   n a m e s p a c e   c a p p e d   a t   5 G i .   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 :   s t o r a g e q u o t a   s p e c :   h a r d :   p e r s i s t e n t v o l u m e c l a i m s :   " 5 "   r e q u e s t s . s t o r a g e :   " 5 G i "


Question: What is Summary?

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


Question: What is kubectl events?

Answer: kubectl eventsSynopsisDisplay events.Prints a table of the most important information about events. You can request events for a namespace, for all namespace, or filtered to only those pertaining to a specified resource.kubectl events [(-o|--output=)json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file] [--for TYPE/NAME] [--watch] [--types=Normal,Warning] Examples # List recent events in the default namespace kubectl events # List recent events in all namespaces kubectl events --all-namespaces # List recent events for the specified pod, then wait for more events and list them as they arrive kubectl events --for pod/web-pod-13je7 --watch # List recent events in YAML format kubectl events -oyaml # List recent only events of type 'Warning' or 'Normal' kubectl events --types=Warning,Normal Options-A, --all-namespacesIf present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.--allow-missing-template-keys Default: trueIf true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.--chunk-size int Default: 500Return large lists in chunks rather than all at once. Pass 0 to disable. This flag is beta and may change in the future.--for stringFilter events to only those pertaining to the specified resource.-h, --helphelp for events--no-headersWhen using the default output format, don't print headers.-o, --output stringOutput format. One of: (json, yaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file).--show-managed-fieldsIf true, keep the managedFields when printing objects in JSON or YAML format.--template stringTemplate string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].--types stringsOutput only events of given types.-w, --watchAfter listing the requested events, watch for more events.Parent Options Inherited--as stringUsername to impersonate for the operation. User could be a regular user or a service account in a namespace.--as-group stringsGroup to impersonate for the operation, this flag can be repeated to specify multiple groups.--as-uid stringUID to impersonate for the operation.--cache-dir string Default: "$HOME/.kube/cache"Default cache directory--certificate-authority stringPath to a cert file for the certificate authority--client-certificate stringPath to a client certificate file for TLS--client-key stringPath to a client key file for TLS--cluster stringThe name of the kubeconfig cluster to use--context stringThe name of the kubeconfig context to use--disable-compressionIf true, opt-out of response compression for all requests to the server--insecure-skip-tls-verifyIf true, the server's certificate will not be checked for validity. This will make your HTTPS con


Question: How does kubectl events work?

Answer: kubectl eventsSynopsisDisplay events.Prints a table of the most important information about events. You can request events for a namespace, for all namespace, or filtered to only those pertaining to a specified resource.kubectl events [(-o|--output=)json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file] [--for TYPE/NAME] [--watch] [--types=Normal,Warning] Examples # List recent events in the default namespace kubectl events # List recent events in all namespaces kubectl events --all-namespaces # List recent events for the specified pod, then wait for more events and list them as they arrive kubectl events --for pod/web-pod-13je7 --watch # List recent events in YAML format kubectl events -oyaml # List recent only events of type 'Warning' or 'Normal' kubectl events --types=Warning,Normal Options-A, --all-namespacesIf present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.--allow-missing-template-keys Default: trueIf true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.--chunk-size int Default: 500Return large lists in chunks rather than all at once. Pass 0 to disable. This flag is beta and may change in the future.--for stringFilter events to only those pertaining to the specified resource.-h, --helphelp for events--no-headersWhen using the default output format, don't print headers.-o, --output stringOutput format. One of: (json, yaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file).--show-managed-fieldsIf true, keep the managedFields when printing objects in JSON or YAML format.--template stringTemplate string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].--types stringsOutput only events of given types.-w, --watchAfter listing the requested events, watch for more events.Parent Options Inherited--as stringUsername to impersonate for the operation. User could be a regular user or a service account in a namespace.--as-group stringsGroup to impersonate for the operation, this flag can be repeated to specify multiple groups.--as-uid stringUID to impersonate for the operation.--cache-dir string Default: "$HOME/.kube/cache"Default cache directory--certificate-authority stringPath to a cert file for the certificate authority--client-certificate stringPath to a client certificate file for TLS--client-key stringPath to a client key file for TLS--cluster stringThe name of the kubeconfig cluster to use--context stringThe name of the kubeconfig context to use--disable-compressionIf true, opt-out of response compression for all requests to the server--insecure-skip-tls-verifyIf true, the server's certificate will not be checked for validity. This will make your HTTPS con


Question: When would you use kubectl events?

Answer: kubectl eventsSynopsisDisplay events.Prints a table of the most important information about events. You can request events for a namespace, for all namespace, or filtered to only those pertaining to a specified resource.kubectl events [(-o|--output=)json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file] [--for TYPE/NAME] [--watch] [--types=Normal,Warning] Examples # List recent events in the default namespace kubectl events # List recent events in all namespaces kubectl events --all-namespaces # List recent events for the specified pod, then wait for more events and list them as they arrive kubectl events --for pod/web-pod-13je7 --watch # List recent events in YAML format kubectl events -oyaml # List recent only events of type 'Warning' or 'Normal' kubectl events --types=Warning,Normal Options-A, --all-namespacesIf present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.--allow-missing-template-keys Default: trueIf true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.--chunk-size int Default: 500Return large lists in chunks rather than all at once. Pass 0 to disable. This flag is beta and may change in the future.--for stringFilter events to only those pertaining to the specified resource.-h, --helphelp for events--no-headersWhen using the default output format, don't print headers.-o, --output stringOutput format. One of: (json, yaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file).--show-managed-fieldsIf true, keep the managedFields when printing objects in JSON or YAML format.--template stringTemplate string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].--types stringsOutput only events of given types.-w, --watchAfter listing the requested events, watch for more events.Parent Options Inherited--as stringUsername to impersonate for the operation. User could be a regular user or a service account in a namespace.--as-group stringsGroup to impersonate for the operation, this flag can be repeated to specify multiple groups.--as-uid stringUID to impersonate for the operation.--cache-dir string Default: "$HOME/.kube/cache"Default cache directory--certificate-authority stringPath to a cert file for the certificate authority--client-certificate stringPath to a client certificate file for TLS--client-key stringPath to a client key file for TLS--cluster stringThe name of the kubeconfig cluster to use--context stringThe name of the kubeconfig context to use--disable-compressionIf true, opt-out of response compression for all requests to the server--insecure-skip-tls-verifyIf true, the server's certificate will not be checked for validity. This will make your HTTPS con


Question: What are the benefits of kubectl events?

Answer: kubectl eventsSynopsisDisplay events.Prints a table of the most important information about events. You can request events for a namespace, for all namespace, or filtered to only those pertaining to a specified resource.kubectl events [(-o|--output=)json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file] [--for TYPE/NAME] [--watch] [--types=Normal,Warning] Examples # List recent events in the default namespace kubectl events # List recent events in all namespaces kubectl events --all-namespaces # List recent events for the specified pod, then wait for more events and list them as they arrive kubectl events --for pod/web-pod-13je7 --watch # List recent events in YAML format kubectl events -oyaml # List recent only events of type 'Warning' or 'Normal' kubectl events --types=Warning,Normal Options-A, --all-namespacesIf present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.--allow-missing-template-keys Default: trueIf true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.--chunk-size int Default: 500Return large lists in chunks rather than all at once. Pass 0 to disable. This flag is beta and may change in the future.--for stringFilter events to only those pertaining to the specified resource.-h, --helphelp for events--no-headersWhen using the default output format, don't print headers.-o, --output stringOutput format. One of: (json, yaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file).--show-managed-fieldsIf true, keep the managedFields when printing objects in JSON or YAML format.--template stringTemplate string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].--types stringsOutput only events of given types.-w, --watchAfter listing the requested events, watch for more events.Parent Options Inherited--as stringUsername to impersonate for the operation. User could be a regular user or a service account in a namespace.--as-group stringsGroup to impersonate for the operation, this flag can be repeated to specify multiple groups.--as-uid stringUID to impersonate for the operation.--cache-dir string Default: "$HOME/.kube/cache"Default cache directory--certificate-authority stringPath to a cert file for the certificate authority--client-certificate stringPath to a client certificate file for TLS--client-key stringPath to a client key file for TLS--cluster stringThe name of the kubeconfig cluster to use--context stringThe name of the kubeconfig context to use--disable-compressionIf true, opt-out of response compression for all requests to the server--insecure-skip-tls-verifyIf true, the server's certificate will not be checked for validity. This will make your HTTPS con


Question: What is Synopsis?

Answer: D i s p l a y   e v e n t s .   P r i n t s   a   t a b l e   o f   t h e   m o s t   i m p o r t a n t   i n f o r m a t i o n   a b o u t   e v e n t s .   Y o u   c a n   r e q u e s t   e v e n t s   f o r   a   n a m e s p a c e ,   f o r   a l l   n a m e s p a c e ,   o r   f i l t e r e d   t o   o n l y   t h o s e   p e r t a i n i n g   t o   a   s p e c i f i e d   r e s o u r c e .   k u b e c t l   e v e n t s   [ ( - o | - - o u t p u t = ) j s o n | y a m l | n a m e | g o - t e m p l a t e | g o - t e m p l a t e - f i l e | t e m p l a t e | t e m p l a t e f i l e | j s o n p a t h | j s o n p a t h - a s - j s o n | j s o n p a t h - f i l e ]   [ - - f o r   T Y P E / N A M E ]   [ - - w a t c h ]   [ - - t y p e s = N o r m a l , W a r n i n g ]


Question: What is Examples?

Answer: #   L i s t   r e c e n t   e v e n t s   i n   t h e   d e f a u l t   n a m e s p a c e   k u b e c t l   e v e n t s   #   L i s t   r e c e n t   e v e n t s   i n   a l l   n a m e s p a c e s   k u b e c t l   e v e n t s   - - a l l - n a m e s p a c e s   #   L i s t   r e c e n t   e v e n t s   f o r   t h e   s p e c i f i e d   p o d ,   t h e n   w a i t   f o r   m o r e   e v e n t s   a n d   l i s t   t h e m   a s   t h e y   a r r i v e   k u b e c t l   e v e n t s   - - f o r   p o d / w e b - p o d - 1 3 j e 7   - - w a t c h   #   L i s t   r e c e n t   e v e n t s   i n   Y A M L   f o r m a t   k u b e c t l   e v e n t s   - o y a m l   #   L i s t   r e c e n t   o n l y   e v e n t s   o f   t y p e   ' W a r n i n g '   o r   ' N o r m a l '   k u b e c t l   e v e n t s   - - t y p e s = W a r n i n g , N o r m a l


Question: What is Options?

Answer: I f   p r e s e n t ,   l i s t   t h e   r e q u e s t e d   o b j e c t ( s )   a c r o s s   a l l   n a m e s p a c e s .   N a m e s p a c e   i n   c u r r e n t   c o n t e x t   i s   i g n o r e d   e v e n   i f   s p e c i f i e d   w i t h   - - n a m e s p a c e .   I f   t r u e ,   i g n o r e   a n y   e r r o r s   i n   t e m p l a t e s   w h e n   a   f i e l d   o r   m a p   k e y   i s   m i s s i n g   i n   t h e   t e m p l a t e .   O n l y   a p p l i e s   t o   g o l a n g   a n d   j s o n p a t h   o u t p u t   f o r m a t s .   R e t u r n   l a r g e   l i s t s   i n   c h u n k s   r a t h e r   t h a n   a l l   a t   o n c e .   P a s s   0   t o   d i s a b l e .   T h i s   f l a g   i s   b e t a   a n d   m a y   c h a n g e   i n   t h e   f u t u r e .   F i l t e r   e v e n t s   t o   o n l y   t h o s e   p e r t a i n i n g   t o   t h e   s p e c i f i e d   r e s o u r c e .   h e l p   f o r   e v e n t s   W h e n   u s i n g   t h e   d e f a u l t   o u t p u t   f o r m a t ,   d o n ' t   p r i n t   h e a d e r s .   O u t p u t   f o r m a t .   O n e   o f :   ( j s o n ,   y a m l ,   n a m e ,   g o - t e m p l a t e ,   g o - t e m p l a t e - f i l e ,   t e m p l a t e ,   t e m p l a t e f i l e ,   j s o n p a t h ,   j s o n p a t h - a s - j s o n ,   j s o n p a t h - f i l e ) .   I f   t r u e ,   k e e p   t h e   m a n a g e d F i e l d s   w h e n   p r i n t i n g   o b j e c t s   i n   J S O N   o r   Y A M L   f o r m a t .   T e m p l a t e   s t r i n g   o r   p a t h   t o   t e m p l a t e   f i l e   t o   u s e   w h e n   - o = g o - t e m p l a t e ,   - o = g o - t e m p l a t e - f i l e .   T h e   t e m p l a t e   f o r m a t   i s   g o l a n g   t e m p l a t e s   [ h t t p : / / g o l a n g . o r g / p k g / t e x t / t e m p l a t e / # p k g - o v e r v i e w ] .   O u t p u t   o n l y   e v e n t s   o f   g i v e n   t y p e s .   A f t e r   l i s t i n g   t h e


Question: What is Parent Options Inherited?

Answer: U s e r n a m e   t o   i m p e r s o n a t e   f o r   t h e   o p e r a t i o n .   U s e r   c o u l d   b e   a   r e g u l a r   u s e r   o r   a   s e r v i c e   a c c o u n t   i n   a   n a m e s p a c e .   G r o u p   t o   i m p e r s o n a t e   f o r   t h e   o p e r a t i o n ,   t h i s   f l a g   c a n   b e   r e p e a t e d   t o   s p e c i f y   m u l t i p l e   g r o u p s .   U I D   t o   i m p e r s o n a t e   f o r   t h e   o p e r a t i o n .   D e f a u l t   c a c h e   d i r e c t o r y   P a t h   t o   a   c e r t   f i l e   f o r   t h e   c e r t i f i c a t e   a u t h o r i t y   P a t h   t o   a   c l i e n t   c e r t i f i c a t e   f i l e   f o r   T L S   P a t h   t o   a   c l i e n t   k e y   f i l e   f o r   T L S   T h e   n a m e   o f   t h e   k u b e c o n f i g   c l u s t e r   t o   u s e   T h e   n a m e   o f   t h e   k u b e c o n f i g   c o n t e x t   t o   u s e   I f   t r u e ,   o p t - o u t   o f   r e s p o n s e   c o m p r e s s i o n   f o r   a l l   r e q u e s t s   t o   t h e   s e r v e r   I f   t r u e ,   t h e   s e r v e r ' s   c e r t i f i c a t e   w i l l   n o t   b e   c h e c k e d   f o r   v a l i d i t y .   T h i s   w i l l   m a k e   y o u r   H T T P S   c o n n e c t i o n s   i n s e c u r e   P a t h   t o   t h e   k u b e c o n f i g   f i l e   t o   u s e   f o r   C L I   r e q u e s t s .   P a t h   t o   t h e   k u b e r c   f i l e   t o   u s e   f o r   p r e f e r e n c e s .   T h i s   c a n   b e   d i s a b l e d   b y   e x p o r t i n g   K U B E C T L _ K U B E R C = f a l s e   f e a t u r e   g a t e   o r   t u r n i n g   o f f   t h e   f e a t u r e   K U B E R C = o f f .   R e q u i r e   s e r v e r   v e r s i o n   t o   m a t c h   c l i e n t   v e r s i o n   I f   p r e s e n t ,   t h e   n a m e s p a c e   s c o p e   f o r   t h i s   C L I   r e q u e s t   P a s s w o r d   f o r   b a s i c   a u t h e n t i c a t


Question: What is See Also?

Answer: k u b e c t l   -   k u b e c t l   c o n t r o l s   t h e   K u b e r n e t e s   c l u s t e r   m a n a g e r   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 Find Out What Container Runtime is Used on a Node?

Answer: Find Out What Container Runtime is Used on a NodeThis page outlines steps to find out what container runtime the nodes in your cluster use.Depending on the way you run your cluster, the container runtime for the nodes may have been pre-configured or you need to configure it. If you're using a managed Kubernetes service, there might be vendor-specific ways to check what container runtime is configured for the nodes. The method described on this page should work whenever the execution of kubectl is allowed.Before you beginInstall and configure kubectl. See Install Tools section for details.Find out the container runtime used on a NodeUse kubectl to fetch and show node information:kubectl get nodes -o wide The output is similar to the following. The column CONTAINER-RUNTIME outputs the runtime and its version.For Docker Engine, the output is similar to this:NAME STATUS VERSION CONTAINER-RUNTIME node-1 Ready v1.16.15 docker://19.3.1 node-2 Ready v1.16.15 docker://19.3.1 node-3 Ready v1.16.15 docker://19.3.1 If your runtime shows as Docker Engine, you still might not be affected by the removal of dockershim in Kubernetes v1.24. Check the runtime endpoint to see if you use dockershim. If you don't use dockershim, you aren't affected.For containerd, the output is similar to this:NAME STATUS VERSION CONTAINER-RUNTIME node-1 Ready v1.19.6 containerd://1.4.1 node-2 Ready v1.19.6 containerd://1.4.1 node-3 Ready v1.19.6 containerd://1.4.1 Find out more information about container runtimes on Container Runtimes page.Find out what container runtime endpoint you useThe container runtime talks to the kubelet over a Unix socket using the CRI protocol, which is based on the gRPC framework. The kubelet acts as a client, and the runtime acts as the server. In some cases, you might find it useful to know which socket your nodes use. For example, with the removal of dockershim in Kubernetes v1.24 and later, you might want to know whether you use Docker Engine with dockershim.Note:If you currently use Docker Engine in your nodes with cri-dockerd, you aren't affected by the dockershim removal.You can check which socket you use by checking the kubelet configuration on your nodes.Read the starting commands for the kubelet process:tr \\0 ' ' < /proc/"$(pgrep kubelet)"/cmdline If you don't have tr or pgrep, check the command line for the kubelet process manually.In the output, look for the --container-runtime flag and the --container-runtime-endpoint flag.If your nodes use Kubernetes v1.23 and earlier and these flags aren't present or if the --container-runtime flag is not remote, you use the dockershim socket with Docker Engine. The --container-runtime command line argument is not available in Kubernetes v1.27 and later.If the --container-runtime-endpoint flag is present, check the socket name to find out which runtime you use. For example, unix:///run/containerd/containerd.sock is the containerd endpoint.If you want to change the Container Runtime on a Node from Docker En


Question: How does Find Out What Container Runtime is Used on a Node work?

Answer: Find Out What Container Runtime is Used on a NodeThis page outlines steps to find out what container runtime the nodes in your cluster use.Depending on the way you run your cluster, the container runtime for the nodes may have been pre-configured or you need to configure it. If you're using a managed Kubernetes service, there might be vendor-specific ways to check what container runtime is configured for the nodes. The method described on this page should work whenever the execution of kubectl is allowed.Before you beginInstall and configure kubectl. See Install Tools section for details.Find out the container runtime used on a NodeUse kubectl to fetch and show node information:kubectl get nodes -o wide The output is similar to the following. The column CONTAINER-RUNTIME outputs the runtime and its version.For Docker Engine, the output is similar to this:NAME STATUS VERSION CONTAINER-RUNTIME node-1 Ready v1.16.15 docker://19.3.1 node-2 Ready v1.16.15 docker://19.3.1 node-3 Ready v1.16.15 docker://19.3.1 If your runtime shows as Docker Engine, you still might not be affected by the removal of dockershim in Kubernetes v1.24. Check the runtime endpoint to see if you use dockershim. If you don't use dockershim, you aren't affected.For containerd, the output is similar to this:NAME STATUS VERSION CONTAINER-RUNTIME node-1 Ready v1.19.6 containerd://1.4.1 node-2 Ready v1.19.6 containerd://1.4.1 node-3 Ready v1.19.6 containerd://1.4.1 Find out more information about container runtimes on Container Runtimes page.Find out what container runtime endpoint you useThe container runtime talks to the kubelet over a Unix socket using the CRI protocol, which is based on the gRPC framework. The kubelet acts as a client, and the runtime acts as the server. In some cases, you might find it useful to know which socket your nodes use. For example, with the removal of dockershim in Kubernetes v1.24 and later, you might want to know whether you use Docker Engine with dockershim.Note:If you currently use Docker Engine in your nodes with cri-dockerd, you aren't affected by the dockershim removal.You can check which socket you use by checking the kubelet configuration on your nodes.Read the starting commands for the kubelet process:tr \\0 ' ' < /proc/"$(pgrep kubelet)"/cmdline If you don't have tr or pgrep, check the command line for the kubelet process manually.In the output, look for the --container-runtime flag and the --container-runtime-endpoint flag.If your nodes use Kubernetes v1.23 and earlier and these flags aren't present or if the --container-runtime flag is not remote, you use the dockershim socket with Docker Engine. The --container-runtime command line argument is not available in Kubernetes v1.27 and later.If the --container-runtime-endpoint flag is present, check the socket name to find out which runtime you use. For example, unix:///run/containerd/containerd.sock is the containerd endpoint.If you want to change the Container Runtime on a Node from Docker En


Question: When would you use Find Out What Container Runtime is Used on a Node?

Answer: Find Out What Container Runtime is Used on a NodeThis page outlines steps to find out what container runtime the nodes in your cluster use.Depending on the way you run your cluster, the container runtime for the nodes may have been pre-configured or you need to configure it. If you're using a managed Kubernetes service, there might be vendor-specific ways to check what container runtime is configured for the nodes. The method described on this page should work whenever the execution of kubectl is allowed.Before you beginInstall and configure kubectl. See Install Tools section for details.Find out the container runtime used on a NodeUse kubectl to fetch and show node information:kubectl get nodes -o wide The output is similar to the following. The column CONTAINER-RUNTIME outputs the runtime and its version.For Docker Engine, the output is similar to this:NAME STATUS VERSION CONTAINER-RUNTIME node-1 Ready v1.16.15 docker://19.3.1 node-2 Ready v1.16.15 docker://19.3.1 node-3 Ready v1.16.15 docker://19.3.1 If your runtime shows as Docker Engine, you still might not be affected by the removal of dockershim in Kubernetes v1.24. Check the runtime endpoint to see if you use dockershim. If you don't use dockershim, you aren't affected.For containerd, the output is similar to this:NAME STATUS VERSION CONTAINER-RUNTIME node-1 Ready v1.19.6 containerd://1.4.1 node-2 Ready v1.19.6 containerd://1.4.1 node-3 Ready v1.19.6 containerd://1.4.1 Find out more information about container runtimes on Container Runtimes page.Find out what container runtime endpoint you useThe container runtime talks to the kubelet over a Unix socket using the CRI protocol, which is based on the gRPC framework. The kubelet acts as a client, and the runtime acts as the server. In some cases, you might find it useful to know which socket your nodes use. For example, with the removal of dockershim in Kubernetes v1.24 and later, you might want to know whether you use Docker Engine with dockershim.Note:If you currently use Docker Engine in your nodes with cri-dockerd, you aren't affected by the dockershim removal.You can check which socket you use by checking the kubelet configuration on your nodes.Read the starting commands for the kubelet process:tr \\0 ' ' < /proc/"$(pgrep kubelet)"/cmdline If you don't have tr or pgrep, check the command line for the kubelet process manually.In the output, look for the --container-runtime flag and the --container-runtime-endpoint flag.If your nodes use Kubernetes v1.23 and earlier and these flags aren't present or if the --container-runtime flag is not remote, you use the dockershim socket with Docker Engine. The --container-runtime command line argument is not available in Kubernetes v1.27 and later.If the --container-runtime-endpoint flag is present, check the socket name to find out which runtime you use. For example, unix:///run/containerd/containerd.sock is the containerd endpoint.If you want to change the Container Runtime on a Node from Docker En


Question: What are the benefits of Find Out What Container Runtime is Used on a Node?

Answer: Find Out What Container Runtime is Used on a NodeThis page outlines steps to find out what container runtime the nodes in your cluster use.Depending on the way you run your cluster, the container runtime for the nodes may have been pre-configured or you need to configure it. If you're using a managed Kubernetes service, there might be vendor-specific ways to check what container runtime is configured for the nodes. The method described on this page should work whenever the execution of kubectl is allowed.Before you beginInstall and configure kubectl. See Install Tools section for details.Find out the container runtime used on a NodeUse kubectl to fetch and show node information:kubectl get nodes -o wide The output is similar to the following. The column CONTAINER-RUNTIME outputs the runtime and its version.For Docker Engine, the output is similar to this:NAME STATUS VERSION CONTAINER-RUNTIME node-1 Ready v1.16.15 docker://19.3.1 node-2 Ready v1.16.15 docker://19.3.1 node-3 Ready v1.16.15 docker://19.3.1 If your runtime shows as Docker Engine, you still might not be affected by the removal of dockershim in Kubernetes v1.24. Check the runtime endpoint to see if you use dockershim. If you don't use dockershim, you aren't affected.For containerd, the output is similar to this:NAME STATUS VERSION CONTAINER-RUNTIME node-1 Ready v1.19.6 containerd://1.4.1 node-2 Ready v1.19.6 containerd://1.4.1 node-3 Ready v1.19.6 containerd://1.4.1 Find out more information about container runtimes on Container Runtimes page.Find out what container runtime endpoint you useThe container runtime talks to the kubelet over a Unix socket using the CRI protocol, which is based on the gRPC framework. The kubelet acts as a client, and the runtime acts as the server. In some cases, you might find it useful to know which socket your nodes use. For example, with the removal of dockershim in Kubernetes v1.24 and later, you might want to know whether you use Docker Engine with dockershim.Note:If you currently use Docker Engine in your nodes with cri-dockerd, you aren't affected by the dockershim removal.You can check which socket you use by checking the kubelet configuration on your nodes.Read the starting commands for the kubelet process:tr \\0 ' ' < /proc/"$(pgrep kubelet)"/cmdline If you don't have tr or pgrep, check the command line for the kubelet process manually.In the output, look for the --container-runtime flag and the --container-runtime-endpoint flag.If your nodes use Kubernetes v1.23 and earlier and these flags aren't present or if the --container-runtime flag is not remote, you use the dockershim socket with Docker Engine. The --container-runtime command line argument is not available in Kubernetes v1.27 and later.If the --container-runtime-endpoint flag is present, check the socket name to find out which runtime you use. For example, unix:///run/containerd/containerd.sock is the containerd endpoint.If you want to change the Container Runtime on a Node from Docker En


Question: What is Find Out What Container Runtime is Used on a Node?

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


Question: What is Before you begin?

Answer: I n s t a l l   a n d   c o n f i g u r e   k u b e c t l .   S e e   I n s t a l l   T o o l s   s e c t i o n   f o r   d e t a i l s .


Question: What is Find out the container runtime used on a Node?

Answer: U s e   k u b e c t l   t o   f e t c h   a n d   s h o w   n o d e   i n f o r m a t i o n :   k u b e c t l   g e t   n o d e s   - o   w i d e   T h e   o u t p u t   i s   s i m i l a r   t o   t h e   f o l l o w i n g .   T h e   c o l u m n   C O N T A I N E R - R U N T I M E   o u t p u t s   t h e   r u n t i m e   a n d   i t s   v e r s i o n .   F o r   D o c k e r   E n g i n 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 :   N A M E   S T A T U S   V E R S I O N   C O N T A I N E R - R U N T I M E   n o d e - 1   R e a d y   v 1 . 1 6 . 1 5   d o c k e r : / / 1 9 . 3 . 1   n o d e - 2   R e a d y   v 1 . 1 6 . 1 5   d o c k e r : / / 1 9 . 3 . 1   n o d e - 3   R e a d y   v 1 . 1 6 . 1 5   d o c k e r : / / 1 9 . 3 . 1   I f   y o u r   r u n t i m e   s h o w s   a s   D o c k e r   E n g i n e ,   y o u   s t i l l   m i g h t   n o t   b e   a f f e c t e d   b y   t h e   r e m o v a l   o f   d o c k e r s h i m   i n   K u b e r n e t e s   v 1 . 2 4 .   C h e c k   t h e   r u n t i m e   e n d p o i n t   t o   s e e   i f   y o u   u s e   d o c k e r s h i m .   I f   y o u   d o n ' t   u s e   d o c k e r s h i m ,   y o u   a r e n ' t   a f f e c t e d .   F o r   c o n t a i n e r d ,   t h e   o u t p u t   i s   s i m i l a r   t o   t h i s :   N A M E   S T A T U S   V E R S I O N   C O N T A I N E R - R U N T I M E   n o d e - 1   R e a d y   v 1 . 1 9 . 6   c o n t a i n e r d : / / 1 . 4 . 1   n o d e - 2   R e a d y   v 1 . 1 9 . 6   c o n t a i n e r d : / / 1 . 4 . 1   n o d e - 3   R e a d y   v 1 . 1 9 . 6   c o n t a i n e r d : / / 1 . 4 . 1   F i n d   o u t   m o r e   i n f o r m a t i o n   a b o u t   c o n t a i n e r   r u n t i m e s   o n   C o n t a i n e r   R u n t i m e s   p a g e .


Question: What is Find out what container runtime endpoint you use?

Answer: T h e   c o n t a i n e r   r u n t i m e   t a l k s   t o   t h e   k u b e l e t   o v e r   a   U n i x   s o c k e t   u s i n g   t h e   C R I   p r o t o c o l ,   w h i c h   i s   b a s e d   o n   t h e   g R P C   f r a m e w o r k .   T h e   k u b e l e t   a c t s   a s   a   c l i e n t ,   a n d   t h e   r u n t i m e   a c t s   a s   t h e   s e r v e r .   I n   s o m e   c a s e s ,   y o u   m i g h t   f i n d   i t   u s e f u l   t o   k n o w   w h i c h   s o c k e t   y o u r   n o d e s   u s e .   F o r   e x a m p l e ,   w i t h   t h e   r e m o v a l   o f   d o c k e r s h i m   i n   K u b e r n e t e s   v 1 . 2 4   a n d   l a t e r ,   y o u   m i g h t   w a n t   t o   k n o w   w h e t h e r   y o u   u s e   D o c k e r   E n g i n e   w i t h   d o c k e r s h i m .


Question: What is Note:?

Answer: Y o u   c a n   c h e c k   w h i c h   s o c k e t   y o u   u s e   b y   c h e c k i n g   t h e   k u b e l e t   c o n f i g u r a t i o n   o n   y o u r   n o d e s .   R e a d   t h e   s t a r t i n g   c o m m a n d s   f o r   t h e   k u b e l e t   p r o c e s s : t r   \ \ 0   '   '   <   / p r o c / " $ ( p g r e p   k u b e l e t ) " / c m d l i n e   I f   y o u   d o n ' t   h a v e   t r   o r   p g r e p ,   c h e c k   t h e   c o m m a n d   l i n e   f o r   t h e   k u b e l e t   p r o c e s s   m a n u a l l y . I n   t h e   o u t p u t ,   l o o k   f o r   t h e   - - c o n t a i n e r - r u n t i m e   f l a g   a n d   t h e   - - c o n t a i n e r - r u n t i m e - e n d p o i n t   f l a g . I f   y o u r   n o d e s   u s e   K u b e r n e t e s   v 1 . 2 3   a n d   e a r l i e r   a n d   t h e s e   f l a g s   a r e n ' t   p r e s e n t   o r   i f   t h e   - - c o n t a i n e r - r u n t i m e   f l a g   i s   n o t   r e m o t e ,   y o u   u s e   t h e   d o c k e r s h i m   s o c k e t   w i t h   D o c k e r   E n g i n e .   T h e   - - c o n t a i n e r - r u n t i m e   c o m m a n d   l i n e   a r g u m e n t   i s   n o t   a v a i l a b l e   i n   K u b e r n e t e s   v 1 . 2 7   a n d   l a t e r . I f   t h e   - - c o n t a i n e r - r u n t i m e - e n d p o i n t   f l a g   i s   p r e s e n t ,   c h e c k   t h e   s o c k e t   n a m e   t o   f i n d   o u t   w h i c h   r u n t i m e   y o u   u s e .   F o r   e x a m p l e ,   u n i x : / / / r u n / c o n t a i n e r d / c o n t a i n e r d . s o c k   i s   t h e   c o n t a i n e r d   e n d p o i n t .   R e a d   t h e   s t a r t i n g   c o m m a n d s   f o r   t h e   k u b e l e t   p r o c e s s :   t r   \ \ 0   '   '   <   / p r o c / " $ ( p g r e p   k u b e l e t ) " / c m d l i n e   I f   y o u   d o n ' t   h a v e   t r   o r   p g r e p ,   c h e c k   t h e   c o m m a n d   l i n e   f o r   t h e   k u b e l e t   p r o c


Question: What is Service ClusterIP allocation?

Answer: Service ClusterIP allocationIn Kubernetes, Services are an abstract way to expose an application running on a set of Pods. Services can have a cluster-scoped virtual IP address (using a Service of type: ClusterIP). Clients can connect using that virtual IP address, and Kubernetes then load-balances traffic to that Service across the different backing Pods.How Service ClusterIPs are allocated?When Kubernetes needs to assign a virtual IP address for a Service, that assignment happens one of two ways:dynamicallythe cluster's control plane automatically picks a free IP address from within the configured IP range for type: ClusterIP Services.staticallyyou specify an IP address of your choice, from within the configured IP range for Services.Across your whole cluster, every Service ClusterIP must be unique. Trying to create a Service with a specific ClusterIP that has already been allocated will return an error.Why do you need to reserve Service Cluster IPs?Sometimes you may want to have Services running in well-known IP addresses, so other components and users in the cluster can use them.The best example is the DNS Service for the cluster. As a soft convention, some Kubernetes installers assign the 10th IP address from the Service IP range to the DNS service. Assuming you configured your cluster with Service IP range 10.96.0.0/16 and you want your DNS Service IP to be 10.96.0.10, you'd have to create a Service like this:apiVersion: v1 kind: Service metadata: labels: k8s-app: kube-dns kubernetes.io/cluster-service: "true" kubernetes.io/name: CoreDNS name: kube-dns namespace: kube-system spec: clusterIP: 10.96.0.10 ports: - name: dns port: 53 protocol: UDP targetPort: 53 - name: dns-tcp port: 53 protocol: TCP targetPort: 53 selector: k8s-app: kube-dns type: ClusterIP But, as it was explained before, the IP address 10.96.0.10 has not been reserved. If other Services are created before or in parallel with dynamic allocation, there is a chance they can allocate this IP. Hence, you will not be able to create the DNS Service because it will fail with a conflict error.How can you avoid Service ClusterIP conflicts?The allocation strategy implemented in Kubernetes to allocate ClusterIPs to Services reduces the risk of collision.The ClusterIP range is divided, based on the formula min(max(16, cidrSize / 16), 256), described as never less than 16 or more than 256 with a graduated step between them.Dynamic IP assignment uses the upper band by default, once this has been exhausted it will use the lower range. This will allow users to use static allocations on the lower band with a low risk of collision.ExamplesExample 1This example uses the IP address range: 10.96.0.0/24 (CIDR notation) for the IP addresses of Services.Range Size: 28 - 2 = 254Band Offset: min(max(16, 256/16), 256) = min(16, 256) = 16Static band start: 10.96.0.1Static band end: 10.96.0.16Range end: 10.96.0.254pie showData title 10.96.0.0/24 "Static" : 16 "Dynamic" : 238JavaScript must be enabled to


Question: How does Service ClusterIP allocation work?

Answer: Service ClusterIP allocationIn Kubernetes, Services are an abstract way to expose an application running on a set of Pods. Services can have a cluster-scoped virtual IP address (using a Service of type: ClusterIP). Clients can connect using that virtual IP address, and Kubernetes then load-balances traffic to that Service across the different backing Pods.How Service ClusterIPs are allocated?When Kubernetes needs to assign a virtual IP address for a Service, that assignment happens one of two ways:dynamicallythe cluster's control plane automatically picks a free IP address from within the configured IP range for type: ClusterIP Services.staticallyyou specify an IP address of your choice, from within the configured IP range for Services.Across your whole cluster, every Service ClusterIP must be unique. Trying to create a Service with a specific ClusterIP that has already been allocated will return an error.Why do you need to reserve Service Cluster IPs?Sometimes you may want to have Services running in well-known IP addresses, so other components and users in the cluster can use them.The best example is the DNS Service for the cluster. As a soft convention, some Kubernetes installers assign the 10th IP address from the Service IP range to the DNS service. Assuming you configured your cluster with Service IP range 10.96.0.0/16 and you want your DNS Service IP to be 10.96.0.10, you'd have to create a Service like this:apiVersion: v1 kind: Service metadata: labels: k8s-app: kube-dns kubernetes.io/cluster-service: "true" kubernetes.io/name: CoreDNS name: kube-dns namespace: kube-system spec: clusterIP: 10.96.0.10 ports: - name: dns port: 53 protocol: UDP targetPort: 53 - name: dns-tcp port: 53 protocol: TCP targetPort: 53 selector: k8s-app: kube-dns type: ClusterIP But, as it was explained before, the IP address 10.96.0.10 has not been reserved. If other Services are created before or in parallel with dynamic allocation, there is a chance they can allocate this IP. Hence, you will not be able to create the DNS Service because it will fail with a conflict error.How can you avoid Service ClusterIP conflicts?The allocation strategy implemented in Kubernetes to allocate ClusterIPs to Services reduces the risk of collision.The ClusterIP range is divided, based on the formula min(max(16, cidrSize / 16), 256), described as never less than 16 or more than 256 with a graduated step between them.Dynamic IP assignment uses the upper band by default, once this has been exhausted it will use the lower range. This will allow users to use static allocations on the lower band with a low risk of collision.ExamplesExample 1This example uses the IP address range: 10.96.0.0/24 (CIDR notation) for the IP addresses of Services.Range Size: 28 - 2 = 254Band Offset: min(max(16, 256/16), 256) = min(16, 256) = 16Static band start: 10.96.0.1Static band end: 10.96.0.16Range end: 10.96.0.254pie showData title 10.96.0.0/24 "Static" : 16 "Dynamic" : 238JavaScript must be enabled to


Question: When would you use Service ClusterIP allocation?

Answer: Service ClusterIP allocationIn Kubernetes, Services are an abstract way to expose an application running on a set of Pods. Services can have a cluster-scoped virtual IP address (using a Service of type: ClusterIP). Clients can connect using that virtual IP address, and Kubernetes then load-balances traffic to that Service across the different backing Pods.How Service ClusterIPs are allocated?When Kubernetes needs to assign a virtual IP address for a Service, that assignment happens one of two ways:dynamicallythe cluster's control plane automatically picks a free IP address from within the configured IP range for type: ClusterIP Services.staticallyyou specify an IP address of your choice, from within the configured IP range for Services.Across your whole cluster, every Service ClusterIP must be unique. Trying to create a Service with a specific ClusterIP that has already been allocated will return an error.Why do you need to reserve Service Cluster IPs?Sometimes you may want to have Services running in well-known IP addresses, so other components and users in the cluster can use them.The best example is the DNS Service for the cluster. As a soft convention, some Kubernetes installers assign the 10th IP address from the Service IP range to the DNS service. Assuming you configured your cluster with Service IP range 10.96.0.0/16 and you want your DNS Service IP to be 10.96.0.10, you'd have to create a Service like this:apiVersion: v1 kind: Service metadata: labels: k8s-app: kube-dns kubernetes.io/cluster-service: "true" kubernetes.io/name: CoreDNS name: kube-dns namespace: kube-system spec: clusterIP: 10.96.0.10 ports: - name: dns port: 53 protocol: UDP targetPort: 53 - name: dns-tcp port: 53 protocol: TCP targetPort: 53 selector: k8s-app: kube-dns type: ClusterIP But, as it was explained before, the IP address 10.96.0.10 has not been reserved. If other Services are created before or in parallel with dynamic allocation, there is a chance they can allocate this IP. Hence, you will not be able to create the DNS Service because it will fail with a conflict error.How can you avoid Service ClusterIP conflicts?The allocation strategy implemented in Kubernetes to allocate ClusterIPs to Services reduces the risk of collision.The ClusterIP range is divided, based on the formula min(max(16, cidrSize / 16), 256), described as never less than 16 or more than 256 with a graduated step between them.Dynamic IP assignment uses the upper band by default, once this has been exhausted it will use the lower range. This will allow users to use static allocations on the lower band with a low risk of collision.ExamplesExample 1This example uses the IP address range: 10.96.0.0/24 (CIDR notation) for the IP addresses of Services.Range Size: 28 - 2 = 254Band Offset: min(max(16, 256/16), 256) = min(16, 256) = 16Static band start: 10.96.0.1Static band end: 10.96.0.16Range end: 10.96.0.254pie showData title 10.96.0.0/24 "Static" : 16 "Dynamic" : 238JavaScript must be enabled to


Question: What are the benefits of Service ClusterIP allocation?

Answer: Service ClusterIP allocationIn Kubernetes, Services are an abstract way to expose an application running on a set of Pods. Services can have a cluster-scoped virtual IP address (using a Service of type: ClusterIP). Clients can connect using that virtual IP address, and Kubernetes then load-balances traffic to that Service across the different backing Pods.How Service ClusterIPs are allocated?When Kubernetes needs to assign a virtual IP address for a Service, that assignment happens one of two ways:dynamicallythe cluster's control plane automatically picks a free IP address from within the configured IP range for type: ClusterIP Services.staticallyyou specify an IP address of your choice, from within the configured IP range for Services.Across your whole cluster, every Service ClusterIP must be unique. Trying to create a Service with a specific ClusterIP that has already been allocated will return an error.Why do you need to reserve Service Cluster IPs?Sometimes you may want to have Services running in well-known IP addresses, so other components and users in the cluster can use them.The best example is the DNS Service for the cluster. As a soft convention, some Kubernetes installers assign the 10th IP address from the Service IP range to the DNS service. Assuming you configured your cluster with Service IP range 10.96.0.0/16 and you want your DNS Service IP to be 10.96.0.10, you'd have to create a Service like this:apiVersion: v1 kind: Service metadata: labels: k8s-app: kube-dns kubernetes.io/cluster-service: "true" kubernetes.io/name: CoreDNS name: kube-dns namespace: kube-system spec: clusterIP: 10.96.0.10 ports: - name: dns port: 53 protocol: UDP targetPort: 53 - name: dns-tcp port: 53 protocol: TCP targetPort: 53 selector: k8s-app: kube-dns type: ClusterIP But, as it was explained before, the IP address 10.96.0.10 has not been reserved. If other Services are created before or in parallel with dynamic allocation, there is a chance they can allocate this IP. Hence, you will not be able to create the DNS Service because it will fail with a conflict error.How can you avoid Service ClusterIP conflicts?The allocation strategy implemented in Kubernetes to allocate ClusterIPs to Services reduces the risk of collision.The ClusterIP range is divided, based on the formula min(max(16, cidrSize / 16), 256), described as never less than 16 or more than 256 with a graduated step between them.Dynamic IP assignment uses the upper band by default, once this has been exhausted it will use the lower range. This will allow users to use static allocations on the lower band with a low risk of collision.ExamplesExample 1This example uses the IP address range: 10.96.0.0/24 (CIDR notation) for the IP addresses of Services.Range Size: 28 - 2 = 254Band Offset: min(max(16, 256/16), 256) = min(16, 256) = 16Static band start: 10.96.0.1Static band end: 10.96.0.16Range end: 10.96.0.254pie showData title 10.96.0.0/24 "Static" : 16 "Dynamic" : 238JavaScript must be enabled to


Question: What is Service ClusterIP allocation?

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


Question: What is How Service ClusterIPs are allocated??

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


Question: What is Why do you need to reserve Service Cluster IPs??

Answer: S o m e t i m e s   y o u   m a y   w a n t   t o   h a v e   S e r v i c e s   r u n n i n g   i n   w e l l - k n o w n   I P   a d d r e s s e s ,   s o   o t h e r   c o m p o n e n t s   a n d   u s e r s   i n   t h e   c l u s t e r   c a n   u s e   t h e m .   T h e   b e s t   e x a m p l e   i s   t h e   D N S   S e r v i c e   f o r   t h e   c l u s t e r .   A s   a   s o f t   c o n v e n t i o n ,   s o m e   K u b e r n e t e s   i n s t a l l e r s   a s s i g n   t h e   1 0 t h   I P   a d d r e s s   f r o m   t h e   S e r v i c e   I P   r a n g e   t o   t h e   D N S   s e r v i c e .   A s s u m i n g   y o u   c o n f i g u r e d   y o u r   c l u s t e r   w i t h   S e r v i c e   I P   r a n g e   1 0 . 9 6 . 0 . 0 / 1 6   a n d   y o u   w a n t   y o u r   D N S   S e r v i c e   I P   t o   b e   1 0 . 9 6 . 0 . 1 0 ,   y o u ' d   h a v e   t o   c r e a t e   a   S e r v i c e   l i k e   t h i s :   a p i V e r s i o n :   v 1   k i n d :   S e r v i c e   m e t a d a t a :   l a b e l s :   k 8 s - a p p :   k u b e - d n s   k u b e r n e t e s . i o / c l u s t e r - s e r v i c e :   " t r u e "   k u b e r n e t e s . i o / n a m e :   C o r e D N S   n a m e :   k u b e - d n s   n a m e s p a c e :   k u b e - s y s t e m   s p e c :   c l u s t e r I P :   1 0 . 9 6 . 0 . 1 0   p o r t s :   -   n a m e :   d n s   p o r t :   5 3   p r o t o c o l :   U D P   t a r g e t P o r t :   5 3   -   n a m e :   d n s - t c p   p o r t :   5 3   p r o t o c o l :   T C P   t a r g e t P o r t :   5 3   s e l e c t o r :   k 8 s - a p p :   k u b e - d n s   t y p e :   C l u s t e r I P   B u t ,   a s   i t   w a s   e x p l a i n e d   b e f o r e ,   t h e   I P   a d d r e s s   1 0 . 9 6 . 0 . 1 0   h a s   n o t   b e e n   r e s e r v e d .   I f   o t h e r   S e r v i c e s   a r e   c r e a t e d   b e f o r e   o r   i n   p a r a l l e l   w i t h   d y n a m i c   a l l o c a t i o n ,   t h e r e   i s   a   c h a


Question: What is How can you avoid Service ClusterIP conflicts??

Answer: T h e   a l l o c a t i o n   s t r a t e g y   i m p l e m e n t e d   i n   K u b e r n e t e s   t o   a l l o c a t e   C l u s t e r I P s   t o   S e r v i c e s   r e d u c e s   t h e   r i s k   o f   c o l l i s i o n .   T h e   C l u s t e r I P   r a n g e   i s   d i v i d e d ,   b a s e d   o n   t h e   f o r m u l a   m i n ( m a x ( 1 6 ,   c i d r S i z e   /   1 6 ) ,   2 5 6 ) ,   d e s c r i b e d   a s   n e v e r   l e s s   t h a n   1 6   o r   m o r e   t h a n   2 5 6   w i t h   a   g r a d u a t e d   s t e p   b e t w e e n   t h e m .   D y n a m i c   I P   a s s i g n m e n t   u s e s   t h e   u p p e r   b a n d   b y   d e f a u l t ,   o n c e   t h i s   h a s   b e e n   e x h a u s t e d   i t   w i l l   u s e   t h e   l o w e r   r a n g e .   T h i s   w i l l   a l l o w   u s e r s   t o   u s e   s t a t i c   a l l o c a t i o n s   o n   t h e   l o w e r   b a n d   w i t h   a   l o w   r i s k   o f   c o l l i s i o n .


Question: What is Example 1?

Answer: T h i s   e x a m p l e   u s e s   t h e   I P   a d d r e s s   r a n g e :   1 0 . 9 6 . 0 . 0 / 2 4   ( C I D R   n o t a t i o n )   f o r   t h e   I P   a d d r e s s e s   o f   S e r v i c e s .   R a n g e   S i z e :   2 8   -   2   =   2 5 4 B a n d   O f f s e t :   m i n ( m a x ( 1 6 ,   2 5 6 / 1 6 ) ,   2 5 6 )   =   m i n ( 1 6 ,   2 5 6 )   =   1 6 S t a t i c   b a n d   s t a r t :   1 0 . 9 6 . 0 . 1 S t a t i c   b a n d   e n d :   1 0 . 9 6 . 0 . 1 6 R a n g e   e n d :   1 0 . 9 6 . 0 . 2 5 4


Question: What is Example 2?

Answer: T h i s   e x a m p l e   u s e s   t h e   I P   a d d r e s s   r a n g e :   1 0 . 9 6 . 0 . 0 / 2 0   ( C I D R   n o t a t i o n )   f o r   t h e   I P   a d d r e s s e s   o f   S e r v i c e s .   R a n g e   S i z e :   2 1 2   -   2   =   4 0 9 4 B a n d   O f f s e t :   m i n ( m a x ( 1 6 ,   4 0 9 6 / 1 6 ) ,   2 5 6 )   =   m i n ( 2 5 6 ,   2 5 6 )   =   2 5 6 S t a t i c   b a n d   s t a r t :   1 0 . 9 6 . 0 . 1 S t a t i c   b a n d   e n d :   1 0 . 9 6 . 1 . 0 R a n g e   e n d :   1 0 . 9 6 . 1 5 . 2 5 4


Question: What is Example 3?

Answer: T h i s   e x a m p l e   u s e s   t h e   I P   a d d r e s s   r a n g e :   1 0 . 9 6 . 0 . 0 / 1 6   ( C I D R   n o t a t i o n )   f o r   t h e   I P   a d d r e s s e s   o f   S e r v i c e s .   R a n g e   S i z e :   2 1 6   -   2   =   6 5 5 3 4 B a n d   O f f s e t :   m i n ( m a x ( 1 6 ,   6 5 5 3 6 / 1 6 ) ,   2 5 6 )   =   m i n ( 4 0 9 6 ,   2 5 6 )   =   2 5 6 S t a t i c   b a n d   s t a r t :   1 0 . 9 6 . 0 . 1 S t a t i c   b a n d   e n d s :   1 0 . 9 6 . 1 . 0 R a n g e   e n d :   1 0 . 9 6 . 2 5 5 . 2 5 4


Question: What is What's next?

Answer: R e a d   a b o u t   S e r v i c e   E x t e r n a l   T r a f f i c   P o l i c y R e a d   a b o u t   C o n n e c t i n g   A p p l i c a t i o n s   w i t h   S e r v i c e s R e a d   a b o u t   S e r v i c e s


Question: What is Kubernetes Scheduler?

Answer: Kubernetes SchedulerIn Kubernetes, scheduling refers to making sure that Pods are matched to Nodes so that Kubelet can run them.Scheduling overviewA scheduler watches for newly created Pods that have no Node assigned. For every Pod that the scheduler discovers, the scheduler becomes responsible for finding the best Node for that Pod to run on. The scheduler reaches this placement decision taking into account the scheduling principles described below.If you want to understand why Pods are placed onto a particular Node, or if you're planning to implement a custom scheduler yourself, this page will help you learn about scheduling.kube-schedulerkube-scheduler is the default scheduler for Kubernetes and runs as part of the control plane. kube-scheduler is designed so that, if you want and need to, you can write your own scheduling component and use that instead.Kube-scheduler selects an optimal node to run newly created or not yet scheduled (unscheduled) pods. Since containers in pods - and pods themselves - can have different requirements, the scheduler filters out any nodes that don't meet a Pod's specific scheduling needs. Alternatively, the API lets you specify a node for a Pod when you create it, but this is unusual and is only done in special cases.In a cluster, Nodes that meet the scheduling requirements for a Pod are called feasible nodes. If none of the nodes are suitable, the pod remains unscheduled until the scheduler is able to place it.The scheduler finds feasible Nodes for a Pod and then runs a set of functions to score the feasible Nodes and picks a Node with the highest score among the feasible ones to run the Pod. The scheduler then notifies the API server about this decision in a process called binding.Factors that need to be taken into account for scheduling decisions include individual and collective resource requirements, hardware / software / policy constraints, affinity and anti-affinity specifications, data locality, inter-workload interference, and so on.Node selection in kube-schedulerkube-scheduler selects a node for the pod in a 2-step operation:FilteringScoringThe filtering step finds the set of Nodes where it's feasible to schedule the Pod. For example, the PodFitsResources filter checks whether a candidate Node has enough available resources to meet a Pod's specific resource requests. After this step, the node list contains any suitable Nodes; often, there will be more than one. If the list is empty, that Pod isn't (yet) schedulable.In the scoring step, the scheduler ranks the remaining nodes to choose the most suitable Pod placement. The scheduler assigns a score to each Node that survived filtering, basing this score on the active scoring rules.Finally, kube-scheduler assigns the Pod to the Node with the highest ranking. If there is more than one node with equal scores, kube-scheduler selects one of these at random.There are two supported ways to configure the filtering and scoring behavior of the scheduler:Scheduling


Question: How does Kubernetes Scheduler work?

Answer: Kubernetes SchedulerIn Kubernetes, scheduling refers to making sure that Pods are matched to Nodes so that Kubelet can run them.Scheduling overviewA scheduler watches for newly created Pods that have no Node assigned. For every Pod that the scheduler discovers, the scheduler becomes responsible for finding the best Node for that Pod to run on. The scheduler reaches this placement decision taking into account the scheduling principles described below.If you want to understand why Pods are placed onto a particular Node, or if you're planning to implement a custom scheduler yourself, this page will help you learn about scheduling.kube-schedulerkube-scheduler is the default scheduler for Kubernetes and runs as part of the control plane. kube-scheduler is designed so that, if you want and need to, you can write your own scheduling component and use that instead.Kube-scheduler selects an optimal node to run newly created or not yet scheduled (unscheduled) pods. Since containers in pods - and pods themselves - can have different requirements, the scheduler filters out any nodes that don't meet a Pod's specific scheduling needs. Alternatively, the API lets you specify a node for a Pod when you create it, but this is unusual and is only done in special cases.In a cluster, Nodes that meet the scheduling requirements for a Pod are called feasible nodes. If none of the nodes are suitable, the pod remains unscheduled until the scheduler is able to place it.The scheduler finds feasible Nodes for a Pod and then runs a set of functions to score the feasible Nodes and picks a Node with the highest score among the feasible ones to run the Pod. The scheduler then notifies the API server about this decision in a process called binding.Factors that need to be taken into account for scheduling decisions include individual and collective resource requirements, hardware / software / policy constraints, affinity and anti-affinity specifications, data locality, inter-workload interference, and so on.Node selection in kube-schedulerkube-scheduler selects a node for the pod in a 2-step operation:FilteringScoringThe filtering step finds the set of Nodes where it's feasible to schedule the Pod. For example, the PodFitsResources filter checks whether a candidate Node has enough available resources to meet a Pod's specific resource requests. After this step, the node list contains any suitable Nodes; often, there will be more than one. If the list is empty, that Pod isn't (yet) schedulable.In the scoring step, the scheduler ranks the remaining nodes to choose the most suitable Pod placement. The scheduler assigns a score to each Node that survived filtering, basing this score on the active scoring rules.Finally, kube-scheduler assigns the Pod to the Node with the highest ranking. If there is more than one node with equal scores, kube-scheduler selects one of these at random.There are two supported ways to configure the filtering and scoring behavior of the scheduler:Scheduling


Question: When would you use Kubernetes Scheduler?

Answer: Kubernetes SchedulerIn Kubernetes, scheduling refers to making sure that Pods are matched to Nodes so that Kubelet can run them.Scheduling overviewA scheduler watches for newly created Pods that have no Node assigned. For every Pod that the scheduler discovers, the scheduler becomes responsible for finding the best Node for that Pod to run on. The scheduler reaches this placement decision taking into account the scheduling principles described below.If you want to understand why Pods are placed onto a particular Node, or if you're planning to implement a custom scheduler yourself, this page will help you learn about scheduling.kube-schedulerkube-scheduler is the default scheduler for Kubernetes and runs as part of the control plane. kube-scheduler is designed so that, if you want and need to, you can write your own scheduling component and use that instead.Kube-scheduler selects an optimal node to run newly created or not yet scheduled (unscheduled) pods. Since containers in pods - and pods themselves - can have different requirements, the scheduler filters out any nodes that don't meet a Pod's specific scheduling needs. Alternatively, the API lets you specify a node for a Pod when you create it, but this is unusual and is only done in special cases.In a cluster, Nodes that meet the scheduling requirements for a Pod are called feasible nodes. If none of the nodes are suitable, the pod remains unscheduled until the scheduler is able to place it.The scheduler finds feasible Nodes for a Pod and then runs a set of functions to score the feasible Nodes and picks a Node with the highest score among the feasible ones to run the Pod. The scheduler then notifies the API server about this decision in a process called binding.Factors that need to be taken into account for scheduling decisions include individual and collective resource requirements, hardware / software / policy constraints, affinity and anti-affinity specifications, data locality, inter-workload interference, and so on.Node selection in kube-schedulerkube-scheduler selects a node for the pod in a 2-step operation:FilteringScoringThe filtering step finds the set of Nodes where it's feasible to schedule the Pod. For example, the PodFitsResources filter checks whether a candidate Node has enough available resources to meet a Pod's specific resource requests. After this step, the node list contains any suitable Nodes; often, there will be more than one. If the list is empty, that Pod isn't (yet) schedulable.In the scoring step, the scheduler ranks the remaining nodes to choose the most suitable Pod placement. The scheduler assigns a score to each Node that survived filtering, basing this score on the active scoring rules.Finally, kube-scheduler assigns the Pod to the Node with the highest ranking. If there is more than one node with equal scores, kube-scheduler selects one of these at random.There are two supported ways to configure the filtering and scoring behavior of the scheduler:Scheduling


Question: What are the benefits of Kubernetes Scheduler?

Answer: Kubernetes SchedulerIn Kubernetes, scheduling refers to making sure that Pods are matched to Nodes so that Kubelet can run them.Scheduling overviewA scheduler watches for newly created Pods that have no Node assigned. For every Pod that the scheduler discovers, the scheduler becomes responsible for finding the best Node for that Pod to run on. The scheduler reaches this placement decision taking into account the scheduling principles described below.If you want to understand why Pods are placed onto a particular Node, or if you're planning to implement a custom scheduler yourself, this page will help you learn about scheduling.kube-schedulerkube-scheduler is the default scheduler for Kubernetes and runs as part of the control plane. kube-scheduler is designed so that, if you want and need to, you can write your own scheduling component and use that instead.Kube-scheduler selects an optimal node to run newly created or not yet scheduled (unscheduled) pods. Since containers in pods - and pods themselves - can have different requirements, the scheduler filters out any nodes that don't meet a Pod's specific scheduling needs. Alternatively, the API lets you specify a node for a Pod when you create it, but this is unusual and is only done in special cases.In a cluster, Nodes that meet the scheduling requirements for a Pod are called feasible nodes. If none of the nodes are suitable, the pod remains unscheduled until the scheduler is able to place it.The scheduler finds feasible Nodes for a Pod and then runs a set of functions to score the feasible Nodes and picks a Node with the highest score among the feasible ones to run the Pod. The scheduler then notifies the API server about this decision in a process called binding.Factors that need to be taken into account for scheduling decisions include individual and collective resource requirements, hardware / software / policy constraints, affinity and anti-affinity specifications, data locality, inter-workload interference, and so on.Node selection in kube-schedulerkube-scheduler selects a node for the pod in a 2-step operation:FilteringScoringThe filtering step finds the set of Nodes where it's feasible to schedule the Pod. For example, the PodFitsResources filter checks whether a candidate Node has enough available resources to meet a Pod's specific resource requests. After this step, the node list contains any suitable Nodes; often, there will be more than one. If the list is empty, that Pod isn't (yet) schedulable.In the scoring step, the scheduler ranks the remaining nodes to choose the most suitable Pod placement. The scheduler assigns a score to each Node that survived filtering, basing this score on the active scoring rules.Finally, kube-scheduler assigns the Pod to the Node with the highest ranking. If there is more than one node with equal scores, kube-scheduler selects one of these at random.There are two supported ways to configure the filtering and scoring behavior of the scheduler:Scheduling


Question: What is Kubernetes Scheduler?

Answer: I n   K u b e r n e t e s ,   s c h e d u l i n g   r e f e r s   t o   m a k i n g   s u r e   t h a t   P o d s   a r e   m a t c h e d   t o   N o d e s   s o   t h a t   K u b e l e t   c a n   r u n   t h e m .


Question: What is Scheduling overview?

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


Question: What is kube-scheduler?

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


Question: What is Node selection in kube-scheduler?

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


Question: What is What's next?

Answer: R e a d   a b o u t   s c h e d u l e r   p e r f o r m a n c e   t u n i n g R e a d   a b o u t   P o d   t o p o l o g y   s p r e a d   c o n s t r a i n t s R e a d   t h e   r e f e r e n c e   d o c u m e n t a t i o n   f o r   k u b e - s c h e d u l e r R e a d   t h e   k u b e - s c h e d u l e r   c o n f i g   ( v 1 )   r e f e r e n c e L e a r n   a b o u t   c o n f i g u r i n g   m u l t i p l e   s c h e d u l e r s L e a r n   a b o u t   t o p o l o g y   m a n a g e m e n t   p o l i c i e s L e a r n   a b o u t   P o d   O v e r h e a d L e a r n   a b o u t   s c h e d u l i n g   o f   P o d s   t h a t   u s e   v o l u m e s   i n : V o l u m e   T o p o l o g y   S u p p o r t S t o r a g e   C a p a c i t y   T r a c k i n g N o d e - s p e c i f i c   V o l u m e   L i m i t s   V o l u m e   T o p o l o g y   S u p p o r t S t o r a g e   C a p a c i t y   T r a c k i n g N o d e - s p e c i f i c   V o l u m e   L i m i t s


Question: What is Get a Shell to a Running Container?

Answer: Get a Shell to a Running ContainerThis page shows how to use kubectl exec to get a shell to a running container.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 KubernetesGetting a shell to a containerIn this exercise, you create a Pod that has one container. The container runs the nginx image. Here is the configuration file for the Pod:application/shell-demo.yaml apiVersion: v1 kind: Pod metadata: name: shell-demo spec: volumes: - name: shared-data emptyDir: {} containers: - name: nginx image: nginx volumeMounts: - name: shared-data mountPath: /usr/share/nginx/html hostNetwork: true dnsPolicy: Default Create the Pod:kubectl apply -f https://k8s.io/examples/application/shell-demo.yaml Verify that the container is running:kubectl get pod shell-demo Get a shell to the running container:kubectl exec --stdin --tty shell-demo -- /bin/bash Note:The double dash (--) separates the arguments you want to pass to the command from the kubectl arguments.In your shell, list the root directory:# Run this inside the container ls / In your shell, experiment with other commands. Here are some examples:# You can run these example commands inside the container ls / cat /proc/mounts cat /proc/1/maps apt-get update apt-get install -y tcpdump tcpdump apt-get install -y lsof lsof apt-get install -y procps ps aux ps aux | grep nginx Writing the root page for nginxLook again at the configuration file for your Pod. The Pod has an emptyDir volume, and the container mounts the volume at /usr/share/nginx/html.In your shell, create an index.html file in the /usr/share/nginx/html directory:# Run this inside the container echo 'Hello shell demo' > /usr/share/nginx/html/index.html In your shell, send a GET request to the nginx server:# Run this in the shell inside your container apt-get update apt-get install curl curl http://localhost/ The output shows the text that you wrote to the index.html file:Hello shell demo When you are finished with your shell, enter exit.exit # To quit the shell in the container Running individual commands in a containerIn an ordinary command window, not your shell, list the environment variables in the running container:kubectl exec shell-demo -- env Experiment with running other commands. Here are some examples:kubectl exec shell-demo -- ps aux kubectl exec shell-demo -- ls / kubectl exec shell-demo -- cat /proc/1/mounts Opening a shell when a Pod has more than one containerIf a Pod has more than one container, use --container or -c to specify a container in the kubectl exec command. For example, suppose you have a Pod named my-pod, and the Pod has two containers named main-app