Question: What are the benefits of kubectl cp?

Answer: kubectl cpSynopsisCopy files and directories to and from containers.kubectl cp <file-spec-src> <file-spec-dest> Examples # !!!Important Note!!! # Requires that the 'tar' binary is present in your container # image. If 'tar' is not present, 'kubectl cp' will fail. # # For advanced use cases, such as symlinks, wildcard expansion or # file mode preservation, consider using 'kubectl exec'. # Copy /tmp/foo local file to /tmp/bar in a remote pod in namespace <some-namespace> tar cf - /tmp/foo | kubectl exec -i -n <some-namespace> <some-pod> -- tar xf - -C /tmp/bar # Copy /tmp/foo from a remote pod to /tmp/bar locally kubectl exec -n <some-namespace> <some-pod> -- tar cf - /tmp/foo | tar xf - -C /tmp/bar # Copy /tmp/foo_dir local directory to /tmp/bar_dir in a remote pod in the default namespace kubectl cp /tmp/foo_dir <some-pod>:/tmp/bar_dir # Copy /tmp/foo local file to /tmp/bar in a remote pod in a specific container kubectl cp /tmp/foo <some-pod>:/tmp/bar -c <specific-container> # Copy /tmp/foo local file to /tmp/bar in a remote pod in namespace <some-namespace> kubectl cp /tmp/foo <some-namespace>/<some-pod>:/tmp/bar # Copy /tmp/foo from a remote pod to /tmp/bar locally kubectl cp <some-namespace>/<some-pod>:/tmp/foo /tmp/bar Options-c, --container stringContainer name. If omitted, use the kubectl.kubernetes.io/default-container annotation for selecting the container to be attached or the first container in the pod will be chosen-h, --helphelp for cp--no-preserveThe copied file/directory's ownership and permissions will not be preserved in the container--retries intSet number of retries to complete a copy operation from a container. Specify 0 to disable or any negative value for infinite retrying. The default is 0 (no retry).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 connections insecure--kubeconfig stringPath to the kubeconfig file to use for CLI requests.--kuberc stringPath to the kuberc file to use for preferences. This can be disabled by exporting KUBECTL_KUBERC=false feature gate or turning off the feature KUBERC=off.--match-server-versionRequire server version to match client version-n, --namespace st


Question: What is Synopsis?

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


Question: What is Examples?

Answer: #   ! ! ! I m p o r t a n t   N o t e ! ! !   #   R e q u i r e s   t h a t   t h e   ' t a r '   b i n a r y   i s   p r e s e n t   i n   y o u r   c o n t a i n e r   #   i m a g e .   I f   ' t a r '   i s   n o t   p r e s e n t ,   ' k u b e c t l   c p '   w i l l   f a i l .   #   #   F o r   a d v a n c e d   u s e   c a s e s ,   s u c h   a s   s y m l i n k s ,   w i l d c a r d   e x p a n s i o n   o r   #   f i l e   m o d e   p r e s e r v a t i o n ,   c o n s i d e r   u s i n g   ' k u b e c t l   e x e c ' .   #   C o p y   / t m p / f o o   l o c a l   f i l e   t o   / t m p / b a r   i n   a   r e m o t e   p o d   i n   n a m e s p a c e   < s o m e - n a m e s p a c e >   t a r   c f   -   / t m p / f o o   |   k u b e c t l   e x e c   - i   - n   < s o m e - n a m e s p a c e >   < s o m e - p o d >   - -   t a r   x f   -   - C   / t m p / b a r   #   C o p y   / t m p / f o o   f r o m   a   r e m o t e   p o d   t o   / t m p / b a r   l o c a l l y   k u b e c t l   e x e c   - n   < s o m e - n a m e s p a c e >   < s o m e - p o d >   - -   t a r   c f   -   / t m p / f o o   |   t a r   x f   -   - C   / t m p / b a r   #   C o p y   / t m p / f o o _ d i r   l o c a l   d i r e c t o r y   t o   / t m p / b a r _ d i r   i n   a   r e m o t e   p o d   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   c p   / t m p / f o o _ d i r   < s o m e - p o d > : / t m p / b a r _ d i r   #   C o p y   / t m p / f o o   l o c a l   f i l e   t o   / t m p / b a r   i n   a   r e m o t e   p o d   i n   a   s p e c i f i c   c o n t a i n e r   k u b e c t l   c p   / t m p / f o o   < s o m e - p o d > : / t m p / b a r   - c   < s p e c i f i c - c o n t a i n e r >   #   C o p y   / t m p / f o o   l o c a l   f i l e   t o   / t m p / b a r   i n   a   r e m o t e   p o d   i n   n a m e s p a c e   < s o m e - n a m e s p a c e >   k u b e c t l   c p   / t m p / f o o   < s o m e - n a m e s p a c e > / < s o m e - p o


Question: What is Options?

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


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 Annotations?

Answer: AnnotationsYou can use Kubernetes annotations to attach arbitrary non-identifying metadata to objects. Clients such as tools and libraries can retrieve this metadata.Attaching metadata to objectsYou can use either labels or annotations to attach metadata to Kubernetes objects. Labels can be used to select objects and to find collections of objects that satisfy certain conditions. In contrast, annotations are not used to identify and select objects. The metadata in an annotation can be small or large, structured or unstructured, and can include characters not permitted by labels. It is possible to use labels as well as annotations in the metadata of the same object.Annotations, like labels, are key/value maps:"metadata": { "annotations": { "key1" : "value1", "key2" : "value2" } } Note:The keys and the values in the map must be strings. In other words, you cannot use numeric, boolean, list or other types for either the keys or the values.Here are some examples of information that could be recorded in annotations:Fields managed by a declarative configuration layer. Attaching these fields as annotations distinguishes them from default values set by clients or servers, and from auto-generated fields and fields set by auto-sizing or auto-scaling systems.Build, release, or image information like timestamps, release IDs, git branch, PR numbers, image hashes, and registry address.Pointers to logging, monitoring, analytics, or audit repositories.Client library or tool information that can be used for debugging purposes: for example, name, version, and build information.User or tool/system provenance information, such as URLs of related objects from other ecosystem components.Lightweight rollout tool metadata: for example, config or checkpoints.Phone or pager numbers of persons responsible, or directory entries that specify where that information can be found, such as a team web site.Directives from the end-user to the implementations to modify behavior or engage non-standard features.Instead of using annotations, you could store this type of information in an external database or directory, but that would make it much harder to produce shared client libraries and tools for deployment, management, introspection, and the like.Syntax and character setAnnotations are key/value pairs. Valid annotation keys have two segments: an optional prefix and name, separated by a slash (/). The name segment is required and must be 63 characters or less, beginning and ending with an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (.), not longer than 253 characters in total, followed by a slash (/).If the prefix is omitted, the annotation Key is presumed to be private to the user. Automated system components (e.g. kube-scheduler, kube-controller-manager, kube-apiserver, kubectl, or other third-party au


Question: How does Annotations work?

Answer: AnnotationsYou can use Kubernetes annotations to attach arbitrary non-identifying metadata to objects. Clients such as tools and libraries can retrieve this metadata.Attaching metadata to objectsYou can use either labels or annotations to attach metadata to Kubernetes objects. Labels can be used to select objects and to find collections of objects that satisfy certain conditions. In contrast, annotations are not used to identify and select objects. The metadata in an annotation can be small or large, structured or unstructured, and can include characters not permitted by labels. It is possible to use labels as well as annotations in the metadata of the same object.Annotations, like labels, are key/value maps:"metadata": { "annotations": { "key1" : "value1", "key2" : "value2" } } Note:The keys and the values in the map must be strings. In other words, you cannot use numeric, boolean, list or other types for either the keys or the values.Here are some examples of information that could be recorded in annotations:Fields managed by a declarative configuration layer. Attaching these fields as annotations distinguishes them from default values set by clients or servers, and from auto-generated fields and fields set by auto-sizing or auto-scaling systems.Build, release, or image information like timestamps, release IDs, git branch, PR numbers, image hashes, and registry address.Pointers to logging, monitoring, analytics, or audit repositories.Client library or tool information that can be used for debugging purposes: for example, name, version, and build information.User or tool/system provenance information, such as URLs of related objects from other ecosystem components.Lightweight rollout tool metadata: for example, config or checkpoints.Phone or pager numbers of persons responsible, or directory entries that specify where that information can be found, such as a team web site.Directives from the end-user to the implementations to modify behavior or engage non-standard features.Instead of using annotations, you could store this type of information in an external database or directory, but that would make it much harder to produce shared client libraries and tools for deployment, management, introspection, and the like.Syntax and character setAnnotations are key/value pairs. Valid annotation keys have two segments: an optional prefix and name, separated by a slash (/). The name segment is required and must be 63 characters or less, beginning and ending with an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (.), not longer than 253 characters in total, followed by a slash (/).If the prefix is omitted, the annotation Key is presumed to be private to the user. Automated system components (e.g. kube-scheduler, kube-controller-manager, kube-apiserver, kubectl, or other third-party au


Question: When would you use Annotations?

Answer: AnnotationsYou can use Kubernetes annotations to attach arbitrary non-identifying metadata to objects. Clients such as tools and libraries can retrieve this metadata.Attaching metadata to objectsYou can use either labels or annotations to attach metadata to Kubernetes objects. Labels can be used to select objects and to find collections of objects that satisfy certain conditions. In contrast, annotations are not used to identify and select objects. The metadata in an annotation can be small or large, structured or unstructured, and can include characters not permitted by labels. It is possible to use labels as well as annotations in the metadata of the same object.Annotations, like labels, are key/value maps:"metadata": { "annotations": { "key1" : "value1", "key2" : "value2" } } Note:The keys and the values in the map must be strings. In other words, you cannot use numeric, boolean, list or other types for either the keys or the values.Here are some examples of information that could be recorded in annotations:Fields managed by a declarative configuration layer. Attaching these fields as annotations distinguishes them from default values set by clients or servers, and from auto-generated fields and fields set by auto-sizing or auto-scaling systems.Build, release, or image information like timestamps, release IDs, git branch, PR numbers, image hashes, and registry address.Pointers to logging, monitoring, analytics, or audit repositories.Client library or tool information that can be used for debugging purposes: for example, name, version, and build information.User or tool/system provenance information, such as URLs of related objects from other ecosystem components.Lightweight rollout tool metadata: for example, config or checkpoints.Phone or pager numbers of persons responsible, or directory entries that specify where that information can be found, such as a team web site.Directives from the end-user to the implementations to modify behavior or engage non-standard features.Instead of using annotations, you could store this type of information in an external database or directory, but that would make it much harder to produce shared client libraries and tools for deployment, management, introspection, and the like.Syntax and character setAnnotations are key/value pairs. Valid annotation keys have two segments: an optional prefix and name, separated by a slash (/). The name segment is required and must be 63 characters or less, beginning and ending with an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (.), not longer than 253 characters in total, followed by a slash (/).If the prefix is omitted, the annotation Key is presumed to be private to the user. Automated system components (e.g. kube-scheduler, kube-controller-manager, kube-apiserver, kubectl, or other third-party au


Question: What are the benefits of Annotations?

Answer: AnnotationsYou can use Kubernetes annotations to attach arbitrary non-identifying metadata to objects. Clients such as tools and libraries can retrieve this metadata.Attaching metadata to objectsYou can use either labels or annotations to attach metadata to Kubernetes objects. Labels can be used to select objects and to find collections of objects that satisfy certain conditions. In contrast, annotations are not used to identify and select objects. The metadata in an annotation can be small or large, structured or unstructured, and can include characters not permitted by labels. It is possible to use labels as well as annotations in the metadata of the same object.Annotations, like labels, are key/value maps:"metadata": { "annotations": { "key1" : "value1", "key2" : "value2" } } Note:The keys and the values in the map must be strings. In other words, you cannot use numeric, boolean, list or other types for either the keys or the values.Here are some examples of information that could be recorded in annotations:Fields managed by a declarative configuration layer. Attaching these fields as annotations distinguishes them from default values set by clients or servers, and from auto-generated fields and fields set by auto-sizing or auto-scaling systems.Build, release, or image information like timestamps, release IDs, git branch, PR numbers, image hashes, and registry address.Pointers to logging, monitoring, analytics, or audit repositories.Client library or tool information that can be used for debugging purposes: for example, name, version, and build information.User or tool/system provenance information, such as URLs of related objects from other ecosystem components.Lightweight rollout tool metadata: for example, config or checkpoints.Phone or pager numbers of persons responsible, or directory entries that specify where that information can be found, such as a team web site.Directives from the end-user to the implementations to modify behavior or engage non-standard features.Instead of using annotations, you could store this type of information in an external database or directory, but that would make it much harder to produce shared client libraries and tools for deployment, management, introspection, and the like.Syntax and character setAnnotations are key/value pairs. Valid annotation keys have two segments: an optional prefix and name, separated by a slash (/). The name segment is required and must be 63 characters or less, beginning and ending with an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (.), not longer than 253 characters in total, followed by a slash (/).If the prefix is omitted, the annotation Key is presumed to be private to the user. Automated system components (e.g. kube-scheduler, kube-controller-manager, kube-apiserver, kubectl, or other third-party au


Question: What is Annotations?

Answer: Y o u   c a n   u s e   K u b e r n e t e s   a n n o t a t i o n s   t o   a t t a c h   a r b i t r a r y   n o n - i d e n t i f y i n g   m e t a d a t a   t o   o b j e c t s .   C l i e n t s   s u c h   a s   t o o l s   a n d   l i b r a r i e s   c a n   r e t r i e v e   t h i s   m e t a d a t a .


Question: What is Attaching metadata to objects?

Answer: Y o u   c a n   u s e   e i t h e r   l a b e l s   o r   a n n o t a t i o n s   t o   a t t a c h   m e t a d a t a   t o   K u b e r n e t e s   o b j e c t s .   L a b e l s   c a n   b e   u s e d   t o   s e l e c t   o b j e c t s   a n d   t o   f i n d   c o l l e c t i o n s   o f   o b j e c t s   t h a t   s a t i s f y   c e r t a i n   c o n d i t i o n s .   I n   c o n t r a s t ,   a n n o t a t i o n s   a r e   n o t   u s e d   t o   i d e n t i f y   a n d   s e l e c t   o b j e c t s .   T h e   m e t a d a t a   i n   a n   a n n o t a t i o n   c a n   b e   s m a l l   o r   l a r g e ,   s t r u c t u r e d   o r   u n s t r u c t u r e d ,   a n d   c a n   i n c l u d e   c h a r a c t e r s   n o t   p e r m i t t e d   b y   l a b e l s .   I t   i s   p o s s i b l e   t o   u s e   l a b e l s   a s   w e l l   a s   a n n o t a t i o n s   i n   t h e   m e t a d a t a   o f   t h e   s a m e   o b j e c t .   A n n o t a t i o n s ,   l i k e   l a b e l s ,   a r e   k e y / v a l u e   m a p s :   " m e t a d a t a " :   {   " a n n o t a t i o n s " :   {   " k e y 1 "   :   " v a l u e 1 " ,   " k e y 2 "   :   " v a l u e 2 "   }   }


Question: What is Note:?

Answer: H e r e   a r e   s o m e   e x a m p l e s   o f   i n f o r m a t i o n   t h a t   c o u l d   b e   r e c o r d e d   i n   a n n o t a t i o n s :   F i e l d s   m a n a g e d   b y   a   d e c l a r a t i v e   c o n f i g u r a t i o n   l a y e r .   A t t a c h i n g   t h e s e   f i e l d s   a s   a n n o t a t i o n s   d i s t i n g u i s h e s   t h e m   f r o m   d e f a u l t   v a l u e s   s e t   b y   c l i e n t s   o r   s e r v e r s ,   a n d   f r o m   a u t o - g e n e r a t e d   f i e l d s   a n d   f i e l d s   s e t   b y   a u t o - s i z i n g   o r   a u t o - s c a l i n g   s y s t e m s . B u i l d ,   r e l e a s e ,   o r   i m a g e   i n f o r m a t i o n   l i k e   t i m e s t a m p s ,   r e l e a s e   I D s ,   g i t   b r a n c h ,   P R   n u m b e r s ,   i m a g e   h a s h e s ,   a n d   r e g i s t r y   a d d r e s s . P o i n t e r s   t o   l o g g i n g ,   m o n i t o r i n g ,   a n a l y t i c s ,   o r   a u d i t   r e p o s i t o r i e s . C l i e n t   l i b r a r y   o r   t o o l   i n f o r m a t i o n   t h a t   c a n   b e   u s e d   f o r   d e b u g g i n g   p u r p o s e s :   f o r   e x a m p l e ,   n a m e ,   v e r s i o n ,   a n d   b u i l d   i n f o r m a t i o n . U s e r   o r   t o o l / s y s t e m   p r o v e n a n c e   i n f o r m a t i o n ,   s u c h   a s   U R L s   o f   r e l a t e d   o b j e c t s   f r o m   o t h e r   e c o s y s t e m   c o m p o n e n t s . L i g h t w e i g h t   r o l l o u t   t o o l   m e t a d a t a :   f o r   e x a m p l e ,   c o n f i g   o r   c h e c k p o i n t s . P h o n e   o r   p a g e r   n u m b e r s   o f   p e r s o n s   r e s p o n s i b l e ,   o r   d i r e c t o r y   e n t r i e s   t h a t   s p e c i f y   w h e r e   t h a t   i n f o r m a t i o n   c a n   b e   f o u n d ,   s u c h   a s   a   t e a m   w e b   s i t e . D i r e c t i v e s   f r o m   t h e   e n d - u s e r   t o   t h e   i m p l e m e


Question: What is Syntax and character set?

Answer: A n n o t a t i o n s   a r e   k e y / v a l u e   p a i r s .   V a l i d   a n n o t a t i o n   k e y s   h a v e   t w o   s e g m e n t s :   a n   o p t i o n a l   p r e f i x   a n d   n a m e ,   s e p a r a t e d   b y   a   s l a s h   ( / ) .   T h e   n a m e   s e g m e n t   i s   r e q u i r e d   a n d   m u s t   b e   6 3   c h a r a c t e r s   o r   l e s s ,   b e g i n n i n g   a n d   e n d i n g   w i t h   a n   a l p h a n u m e r i c   c h a r a c t e r   ( [ a - z 0 - 9 A - Z ] )   w i t h   d a s h e s   ( - ) ,   u n d e r s c o r e s   ( _ ) ,   d o t s   ( . ) ,   a n d   a l p h a n u m e r i c s   b e t w e e n .   T h e   p r e f i x   i s   o p t i o n a l .   I f   s p e c i f i e d ,   t h e   p r e f i x   m u s t   b e   a   D N S   s u b d o m a i n :   a   s e r i e s   o f   D N S   l a b e l s   s e p a r a t e d   b y   d o t s   ( . ) ,   n o t   l o n g e r   t h a n   2 5 3   c h a r a c t e r s   i n   t o t a l ,   f o l l o w e d   b y   a   s l a s h   ( / ) .   I f   t h e   p r e f i x   i s   o m i t t e d ,   t h e   a n n o t a t i o n   K e y   i s   p r e s u m e d   t o   b e   p r i v a t e   t o   t h e   u s e r .   A u t o m a t e d   s y s t e m   c o m p o n e n t s   ( e . g .   k u b e - s c h e d u l e r ,   k u b e - c o n t r o l l e r - m a n a g e r ,   k u b e - a p i s e r v e r ,   k u b e c t l ,   o r   o t h e r   t h i r d - p a r t y   a u t o m a t i o n )   w h i c h   a d d   a n n o t a t i o n s   t o   e n d - u s e r   o b j e c t s   m u s t   s p e c i f y   a   p r e f i x .   T h e   k u b e r n e t e s . i o /   a n d   k 8 s . i o /   p r e f i x e s   a r e   r e s e r v e d   f o r   K u b e r n e t e s   c o r e   c o m p o n e n t s .   F o r   e x a m p l e ,   h e r e ' s   a   m a n i f e s t   f o r   a   P o d   t h a t   h a s   t h e   a n n o t a t i o n   i m a g e r e g i s t r y :   h t t p s : / / h u b . d o c k e r . c o m /   :   a p i V e r s i o n :


Question: What is What's next?

Answer: L e a r n   m o r e   a b o u t   L a b e l s   a n d   S e l e c t o r s . F i n d   W e l l - k n o w n   l a b e l s ,   A n n o t a t i o n s   a n d   T a i n t s


Question: What is Check whether dockershim removal affects you?

Answer: Check whether dockershim removal affects youThe dockershim component of Kubernetes allows the use of Docker as a Kubernetes's container runtime. Kubernetes' built-in dockershim component was removed in release v1.24.This page explains how your cluster could be using Docker as a container runtime, provides details on the role that dockershim plays when in use, and shows steps you can take to check whether any workloads could be affected by dockershim removal.Finding if your app has a dependencies on DockerIf you are using Docker for building your application containers, you can still run these containers on any container runtime. This use of Docker does not count as a dependency on Docker as a container runtime.When alternative container runtime is used, executing Docker commands may either not work or yield unexpected output. This is how you can find whether you have a dependency on Docker:Make sure no privileged Pods execute Docker commands (like docker ps), restart the Docker service (commands such as systemctl restart docker.service), or modify Docker-specific files such as /etc/docker/daemon.json.Check for any private registries or image mirror settings in the Docker configuration file (like /etc/docker/daemon.json). Those typically need to be reconfigured for another container runtime.Check that scripts and apps running on nodes outside of your Kubernetes infrastructure do not execute Docker commands. It might be:SSH to nodes to troubleshoot;Node startup scripts;Monitoring and security agents installed on nodes directly.Third-party tools that perform above mentioned privileged operations. See Migrating telemetry and security agents from dockershim for more information.Make sure there are no indirect dependencies on dockershim behavior. This is an edge case and unlikely to affect your application. Some tooling may be configured to react to Docker-specific behaviors, for example, raise alert on specific metrics or search for a specific log message as part of troubleshooting instructions. If you have such tooling configured, test the behavior on a test cluster before migration.Dependency on Docker explainedA container runtime is software that can execute the containers that make up a Kubernetes pod. Kubernetes is responsible for orchestration and scheduling of Pods; on each node, the kubelet uses the container runtime interface as an abstraction so that you can use any compatible container runtime.In its earliest releases, Kubernetes offered compatibility with one container runtime: Docker. Later in the Kubernetes project's history, cluster operators wanted to adopt additional container runtimes. The CRI was designed to allow this kind of flexibility - and the kubelet began supporting CRI. However, because Docker existed before the CRI specification was invented, the Kubernetes project created an adapter component, dockershim. The dockershim adapter allows the kubelet to interact with Docker as if Docker were a CRI compatible runtime.You can re


Question: How does Check whether dockershim removal affects you work?

Answer: Check whether dockershim removal affects youThe dockershim component of Kubernetes allows the use of Docker as a Kubernetes's container runtime. Kubernetes' built-in dockershim component was removed in release v1.24.This page explains how your cluster could be using Docker as a container runtime, provides details on the role that dockershim plays when in use, and shows steps you can take to check whether any workloads could be affected by dockershim removal.Finding if your app has a dependencies on DockerIf you are using Docker for building your application containers, you can still run these containers on any container runtime. This use of Docker does not count as a dependency on Docker as a container runtime.When alternative container runtime is used, executing Docker commands may either not work or yield unexpected output. This is how you can find whether you have a dependency on Docker:Make sure no privileged Pods execute Docker commands (like docker ps), restart the Docker service (commands such as systemctl restart docker.service), or modify Docker-specific files such as /etc/docker/daemon.json.Check for any private registries or image mirror settings in the Docker configuration file (like /etc/docker/daemon.json). Those typically need to be reconfigured for another container runtime.Check that scripts and apps running on nodes outside of your Kubernetes infrastructure do not execute Docker commands. It might be:SSH to nodes to troubleshoot;Node startup scripts;Monitoring and security agents installed on nodes directly.Third-party tools that perform above mentioned privileged operations. See Migrating telemetry and security agents from dockershim for more information.Make sure there are no indirect dependencies on dockershim behavior. This is an edge case and unlikely to affect your application. Some tooling may be configured to react to Docker-specific behaviors, for example, raise alert on specific metrics or search for a specific log message as part of troubleshooting instructions. If you have such tooling configured, test the behavior on a test cluster before migration.Dependency on Docker explainedA container runtime is software that can execute the containers that make up a Kubernetes pod. Kubernetes is responsible for orchestration and scheduling of Pods; on each node, the kubelet uses the container runtime interface as an abstraction so that you can use any compatible container runtime.In its earliest releases, Kubernetes offered compatibility with one container runtime: Docker. Later in the Kubernetes project's history, cluster operators wanted to adopt additional container runtimes. The CRI was designed to allow this kind of flexibility - and the kubelet began supporting CRI. However, because Docker existed before the CRI specification was invented, the Kubernetes project created an adapter component, dockershim. The dockershim adapter allows the kubelet to interact with Docker as if Docker were a CRI compatible runtime.You can re


Question: When would you use Check whether dockershim removal affects you?

Answer: Check whether dockershim removal affects youThe dockershim component of Kubernetes allows the use of Docker as a Kubernetes's container runtime. Kubernetes' built-in dockershim component was removed in release v1.24.This page explains how your cluster could be using Docker as a container runtime, provides details on the role that dockershim plays when in use, and shows steps you can take to check whether any workloads could be affected by dockershim removal.Finding if your app has a dependencies on DockerIf you are using Docker for building your application containers, you can still run these containers on any container runtime. This use of Docker does not count as a dependency on Docker as a container runtime.When alternative container runtime is used, executing Docker commands may either not work or yield unexpected output. This is how you can find whether you have a dependency on Docker:Make sure no privileged Pods execute Docker commands (like docker ps), restart the Docker service (commands such as systemctl restart docker.service), or modify Docker-specific files such as /etc/docker/daemon.json.Check for any private registries or image mirror settings in the Docker configuration file (like /etc/docker/daemon.json). Those typically need to be reconfigured for another container runtime.Check that scripts and apps running on nodes outside of your Kubernetes infrastructure do not execute Docker commands. It might be:SSH to nodes to troubleshoot;Node startup scripts;Monitoring and security agents installed on nodes directly.Third-party tools that perform above mentioned privileged operations. See Migrating telemetry and security agents from dockershim for more information.Make sure there are no indirect dependencies on dockershim behavior. This is an edge case and unlikely to affect your application. Some tooling may be configured to react to Docker-specific behaviors, for example, raise alert on specific metrics or search for a specific log message as part of troubleshooting instructions. If you have such tooling configured, test the behavior on a test cluster before migration.Dependency on Docker explainedA container runtime is software that can execute the containers that make up a Kubernetes pod. Kubernetes is responsible for orchestration and scheduling of Pods; on each node, the kubelet uses the container runtime interface as an abstraction so that you can use any compatible container runtime.In its earliest releases, Kubernetes offered compatibility with one container runtime: Docker. Later in the Kubernetes project's history, cluster operators wanted to adopt additional container runtimes. The CRI was designed to allow this kind of flexibility - and the kubelet began supporting CRI. However, because Docker existed before the CRI specification was invented, the Kubernetes project created an adapter component, dockershim. The dockershim adapter allows the kubelet to interact with Docker as if Docker were a CRI compatible runtime.You can re


Question: What are the benefits of Check whether dockershim removal affects you?

Answer: Check whether dockershim removal affects youThe dockershim component of Kubernetes allows the use of Docker as a Kubernetes's container runtime. Kubernetes' built-in dockershim component was removed in release v1.24.This page explains how your cluster could be using Docker as a container runtime, provides details on the role that dockershim plays when in use, and shows steps you can take to check whether any workloads could be affected by dockershim removal.Finding if your app has a dependencies on DockerIf you are using Docker for building your application containers, you can still run these containers on any container runtime. This use of Docker does not count as a dependency on Docker as a container runtime.When alternative container runtime is used, executing Docker commands may either not work or yield unexpected output. This is how you can find whether you have a dependency on Docker:Make sure no privileged Pods execute Docker commands (like docker ps), restart the Docker service (commands such as systemctl restart docker.service), or modify Docker-specific files such as /etc/docker/daemon.json.Check for any private registries or image mirror settings in the Docker configuration file (like /etc/docker/daemon.json). Those typically need to be reconfigured for another container runtime.Check that scripts and apps running on nodes outside of your Kubernetes infrastructure do not execute Docker commands. It might be:SSH to nodes to troubleshoot;Node startup scripts;Monitoring and security agents installed on nodes directly.Third-party tools that perform above mentioned privileged operations. See Migrating telemetry and security agents from dockershim for more information.Make sure there are no indirect dependencies on dockershim behavior. This is an edge case and unlikely to affect your application. Some tooling may be configured to react to Docker-specific behaviors, for example, raise alert on specific metrics or search for a specific log message as part of troubleshooting instructions. If you have such tooling configured, test the behavior on a test cluster before migration.Dependency on Docker explainedA container runtime is software that can execute the containers that make up a Kubernetes pod. Kubernetes is responsible for orchestration and scheduling of Pods; on each node, the kubelet uses the container runtime interface as an abstraction so that you can use any compatible container runtime.In its earliest releases, Kubernetes offered compatibility with one container runtime: Docker. Later in the Kubernetes project's history, cluster operators wanted to adopt additional container runtimes. The CRI was designed to allow this kind of flexibility - and the kubelet began supporting CRI. However, because Docker existed before the CRI specification was invented, the Kubernetes project created an adapter component, dockershim. The dockershim adapter allows the kubelet to interact with Docker as if Docker were a CRI compatible runtime.You can re


Question: What is Check whether dockershim removal affects you?

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


Question: What is Finding if your app has a dependencies on Docker?

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


Question: What is Dependency on Docker explained?

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


Question: What is Note:?

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


Question: What is Some filesystem metrics are missing and the metrics format is different?

Answer: T h e   K u b e l e t   / m e t r i c s / c a d v i s o r   e n d p o i n t   p r o v i d e s   P r o m e t h e u s   m e t r i c s ,   a s   d o c u m e n t e d   i n   M e t r i c s   f o r   K u b e r n e t e s   s y s t e m   c o m p o n e n t s .   I f   y o u   i n s t a l l   a   m e t r i c s   c o l l e c t o r   t h a t   d e p e n d s   o n   t h a t   e n d p o i n t ,   y o u   m i g h t   s e e   t h e   f o l l o w i n g   i s s u e s :   T h e   m e t r i c s   f o r m a t   o n   t h e   D o c k e r   n o d e   i s   k 8 s _ < c o n t a i n e r - n a m e > _ < p o d - n a m e > _ < n a m e s p a c e > _ < p o d - u i d > _ < r e s t a r t - c o u n t >   b u t   t h e   f o r m a t   o n   o t h e r   r u n t i m e   i s   d i f f e r e n t .   F o r   e x a m p l e ,   o n   c o n t a i n e r d   n o d e   i t   i s   < c o n t a i n e r - i d > . S o m e   f i l e s y s t e m   m e t r i c s   a r e   m i s s i n g ,   a s   f o l l o w s : c o n t a i n e r _ f s _ i n o d e s _ f r e e   c o n t a i n e r _ f s _ i n o d e s _ t o t a l   c o n t a i n e r _ f s _ i o _ c u r r e n t   c o n t a i n e r _ f s _ i o _ t i m e _ s e c o n d s _ t o t a l   c o n t a i n e r _ f s _ i o _ t i m e _ w e i g h t e d _ s e c o n d s _ t o t a l   c o n t a i n e r _ f s _ l i m i t _ b y t e s   c o n t a i n e r _ f s _ r e a d _ s e c o n d s _ t o t a l   c o n t a i n e r _ f s _ r e a d s _ m e r g e d _ t o t a l   c o n t a i n e r _ f s _ s e c t o r _ r e a d s _ t o t a l   c o n t a i n e r _ f s _ s e c t o r _ w r i t e s _ t o t a l   c o n t a i n e r _ f s _ u s a g e _ b y t e s   c o n t a i n e r _ f s _ w r i t e _ s e c o n d s _ t o t a l   c o n t a i n e r _ f s _ w r i t e s _ m e r g e d _ t o t a l   c o n t a i n e r _ f s _ i n o d e s _ f r e e   c o n t a i n e r _ f s _ i n o d e s _ t o t a l   c o n t a i n e r _ f s _ i o _ c u r r e n t   c o n t a i n e r _ f s _ i o _ t i m e _ s e c o n d s _ t o t a l   c o n t


Question: What is Workaround?

Answer: Y o u   c a n   m i t i g a t e   t h i s   i s s u e   b y   u s i n g   c A d v i s o r   a s   a   s t a n d a l o n e   d a e m o n s e t .   F i n d   t h e   l a t e s t   c A d v i s o r   r e l e a s e   w i t h   t h e   n a m e   p a t t e r n   v X . Y . Z - c o n t a i n e r d - c r i   ( f o r   e x a m p l e ,   v 0 . 4 2 . 0 - c o n t a i n e r d - c r i ) . F o l l o w   t h e   s t e p s   i n   c A d v i s o r   K u b e r n e t e s   D a e m o n s e t   t o   c r e a t e   t h e   d a e m o n s e t . P o i n t   t h e   i n s t a l l e d   m e t r i c s   c o l l e c t o r   t o   u s e   t h e   c A d v i s o r   / m e t r i c s   e n d p o i n t   w h i c h   p r o v i d e s   t h e   f u l l   s e t   o f   P r o m e t h e u s   c o n t a i n e r   m e t r i c s .   A l t e r n a t i v e s :   U s e   a l t e r n a t i v e   t h i r d   p a r t y   m e t r i c s   c o l l e c t i o n   s o l u t i o n . C o l l e c t   m e t r i c s   f r o m   t h e   K u b e l e t   s u m m a r y   A P I   t h a t   i s   s e r v e d   a t   / s t a t s / s u m m a r y .


Question: What is What's next?

Answer: R e a d   M i g r a t i n g   f r o m   d o c k e r s h i m   t o   u n d e r s t a n d   y o u r   n e x t   s t e p s R e a d   t h e   d o c k e r s h i m   d e p r e c a t i o n   F A Q   a r t i c l e   f o r   m o r e   i n f o r m a t i o n .


Question: What is kubectl create configmap?

Answer: kubectl create configmapSynopsisCreate a config map based on a file, directory, or specified literal value.A single config map may package one or more key/value pairs.When creating a config map based on a file, the key will default to the basename of the file, and the value will default to the file content. If the basename is an invalid key, you may specify an alternate key.When creating a config map based on a directory, each file whose basename is a valid key in the directory will be packaged into the config map. Any directory entries except regular files are ignored (e.g. subdirectories, symlinks, devices, pipes, etc).kubectl create configmap NAME [--from-file=[key=]source] [--from-literal=key1=value1] [--dry-run=server|client|none] Examples # Create a new config map named my-config based on folder bar kubectl create configmap my-config --from-file=path/to/bar # Create a new config map named my-config with specified keys instead of file basenames on disk kubectl create configmap my-config --from-file=key1=/path/to/bar/file1.txt --from-file=key2=/path/to/bar/file2.txt # Create a new config map named my-config with key1=config1 and key2=config2 kubectl create configmap my-config --from-literal=key1=config1 --from-literal=key2=config2 # Create a new config map named my-config from the key=value pairs in the file kubectl create configmap my-config --from-file=path/to/bar # Create a new config map named my-config from an env file kubectl create configmap my-config --from-env-file=path/to/foo.env --from-env-file=path/to/bar.env Options--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.--append-hashAppend a hash of the configmap to its name.--dry-run string[="unchanged"] Default: "none"Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.--field-manager string Default: "kubectl-create"Name of the manager used to track field ownership.--from-env-file stringsSpecify the path to a file to read lines of key=val pairs to create a configmap.--from-file stringsKey file can be specified using its file path, in which case file basename will be used as configmap key, or optionally with a key and file path, in which case the given key will be used. Specifying a directory will iterate each named file in the directory whose basename is a valid configmap key.--from-literal stringsSpecify a key and literal value to insert in configmap (i.e. mykey=somevalue)-h, --helphelp for configmap-o, --output stringOutput format. One of: (json, yaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file).--save-configIf true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is us


Question: How does kubectl create configmap work?

Answer: kubectl create configmapSynopsisCreate a config map based on a file, directory, or specified literal value.A single config map may package one or more key/value pairs.When creating a config map based on a file, the key will default to the basename of the file, and the value will default to the file content. If the basename is an invalid key, you may specify an alternate key.When creating a config map based on a directory, each file whose basename is a valid key in the directory will be packaged into the config map. Any directory entries except regular files are ignored (e.g. subdirectories, symlinks, devices, pipes, etc).kubectl create configmap NAME [--from-file=[key=]source] [--from-literal=key1=value1] [--dry-run=server|client|none] Examples # Create a new config map named my-config based on folder bar kubectl create configmap my-config --from-file=path/to/bar # Create a new config map named my-config with specified keys instead of file basenames on disk kubectl create configmap my-config --from-file=key1=/path/to/bar/file1.txt --from-file=key2=/path/to/bar/file2.txt # Create a new config map named my-config with key1=config1 and key2=config2 kubectl create configmap my-config --from-literal=key1=config1 --from-literal=key2=config2 # Create a new config map named my-config from the key=value pairs in the file kubectl create configmap my-config --from-file=path/to/bar # Create a new config map named my-config from an env file kubectl create configmap my-config --from-env-file=path/to/foo.env --from-env-file=path/to/bar.env Options--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.--append-hashAppend a hash of the configmap to its name.--dry-run string[="unchanged"] Default: "none"Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.--field-manager string Default: "kubectl-create"Name of the manager used to track field ownership.--from-env-file stringsSpecify the path to a file to read lines of key=val pairs to create a configmap.--from-file stringsKey file can be specified using its file path, in which case file basename will be used as configmap key, or optionally with a key and file path, in which case the given key will be used. Specifying a directory will iterate each named file in the directory whose basename is a valid configmap key.--from-literal stringsSpecify a key and literal value to insert in configmap (i.e. mykey=somevalue)-h, --helphelp for configmap-o, --output stringOutput format. One of: (json, yaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file).--save-configIf true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is us


Question: When would you use kubectl create configmap?

Answer: kubectl create configmapSynopsisCreate a config map based on a file, directory, or specified literal value.A single config map may package one or more key/value pairs.When creating a config map based on a file, the key will default to the basename of the file, and the value will default to the file content. If the basename is an invalid key, you may specify an alternate key.When creating a config map based on a directory, each file whose basename is a valid key in the directory will be packaged into the config map. Any directory entries except regular files are ignored (e.g. subdirectories, symlinks, devices, pipes, etc).kubectl create configmap NAME [--from-file=[key=]source] [--from-literal=key1=value1] [--dry-run=server|client|none] Examples # Create a new config map named my-config based on folder bar kubectl create configmap my-config --from-file=path/to/bar # Create a new config map named my-config with specified keys instead of file basenames on disk kubectl create configmap my-config --from-file=key1=/path/to/bar/file1.txt --from-file=key2=/path/to/bar/file2.txt # Create a new config map named my-config with key1=config1 and key2=config2 kubectl create configmap my-config --from-literal=key1=config1 --from-literal=key2=config2 # Create a new config map named my-config from the key=value pairs in the file kubectl create configmap my-config --from-file=path/to/bar # Create a new config map named my-config from an env file kubectl create configmap my-config --from-env-file=path/to/foo.env --from-env-file=path/to/bar.env Options--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.--append-hashAppend a hash of the configmap to its name.--dry-run string[="unchanged"] Default: "none"Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.--field-manager string Default: "kubectl-create"Name of the manager used to track field ownership.--from-env-file stringsSpecify the path to a file to read lines of key=val pairs to create a configmap.--from-file stringsKey file can be specified using its file path, in which case file basename will be used as configmap key, or optionally with a key and file path, in which case the given key will be used. Specifying a directory will iterate each named file in the directory whose basename is a valid configmap key.--from-literal stringsSpecify a key and literal value to insert in configmap (i.e. mykey=somevalue)-h, --helphelp for configmap-o, --output stringOutput format. One of: (json, yaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file).--save-configIf true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is us


Question: What are the benefits of kubectl create configmap?

Answer: kubectl create configmapSynopsisCreate a config map based on a file, directory, or specified literal value.A single config map may package one or more key/value pairs.When creating a config map based on a file, the key will default to the basename of the file, and the value will default to the file content. If the basename is an invalid key, you may specify an alternate key.When creating a config map based on a directory, each file whose basename is a valid key in the directory will be packaged into the config map. Any directory entries except regular files are ignored (e.g. subdirectories, symlinks, devices, pipes, etc).kubectl create configmap NAME [--from-file=[key=]source] [--from-literal=key1=value1] [--dry-run=server|client|none] Examples # Create a new config map named my-config based on folder bar kubectl create configmap my-config --from-file=path/to/bar # Create a new config map named my-config with specified keys instead of file basenames on disk kubectl create configmap my-config --from-file=key1=/path/to/bar/file1.txt --from-file=key2=/path/to/bar/file2.txt # Create a new config map named my-config with key1=config1 and key2=config2 kubectl create configmap my-config --from-literal=key1=config1 --from-literal=key2=config2 # Create a new config map named my-config from the key=value pairs in the file kubectl create configmap my-config --from-file=path/to/bar # Create a new config map named my-config from an env file kubectl create configmap my-config --from-env-file=path/to/foo.env --from-env-file=path/to/bar.env Options--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.--append-hashAppend a hash of the configmap to its name.--dry-run string[="unchanged"] Default: "none"Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.--field-manager string Default: "kubectl-create"Name of the manager used to track field ownership.--from-env-file stringsSpecify the path to a file to read lines of key=val pairs to create a configmap.--from-file stringsKey file can be specified using its file path, in which case file basename will be used as configmap key, or optionally with a key and file path, in which case the given key will be used. Specifying a directory will iterate each named file in the directory whose basename is a valid configmap key.--from-literal stringsSpecify a key and literal value to insert in configmap (i.e. mykey=somevalue)-h, --helphelp for configmap-o, --output stringOutput format. One of: (json, yaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file).--save-configIf true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is us


Question: What is Synopsis?

Answer: C r e a t e   a   c o n f i g   m a p   b a s e d   o n   a   f i l e ,   d i r e c t o r y ,   o r   s p e c i f i e d   l i t e r a l   v a l u e .   A   s i n g l e   c o n f i g   m a p   m a y   p a c k a g e   o n e   o r   m o r e   k e y / v a l u e   p a i r s .   W h e n   c r e a t i n g   a   c o n f i g   m a p   b a s e d   o n   a   f i l e ,   t h e   k e y   w i l l   d e f a u l t   t o   t h e   b a s e n a m e   o f   t h e   f i l e ,   a n d   t h e   v a l u e   w i l l   d e f a u l t   t o   t h e   f i l e   c o n t e n t .   I f   t h e   b a s e n a m e   i s   a n   i n v a l i d   k e y ,   y o u   m a y   s p e c i f y   a n   a l t e r n a t e   k e y .   W h e n   c r e a t i n g   a   c o n f i g   m a p   b a s e d   o n   a   d i r e c t o r y ,   e a c h   f i l e   w h o s e   b a s e n a m e   i s   a   v a l i d   k e y   i n   t h e   d i r e c t o r y   w i l l   b e   p a c k a g e d   i n t o   t h e   c o n f i g   m a p .   A n y   d i r e c t o r y   e n t r i e s   e x c e p t   r e g u l a r   f i l e s   a r e   i g n o r e d   ( e . g .   s u b d i r e c t o r i e s ,   s y m l i n k s ,   d e v i c e s ,   p i p e s ,   e t c ) .   k u b e c t l   c r e a t e   c o n f i g m a p   N A M E   [ - - f r o m - f i l e = [ k e y = ] s o u r c e ]   [ - - f r o m - l i t e r a l = k e y 1 = v a l u e 1 ]   [ - - d r y - r u n = s e r v e r | c l i e n t | n o n e ]


Question: What is Examples?

Answer: #   C r e a t e   a   n e w   c o n f i g   m a p   n a m e d   m y - c o n f i g   b a s e d   o n   f o l d e r   b a r   k u b e c t l   c r e a t e   c o n f i g m a p   m y - c o n f i g   - - f r o m - f i l e = p a t h / t o / b a r   #   C r e a t e   a   n e w   c o n f i g   m a p   n a m e d   m y - c o n f i g   w i t h   s p e c i f i e d   k e y s   i n s t e a d   o f   f i l e   b a s e n a m e s   o n   d i s k   k u b e c t l   c r e a t e   c o n f i g m a p   m y - c o n f i g   - - f r o m - f i l e = k e y 1 = / p a t h / t o / b a r / f i l e 1 . t x t   - - f r o m - f i l e = k e y 2 = / p a t h / t o / b a r / f i l e 2 . t x t   #   C r e a t e   a   n e w   c o n f i g   m a p   n a m e d   m y - c o n f i g   w i t h   k e y 1 = c o n f i g 1   a n d   k e y 2 = c o n f i g 2   k u b e c t l   c r e a t e   c o n f i g m a p   m y - c o n f i g   - - f r o m - l i t e r a l = k e y 1 = c o n f i g 1   - - f r o m - l i t e r a l = k e y 2 = c o n f i g 2   #   C r e a t e   a   n e w   c o n f i g   m a p   n a m e d   m y - c o n f i g   f r o m   t h e   k e y = v a l u e   p a i r s   i n   t h e   f i l e   k u b e c t l   c r e a t e   c o n f i g m a p   m y - c o n f i g   - - f r o m - f i l e = p a t h / t o / b a r   #   C r e a t e   a   n e w   c o n f i g   m a p   n a m e d   m y - c o n f i g   f r o m   a n   e n v   f i l e   k u b e c t l   c r e a t e   c o n f i g m a p   m y - c o n f i g   - - f r o m - e n v - f i l e = p a t h / t o / f o o . e n v   - - f r o m - e n v - f i l e = p a t h / t o / b a r . e n v


Question: What is Options?

Answer: 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 .   A p p e n d   a   h a s h   o f   t h e   c o n f i g m a p   t o   i t s   n a m e .   M u s t   b e   " n o n e " ,   " s e r v e r " ,   o r   " c l i e n t " .   I f   c l i e n t   s t r a t e g y ,   o n l y   p r i n t   t h e   o b j e c t   t h a t   w o u l d   b e   s e n t ,   w i t h o u t   s e n d i n g   i t .   I f   s e r v e r   s t r a t e g y ,   s u b m i t   s e r v e r - s i d e   r e q u e s t   w i t h o u t   p e r s i s t i n g   t h e   r e s o u r c e .   N a m e   o f   t h e   m a n a g e r   u s e d   t o   t r a c k   f i e l d   o w n e r s h i p .   S p e c i f y   t h e   p a t h   t o   a   f i l e   t o   r e a d   l i n e s   o f   k e y = v a l   p a i r s   t o   c r e a t e   a   c o n f i g m a p .   K e y   f i l e   c a n   b e   s p e c i f i e d   u s i n g   i t s   f i l e   p a t h ,   i n   w h i c h   c a s e   f i l e   b a s e n a m e   w i l l   b e   u s e d   a s   c o n f i g m a p   k e y ,   o r   o p t i o n a l l y   w i t h   a   k e y   a n d   f i l e   p a t h ,   i n   w h i c h   c a s e   t h e   g i v e n   k e y   w i l l   b e   u s e d .   S p e c i f y i n g   a   d i r e c t o r y   w i l l   i t e r a t e   e a c h   n a m e d   f i l e   i n   t h e   d i r e c t o r y   w h o s e   b a s e n a m e   i s   a   v a l i d   c o n f i g m a p   k e y .   S p e c i f y   a   k e y   a n d   l i t e r a l   v a l u e   t o   i n s e r t   i n   c o n f i g m a p   ( i . e .   m y k e y = s o m e v a l u e )   h e l p   f o r   c o n f i g m a p   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


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   c r e a t e   -   C r e a t e   a   r e s o u r c e   f r o m   a   f i l e   o r   f r o m   s t d i n   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 kubectl top pod?

Answer: kubectl top podSynopsisDisplay resource (CPU/memory) usage of pods.The 'top pod' command allows you to see the resource consumption of pods.Due to the metrics pipeline delay, they may be unavailable for a few minutes since pod creation.kubectl top pod [NAME | -l label] Examples # Show metrics for all pods in the default namespace kubectl top pod # Show metrics for all pods in the given namespace kubectl top pod --namespace=NAMESPACE # Show metrics for a given pod and its containers kubectl top pod POD_NAME --containers # Show metrics for the pods defined by label name=myLabel kubectl top pod -l name=myLabel Options-A, --all-namespacesIf present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.--containersIf present, print usage of containers within a pod.--field-selector stringSelector (field query) to filter on, supports '=', '==', and '!='.(e.g. --field-selector key1=value1,key2=value2). The server only supports a limited number of field queries per type.-h, --helphelp for pod--no-headersIf present, print output without headers.-l, --selector stringSelector (label query) to filter on, supports '=', '==', '!=', 'in', 'notin'.(e.g. -l key1=value1,key2=value2,key3 in (value3)). Matching objects must satisfy all of the specified label constraints.--show-swapPrint pod resources related to swap memory.--sort-by stringIf non-empty, sort pods list using specified field. The field can be either 'cpu' or 'memory'.--sumPrint the sum of the resource usage--use-protocol-buffers Default: trueEnables using protocol-buffers to access Metrics API.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 connections insecure--kubeconfig stringPath to the kubeconfig file to use for CLI requests.--kuberc stringPath to the kuberc file to use for preferences. This can be disabled by exporting KUBECTL_KUBERC=false feature gate or turning off the feature KUBERC=off.--match-server-versionRequire server version to match client version-n, --namespace stringIf present, the namespace scope for this CLI request--password stringPassword for basic authentication to the AP


Question: How does kubectl top pod work?

Answer: kubectl top podSynopsisDisplay resource (CPU/memory) usage of pods.The 'top pod' command allows you to see the resource consumption of pods.Due to the metrics pipeline delay, they may be unavailable for a few minutes since pod creation.kubectl top pod [NAME | -l label] Examples # Show metrics for all pods in the default namespace kubectl top pod # Show metrics for all pods in the given namespace kubectl top pod --namespace=NAMESPACE # Show metrics for a given pod and its containers kubectl top pod POD_NAME --containers # Show metrics for the pods defined by label name=myLabel kubectl top pod -l name=myLabel Options-A, --all-namespacesIf present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.--containersIf present, print usage of containers within a pod.--field-selector stringSelector (field query) to filter on, supports '=', '==', and '!='.(e.g. --field-selector key1=value1,key2=value2). The server only supports a limited number of field queries per type.-h, --helphelp for pod--no-headersIf present, print output without headers.-l, --selector stringSelector (label query) to filter on, supports '=', '==', '!=', 'in', 'notin'.(e.g. -l key1=value1,key2=value2,key3 in (value3)). Matching objects must satisfy all of the specified label constraints.--show-swapPrint pod resources related to swap memory.--sort-by stringIf non-empty, sort pods list using specified field. The field can be either 'cpu' or 'memory'.--sumPrint the sum of the resource usage--use-protocol-buffers Default: trueEnables using protocol-buffers to access Metrics API.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 connections insecure--kubeconfig stringPath to the kubeconfig file to use for CLI requests.--kuberc stringPath to the kuberc file to use for preferences. This can be disabled by exporting KUBECTL_KUBERC=false feature gate or turning off the feature KUBERC=off.--match-server-versionRequire server version to match client version-n, --namespace stringIf present, the namespace scope for this CLI request--password stringPassword for basic authentication to the AP


Question: When would you use kubectl top pod?

Answer: kubectl top podSynopsisDisplay resource (CPU/memory) usage of pods.The 'top pod' command allows you to see the resource consumption of pods.Due to the metrics pipeline delay, they may be unavailable for a few minutes since pod creation.kubectl top pod [NAME | -l label] Examples # Show metrics for all pods in the default namespace kubectl top pod # Show metrics for all pods in the given namespace kubectl top pod --namespace=NAMESPACE # Show metrics for a given pod and its containers kubectl top pod POD_NAME --containers # Show metrics for the pods defined by label name=myLabel kubectl top pod -l name=myLabel Options-A, --all-namespacesIf present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.--containersIf present, print usage of containers within a pod.--field-selector stringSelector (field query) to filter on, supports '=', '==', and '!='.(e.g. --field-selector key1=value1,key2=value2). The server only supports a limited number of field queries per type.-h, --helphelp for pod--no-headersIf present, print output without headers.-l, --selector stringSelector (label query) to filter on, supports '=', '==', '!=', 'in', 'notin'.(e.g. -l key1=value1,key2=value2,key3 in (value3)). Matching objects must satisfy all of the specified label constraints.--show-swapPrint pod resources related to swap memory.--sort-by stringIf non-empty, sort pods list using specified field. The field can be either 'cpu' or 'memory'.--sumPrint the sum of the resource usage--use-protocol-buffers Default: trueEnables using protocol-buffers to access Metrics API.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 connections insecure--kubeconfig stringPath to the kubeconfig file to use for CLI requests.--kuberc stringPath to the kuberc file to use for preferences. This can be disabled by exporting KUBECTL_KUBERC=false feature gate or turning off the feature KUBERC=off.--match-server-versionRequire server version to match client version-n, --namespace stringIf present, the namespace scope for this CLI request--password stringPassword for basic authentication to the AP


Question: What are the benefits of kubectl top pod?

Answer: kubectl top podSynopsisDisplay resource (CPU/memory) usage of pods.The 'top pod' command allows you to see the resource consumption of pods.Due to the metrics pipeline delay, they may be unavailable for a few minutes since pod creation.kubectl top pod [NAME | -l label] Examples # Show metrics for all pods in the default namespace kubectl top pod # Show metrics for all pods in the given namespace kubectl top pod --namespace=NAMESPACE # Show metrics for a given pod and its containers kubectl top pod POD_NAME --containers # Show metrics for the pods defined by label name=myLabel kubectl top pod -l name=myLabel Options-A, --all-namespacesIf present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.--containersIf present, print usage of containers within a pod.--field-selector stringSelector (field query) to filter on, supports '=', '==', and '!='.(e.g. --field-selector key1=value1,key2=value2). The server only supports a limited number of field queries per type.-h, --helphelp for pod--no-headersIf present, print output without headers.-l, --selector stringSelector (label query) to filter on, supports '=', '==', '!=', 'in', 'notin'.(e.g. -l key1=value1,key2=value2,key3 in (value3)). Matching objects must satisfy all of the specified label constraints.--show-swapPrint pod resources related to swap memory.--sort-by stringIf non-empty, sort pods list using specified field. The field can be either 'cpu' or 'memory'.--sumPrint the sum of the resource usage--use-protocol-buffers Default: trueEnables using protocol-buffers to access Metrics API.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 connections insecure--kubeconfig stringPath to the kubeconfig file to use for CLI requests.--kuberc stringPath to the kuberc file to use for preferences. This can be disabled by exporting KUBECTL_KUBERC=false feature gate or turning off the feature KUBERC=off.--match-server-versionRequire server version to match client version-n, --namespace stringIf present, the namespace scope for this CLI request--password stringPassword for basic authentication to the AP


Question: What is Synopsis?

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


Question: What is Examples?

Answer: #   S h o w   m e t r i c s   f o r   a l l   p o d 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   t o p   p o d   #   S h o w   m e t r i c s   f o r   a l l   p o d s   i n   t h e   g i v e n   n a m e s p a c e   k u b e c t l   t o p   p o d   - - n a m e s p a c e = N A M E S P A C E   #   S h o w   m e t r i c s   f o r   a   g i v e n   p o d   a n d   i t s   c o n t a i n e r s   k u b e c t l   t o p   p o d   P O D _ N A M E   - - c o n t a i n e r s   #   S h o w   m e t r i c s   f o r   t h e   p o d s   d e f i n e d   b y   l a b e l   n a m e = m y L a b e l   k u b e c t l   t o p   p o d   - l   n a m e = m y L a b e 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   p r e s e n t ,   p r i n t   u s a g e   o f   c o n t a i n e r s   w i t h i n   a   p o d .   S e l e c t o r   ( f i e l d   q u e r y )   t o   f i l t e r   o n ,   s u p p o r t s   ' = ' ,   ' = = ' ,   a n d   ' ! = ' . ( e . g .   - - f i e l d - s e l e c t o r   k e y 1 = v a l u e 1 , k e y 2 = v a l u e 2 ) .   T h e   s e r v e r   o n l y   s u p p o r t s   a   l i m i t e d   n u m b e r   o f   f i e l d   q u e r i e s   p e r   t y p e .   h e l p   f o r   p o d   I f   p r e s e n t ,   p r i n t   o u t p u t   w i t h o u t   h e a d e r s .   S e l e c t o r   ( l a b e l   q u e r y )   t o   f i l t e r   o n ,   s u p p o r t s   ' = ' ,   ' = = ' ,   ' ! = ' ,   ' i n ' ,   ' n o t i n ' . ( e . g .   - l   k e y 1 = v a l u e 1 , k e y 2 = v a l u e 2 , k e y 3   i n   ( v a l u e 3 ) ) .   M a t c h i n g   o b j e c t s   m u s t   s a t i s f y   a l l   o f   t h e   s p e c i f i e d   l a b e l   c o n s t r a i n t s .   P r i n t   p o d   r e s o u r c e s   r e l a t e d   t o   s w a p   m e m o r y .   I f   n o n - e m p t y ,   s o r t   p o d s   l i s t   u s i n g   s p e c i f i e d   f i e l d .   T h e   f i e l d   c a n   b e   e i t h e r   ' c p u '   o r   ' m e m o r y ' .   P r i n t   t h e   s u m   o f   t h e   r e s o u r c e   u s a g e   E n a b l e s   u s i n g   p r o t o c o l - b u f f e r s   t o   a c c e s s   M e t r i c s   A P I .


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   t o p   -   D i s p l a y   r e s o u r c e   ( C P U / m e m o r y )   u s a g e   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 Autoscale the DNS Service in a Cluster?

Answer: Autoscale the DNS Service in a ClusterThis page shows how to enable and configure autoscaling of the DNS service in your Kubernetes cluster.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.This guide assumes your nodes use the AMD64 or Intel 64 CPU architecture.Make sure Kubernetes DNS is enabled.Determine whether DNS horizontal autoscaling is already enabledList the Deployments in your cluster in the kube-system namespace:kubectl get deployment --namespace=kube-system The output is similar to this:NAME READY UP-TO-DATE AVAILABLE AGE ... kube-dns-autoscaler 1/1 1 1 ... ... If you see "kube-dns-autoscaler" in the output, DNS horizontal autoscaling is already enabled, and you can skip to Tuning autoscaling parameters.Get the name of your DNS DeploymentList the DNS deployments in your cluster in the kube-system namespace:kubectl get deployment -l k8s-app=kube-dns --namespace=kube-system The output is similar to this:NAME READY UP-TO-DATE AVAILABLE AGE ... coredns 2/2 2 2 ... ... If you don't see a Deployment for DNS services, you can also look for it by name:kubectl get deployment --namespace=kube-system and look for a deployment named coredns or kube-dns.Your scale target isDeployment/<your-deployment-name> where <your-deployment-name> is the name of your DNS Deployment. For example, if the name of your Deployment for DNS is coredns, your scale target is Deployment/coredns.Note:CoreDNS is the default DNS service for Kubernetes. CoreDNS sets the label k8s-app=kube-dns so that it can work in clusters that originally used kube-dns.Enable DNS horizontal autoscalingIn this section, you create a new Deployment. The Pods in the Deployment run a container based on the cluster-proportional-autoscaler-amd64 image.Create a file named dns-horizontal-autoscaler.yaml with this content:admin/dns/dns-horizontal-autoscaler.yaml kind: ServiceAccount apiVersion: v1 metadata: name: kube-dns-autoscaler namespace: kube-system --- kind: ClusterRole apiVersion: rbac.authorization.k8s.io/v1 metadata: name: system:kube-dns-autoscaler rules: - apiGroups: [""] resources: ["nodes"] verbs: ["list", "watch"] - apiGroups: [""] resources: ["replicationcontrollers/scale"] verbs: ["get", "update"] - apiGroups: ["apps"] resources: ["deployments/scale", "replicasets/scale"] verbs: ["get", "update"] # Remove the configmaps rule once below issue is fixed: # kubernetes-incubator/cluster-proportional-autoscaler#16 - apiGroups: [""] resources: ["configmaps"] verbs: ["get", "create"] --- kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: na


Question: How does Autoscale the DNS Service in a Cluster work?

Answer: Autoscale the DNS Service in a ClusterThis page shows how to enable and configure autoscaling of the DNS service in your Kubernetes cluster.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.This guide assumes your nodes use the AMD64 or Intel 64 CPU architecture.Make sure Kubernetes DNS is enabled.Determine whether DNS horizontal autoscaling is already enabledList the Deployments in your cluster in the kube-system namespace:kubectl get deployment --namespace=kube-system The output is similar to this:NAME READY UP-TO-DATE AVAILABLE AGE ... kube-dns-autoscaler 1/1 1 1 ... ... If you see "kube-dns-autoscaler" in the output, DNS horizontal autoscaling is already enabled, and you can skip to Tuning autoscaling parameters.Get the name of your DNS DeploymentList the DNS deployments in your cluster in the kube-system namespace:kubectl get deployment -l k8s-app=kube-dns --namespace=kube-system The output is similar to this:NAME READY UP-TO-DATE AVAILABLE AGE ... coredns 2/2 2 2 ... ... If you don't see a Deployment for DNS services, you can also look for it by name:kubectl get deployment --namespace=kube-system and look for a deployment named coredns or kube-dns.Your scale target isDeployment/<your-deployment-name> where <your-deployment-name> is the name of your DNS Deployment. For example, if the name of your Deployment for DNS is coredns, your scale target is Deployment/coredns.Note:CoreDNS is the default DNS service for Kubernetes. CoreDNS sets the label k8s-app=kube-dns so that it can work in clusters that originally used kube-dns.Enable DNS horizontal autoscalingIn this section, you create a new Deployment. The Pods in the Deployment run a container based on the cluster-proportional-autoscaler-amd64 image.Create a file named dns-horizontal-autoscaler.yaml with this content:admin/dns/dns-horizontal-autoscaler.yaml kind: ServiceAccount apiVersion: v1 metadata: name: kube-dns-autoscaler namespace: kube-system --- kind: ClusterRole apiVersion: rbac.authorization.k8s.io/v1 metadata: name: system:kube-dns-autoscaler rules: - apiGroups: [""] resources: ["nodes"] verbs: ["list", "watch"] - apiGroups: [""] resources: ["replicationcontrollers/scale"] verbs: ["get", "update"] - apiGroups: ["apps"] resources: ["deployments/scale", "replicasets/scale"] verbs: ["get", "update"] # Remove the configmaps rule once below issue is fixed: # kubernetes-incubator/cluster-proportional-autoscaler#16 - apiGroups: [""] resources: ["configmaps"] verbs: ["get", "create"] --- kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: na


Question: When would you use Autoscale the DNS Service in a Cluster?

Answer: Autoscale the DNS Service in a ClusterThis page shows how to enable and configure autoscaling of the DNS service in your Kubernetes cluster.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.This guide assumes your nodes use the AMD64 or Intel 64 CPU architecture.Make sure Kubernetes DNS is enabled.Determine whether DNS horizontal autoscaling is already enabledList the Deployments in your cluster in the kube-system namespace:kubectl get deployment --namespace=kube-system The output is similar to this:NAME READY UP-TO-DATE AVAILABLE AGE ... kube-dns-autoscaler 1/1 1 1 ... ... If you see "kube-dns-autoscaler" in the output, DNS horizontal autoscaling is already enabled, and you can skip to Tuning autoscaling parameters.Get the name of your DNS DeploymentList the DNS deployments in your cluster in the kube-system namespace:kubectl get deployment -l k8s-app=kube-dns --namespace=kube-system The output is similar to this:NAME READY UP-TO-DATE AVAILABLE AGE ... coredns 2/2 2 2 ... ... If you don't see a Deployment for DNS services, you can also look for it by name:kubectl get deployment --namespace=kube-system and look for a deployment named coredns or kube-dns.Your scale target isDeployment/<your-deployment-name> where <your-deployment-name> is the name of your DNS Deployment. For example, if the name of your Deployment for DNS is coredns, your scale target is Deployment/coredns.Note:CoreDNS is the default DNS service for Kubernetes. CoreDNS sets the label k8s-app=kube-dns so that it can work in clusters that originally used kube-dns.Enable DNS horizontal autoscalingIn this section, you create a new Deployment. The Pods in the Deployment run a container based on the cluster-proportional-autoscaler-amd64 image.Create a file named dns-horizontal-autoscaler.yaml with this content:admin/dns/dns-horizontal-autoscaler.yaml kind: ServiceAccount apiVersion: v1 metadata: name: kube-dns-autoscaler namespace: kube-system --- kind: ClusterRole apiVersion: rbac.authorization.k8s.io/v1 metadata: name: system:kube-dns-autoscaler rules: - apiGroups: [""] resources: ["nodes"] verbs: ["list", "watch"] - apiGroups: [""] resources: ["replicationcontrollers/scale"] verbs: ["get", "update"] - apiGroups: ["apps"] resources: ["deployments/scale", "replicasets/scale"] verbs: ["get", "update"] # Remove the configmaps rule once below issue is fixed: # kubernetes-incubator/cluster-proportional-autoscaler#16 - apiGroups: [""] resources: ["configmaps"] verbs: ["get", "create"] --- kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: na


Question: What are the benefits of Autoscale the DNS Service in a Cluster?

Answer: Autoscale the DNS Service in a ClusterThis page shows how to enable and configure autoscaling of the DNS service in your Kubernetes cluster.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.This guide assumes your nodes use the AMD64 or Intel 64 CPU architecture.Make sure Kubernetes DNS is enabled.Determine whether DNS horizontal autoscaling is already enabledList the Deployments in your cluster in the kube-system namespace:kubectl get deployment --namespace=kube-system The output is similar to this:NAME READY UP-TO-DATE AVAILABLE AGE ... kube-dns-autoscaler 1/1 1 1 ... ... If you see "kube-dns-autoscaler" in the output, DNS horizontal autoscaling is already enabled, and you can skip to Tuning autoscaling parameters.Get the name of your DNS DeploymentList the DNS deployments in your cluster in the kube-system namespace:kubectl get deployment -l k8s-app=kube-dns --namespace=kube-system The output is similar to this:NAME READY UP-TO-DATE AVAILABLE AGE ... coredns 2/2 2 2 ... ... If you don't see a Deployment for DNS services, you can also look for it by name:kubectl get deployment --namespace=kube-system and look for a deployment named coredns or kube-dns.Your scale target isDeployment/<your-deployment-name> where <your-deployment-name> is the name of your DNS Deployment. For example, if the name of your Deployment for DNS is coredns, your scale target is Deployment/coredns.Note:CoreDNS is the default DNS service for Kubernetes. CoreDNS sets the label k8s-app=kube-dns so that it can work in clusters that originally used kube-dns.Enable DNS horizontal autoscalingIn this section, you create a new Deployment. The Pods in the Deployment run a container based on the cluster-proportional-autoscaler-amd64 image.Create a file named dns-horizontal-autoscaler.yaml with this content:admin/dns/dns-horizontal-autoscaler.yaml kind: ServiceAccount apiVersion: v1 metadata: name: kube-dns-autoscaler namespace: kube-system --- kind: ClusterRole apiVersion: rbac.authorization.k8s.io/v1 metadata: name: system:kube-dns-autoscaler rules: - apiGroups: [""] resources: ["nodes"] verbs: ["list", "watch"] - apiGroups: [""] resources: ["replicationcontrollers/scale"] verbs: ["get", "update"] - apiGroups: ["apps"] resources: ["deployments/scale", "replicasets/scale"] verbs: ["get", "update"] # Remove the configmaps rule once below issue is fixed: # kubernetes-incubator/cluster-proportional-autoscaler#16 - apiGroups: [""] resources: ["configmaps"] verbs: ["get", "create"] --- kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: na


Question: What is Autoscale the DNS Service in a Cluster?

Answer: T h i s   p a g e   s h o w s   h o w   t o   e n a b l e   a n d   c o n f i g u r e   a u t o s c a l i n g   o f   t h e   D N S   s e r v i c e   i n   y o u r   K u b e r n e t e s   c l u s t e r .