Question: What is kubeadm kubeconfig user?

Answer: T h i s   c o m m a n d   c a n   b e   u s e d   t o   o u t p u t   a   k u b e c o n f i g   f i l e   f o r   a n   a d d i t i o n a l   u s e r .   S y n o p s i s O u t p u t   a   k u b e c o n f i g   f i l e   f o r   a n   a d d i t i o n a l   u s e r . k u b e a d m   k u b e c o n f i g   u s e r   [ f l a g s ]   E x a m p l e s   #   O u t p u t   a   k u b e c o n f i g   f i l e   f o r   a n   a d d i t i o n a l   u s e r   n a m e d   f o o   k u b e a d m   k u b e c o n f i g   u s e r   - - c l i e n t - n a m e = f o o   #   O u t p u t   a   k u b e c o n f i g   f i l e   f o r   a n   a d d i t i o n a l   u s e r   n a m e d   f o o   u s i n g   a   k u b e a d m   c o n f i g   f i l e   b a r   k u b e a d m   k u b e c o n f i g   u s e r   - - c l i e n t - n a m e = f o o   - - c o n f i g = b a r   O p t i o n s - - c l i e n t - n a m e   s t r i n g T h e   n a m e   o f   u s e r .   I t   w i l l   b e   u s e d   a s   t h e   C N   i f   c l i e n t   c e r t i f i c a t e s   a r e   c r e a t e d - - c o n f i g   s t r i n g P a t h   t o   a   k u b e a d m   c o n f i g u r a t i o n   f i l e . - h ,   - - h e l p h e l p   f o r   u s e r - - o r g   s t r i n g s T h e   o r g a n i z a t i o n s   o f   t h e   c l i e n t   c e r t i f i c a t e .   I t   w i l l   b e   u s e d   a s   t h e   O   i f   c l i e n t   c e r t i f i c a t e s   a r e   c r e a t e d - - t o k e n   s t r i n g T h e   t o k e n   t h a t   s h o u l d   b e   u s e d   a s   t h e   a u t h e n t i c a t i o n   m e c h a n i s m   f o r   t h i s   k u b e c o n f i g ,   i n s t e a d   o f   c l i e n t   c e r t i f i c a t e s - - v a l i d i t y - p e r i o d   d u r a t i o n   D e f a u l t :   8 7 6 0 h 0 m 0 s T h e   v a l i d i t y   p e r i o d   o f   t h e   c l i e n t   c e r t i f i c a t e .   I t   i s   a n   o f f s e t   f r o m   t h e   c u r r e n t   t i m e . O p t i o n s   i n h e r i t e d   f r o m


Question: What is Synopsis?

Answer: O u t p u t   a   k u b e c o n f i g   f i l e   f o r   a n   a d d i t i o n a l   u s e r .   k u b e a d m   k u b e c o n f i g   u s e r   [ f l a g s ]


Question: What is Examples?

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


Question: What is Options?

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


Question: What is Options inherited from parent commands?

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


Question: What is kubectl edit?

Answer: kubectl editSynopsisEdit a resource from the default editor.The edit command allows you to directly edit any API resource you can retrieve via the command-line tools. It will open the editor defined by your KUBE_EDITOR, or EDITOR environment variables, or fall back to 'vi' for Linux or 'notepad' for Windows. When attempting to open the editor, it will first attempt to use the shell that has been defined in the 'SHELL' environment variable. If this is not defined, the default shell will be used, which is '/bin/bash' for Linux or 'cmd' for Windows.You can edit multiple objects, although changes are applied one at a time. The command accepts file names as well as command-line arguments, although the files you point to must be previously saved versions of resources.Editing is done with the API version used to fetch the resource. To edit using a specific API version, fully-qualify the resource, version, and group.The default format is YAML. To edit in JSON, specify "-o json".The flag --windows-line-endings can be used to force Windows line endings, otherwise the default for your operating system will be used.In the event an error occurs while updating, a temporary file will be created on disk that contains your unapplied changes. The most common error when updating a resource is another editor changing the resource on the server. When this occurs, you will have to apply your changes to the newer version of the resource, or update your temporary saved copy to include the latest resource version.kubectl edit (RESOURCE/NAME | -f FILENAME) Examples # Edit the service named 'registry' kubectl edit svc/registry # Use an alternative editor KUBE_EDITOR="nano" kubectl edit svc/registry # Edit the job 'myjob' in JSON using the v1 API format kubectl edit job.v1.batch/myjob -o json # Edit the deployment 'mydeployment' in YAML and save the modified config in its annotation kubectl edit deployment/mydeployment -o yaml --save-config # Edit the 'status' subresource for the 'mydeployment' deployment kubectl edit deployment mydeployment --subresource='status' 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.--field-manager string Default: "kubectl-edit"Name of the manager used to track field ownership.-f, --filename stringsFilename, directory, or URL to files to use to edit the resource-h, --helphelp for edit-k, --kustomize stringProcess the kustomization directory. This flag can't be used together with -f or -R.-o, --output stringOutput format. One of: (json, yaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file).--output-patchOutput the patch if the resource is edited.-R, --recursiveProcess the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.--save-configIf true, the configuration of curren


Question: How does kubectl edit work?

Answer: kubectl editSynopsisEdit a resource from the default editor.The edit command allows you to directly edit any API resource you can retrieve via the command-line tools. It will open the editor defined by your KUBE_EDITOR, or EDITOR environment variables, or fall back to 'vi' for Linux or 'notepad' for Windows. When attempting to open the editor, it will first attempt to use the shell that has been defined in the 'SHELL' environment variable. If this is not defined, the default shell will be used, which is '/bin/bash' for Linux or 'cmd' for Windows.You can edit multiple objects, although changes are applied one at a time. The command accepts file names as well as command-line arguments, although the files you point to must be previously saved versions of resources.Editing is done with the API version used to fetch the resource. To edit using a specific API version, fully-qualify the resource, version, and group.The default format is YAML. To edit in JSON, specify "-o json".The flag --windows-line-endings can be used to force Windows line endings, otherwise the default for your operating system will be used.In the event an error occurs while updating, a temporary file will be created on disk that contains your unapplied changes. The most common error when updating a resource is another editor changing the resource on the server. When this occurs, you will have to apply your changes to the newer version of the resource, or update your temporary saved copy to include the latest resource version.kubectl edit (RESOURCE/NAME | -f FILENAME) Examples # Edit the service named 'registry' kubectl edit svc/registry # Use an alternative editor KUBE_EDITOR="nano" kubectl edit svc/registry # Edit the job 'myjob' in JSON using the v1 API format kubectl edit job.v1.batch/myjob -o json # Edit the deployment 'mydeployment' in YAML and save the modified config in its annotation kubectl edit deployment/mydeployment -o yaml --save-config # Edit the 'status' subresource for the 'mydeployment' deployment kubectl edit deployment mydeployment --subresource='status' 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.--field-manager string Default: "kubectl-edit"Name of the manager used to track field ownership.-f, --filename stringsFilename, directory, or URL to files to use to edit the resource-h, --helphelp for edit-k, --kustomize stringProcess the kustomization directory. This flag can't be used together with -f or -R.-o, --output stringOutput format. One of: (json, yaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file).--output-patchOutput the patch if the resource is edited.-R, --recursiveProcess the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.--save-configIf true, the configuration of curren


Question: When would you use kubectl edit?

Answer: kubectl editSynopsisEdit a resource from the default editor.The edit command allows you to directly edit any API resource you can retrieve via the command-line tools. It will open the editor defined by your KUBE_EDITOR, or EDITOR environment variables, or fall back to 'vi' for Linux or 'notepad' for Windows. When attempting to open the editor, it will first attempt to use the shell that has been defined in the 'SHELL' environment variable. If this is not defined, the default shell will be used, which is '/bin/bash' for Linux or 'cmd' for Windows.You can edit multiple objects, although changes are applied one at a time. The command accepts file names as well as command-line arguments, although the files you point to must be previously saved versions of resources.Editing is done with the API version used to fetch the resource. To edit using a specific API version, fully-qualify the resource, version, and group.The default format is YAML. To edit in JSON, specify "-o json".The flag --windows-line-endings can be used to force Windows line endings, otherwise the default for your operating system will be used.In the event an error occurs while updating, a temporary file will be created on disk that contains your unapplied changes. The most common error when updating a resource is another editor changing the resource on the server. When this occurs, you will have to apply your changes to the newer version of the resource, or update your temporary saved copy to include the latest resource version.kubectl edit (RESOURCE/NAME | -f FILENAME) Examples # Edit the service named 'registry' kubectl edit svc/registry # Use an alternative editor KUBE_EDITOR="nano" kubectl edit svc/registry # Edit the job 'myjob' in JSON using the v1 API format kubectl edit job.v1.batch/myjob -o json # Edit the deployment 'mydeployment' in YAML and save the modified config in its annotation kubectl edit deployment/mydeployment -o yaml --save-config # Edit the 'status' subresource for the 'mydeployment' deployment kubectl edit deployment mydeployment --subresource='status' 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.--field-manager string Default: "kubectl-edit"Name of the manager used to track field ownership.-f, --filename stringsFilename, directory, or URL to files to use to edit the resource-h, --helphelp for edit-k, --kustomize stringProcess the kustomization directory. This flag can't be used together with -f or -R.-o, --output stringOutput format. One of: (json, yaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file).--output-patchOutput the patch if the resource is edited.-R, --recursiveProcess the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.--save-configIf true, the configuration of curren


Question: What are the benefits of kubectl edit?

Answer: kubectl editSynopsisEdit a resource from the default editor.The edit command allows you to directly edit any API resource you can retrieve via the command-line tools. It will open the editor defined by your KUBE_EDITOR, or EDITOR environment variables, or fall back to 'vi' for Linux or 'notepad' for Windows. When attempting to open the editor, it will first attempt to use the shell that has been defined in the 'SHELL' environment variable. If this is not defined, the default shell will be used, which is '/bin/bash' for Linux or 'cmd' for Windows.You can edit multiple objects, although changes are applied one at a time. The command accepts file names as well as command-line arguments, although the files you point to must be previously saved versions of resources.Editing is done with the API version used to fetch the resource. To edit using a specific API version, fully-qualify the resource, version, and group.The default format is YAML. To edit in JSON, specify "-o json".The flag --windows-line-endings can be used to force Windows line endings, otherwise the default for your operating system will be used.In the event an error occurs while updating, a temporary file will be created on disk that contains your unapplied changes. The most common error when updating a resource is another editor changing the resource on the server. When this occurs, you will have to apply your changes to the newer version of the resource, or update your temporary saved copy to include the latest resource version.kubectl edit (RESOURCE/NAME | -f FILENAME) Examples # Edit the service named 'registry' kubectl edit svc/registry # Use an alternative editor KUBE_EDITOR="nano" kubectl edit svc/registry # Edit the job 'myjob' in JSON using the v1 API format kubectl edit job.v1.batch/myjob -o json # Edit the deployment 'mydeployment' in YAML and save the modified config in its annotation kubectl edit deployment/mydeployment -o yaml --save-config # Edit the 'status' subresource for the 'mydeployment' deployment kubectl edit deployment mydeployment --subresource='status' 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.--field-manager string Default: "kubectl-edit"Name of the manager used to track field ownership.-f, --filename stringsFilename, directory, or URL to files to use to edit the resource-h, --helphelp for edit-k, --kustomize stringProcess the kustomization directory. This flag can't be used together with -f or -R.-o, --output stringOutput format. One of: (json, yaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file).--output-patchOutput the patch if the resource is edited.-R, --recursiveProcess the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.--save-configIf true, the configuration of curren


Question: What is Synopsis?

Answer: E d i t   a   r e s o u r c e   f r o m   t h e   d e f a u l t   e d i t o r .   T h e   e d i t   c o m m a n d   a l l o w s   y o u   t o   d i r e c t l y   e d i t   a n y   A P I   r e s o u r c e   y o u   c a n   r e t r i e v e   v i a   t h e   c o m m a n d - l i n e   t o o l s .   I t   w i l l   o p e n   t h e   e d i t o r   d e f i n e d   b y   y o u r   K U B E _ E D I T O R ,   o r   E D I T O R   e n v i r o n m e n t   v a r i a b l e s ,   o r   f a l l   b a c k   t o   ' v i '   f o r   L i n u x   o r   ' n o t e p a d '   f o r   W i n d o w s .   W h e n   a t t e m p t i n g   t o   o p e n   t h e   e d i t o r ,   i t   w i l l   f i r s t   a t t e m p t   t o   u s e   t h e   s h e l l   t h a t   h a s   b e e n   d e f i n e d   i n   t h e   ' S H E L L '   e n v i r o n m e n t   v a r i a b l e .   I f   t h i s   i s   n o t   d e f i n e d ,   t h e   d e f a u l t   s h e l l   w i l l   b e   u s e d ,   w h i c h   i s   ' / b i n / b a s h '   f o r   L i n u x   o r   ' c m d '   f o r   W i n d o w s .   Y o u   c a n   e d i t   m u l t i p l e   o b j e c t s ,   a l t h o u g h   c h a n g e s   a r e   a p p l i e d   o n e   a t   a   t i m e .   T h e   c o m m a n d   a c c e p t s   f i l e   n a m e s   a s   w e l l   a s   c o m m a n d - l i n e   a r g u m e n t s ,   a l t h o u g h   t h e   f i l e s   y o u   p o i n t   t o   m u s t   b e   p r e v i o u s l y   s a v e d   v e r s i o n s   o f   r e s o u r c e s .   E d i t i n g   i s   d o n e   w i t h   t h e   A P I   v e r s i o n   u s e d   t o   f e t c h   t h e   r e s o u r c e .   T o   e d i t   u s i n g   a   s p e c i f i c   A P I   v e r s i o n ,   f u l l y - q u a l i f y   t h e   r e s o u r c e ,   v e r s i o n ,   a n d   g r o u p .   T h e   d e f a u l t   f o r m a t   i s   Y A M L .   T o   e d i t   i n   J S O N ,   s p e c i f y   " - o   j s o n " .   T h e   f l a g   - - w i n d o w s - l i n e - e n d i n g


Question: What is Examples?

Answer: #   E d i t   t h e   s e r v i c e   n a m e d   ' r e g i s t r y '   k u b e c t l   e d i t   s v c / r e g i s t r y   #   U s e   a n   a l t e r n a t i v e   e d i t o r   K U B E _ E D I T O R = " n a n o "   k u b e c t l   e d i t   s v c / r e g i s t r y   #   E d i t   t h e   j o b   ' m y j o b '   i n   J S O N   u s i n g   t h e   v 1   A P I   f o r m a t   k u b e c t l   e d i t   j o b . v 1 . b a t c h / m y j o b   - o   j s o n   #   E d i t   t h e   d e p l o y m e n t   ' m y d e p l o y m e n t '   i n   Y A M L   a n d   s a v e   t h e   m o d i f i e d   c o n f i g   i n   i t s   a n n o t a t i o n   k u b e c t l   e d i t   d e p l o y m e n t / m y d e p l o y m e n t   - o   y a m l   - - s a v e - c o n f i g   #   E d i t   t h e   ' s t a t u s '   s u b r e s o u r c e   f o r   t h e   ' m y d e p l o y m e n t '   d e p l o y m e n t   k u b e c t l   e d i t   d e p l o y m e n t   m y d e p l o y m e n t   - - s u b r e s o u r c e = ' s t a t u s '


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 .   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 .   F i l e n a m e ,   d i r e c t o r y ,   o r   U R L   t o   f i l e s   t o   u s e   t o   e d i t   t h e   r e s o u r c e   h e l p   f o r   e d i t   P r o c e s s   t h e   k u s t o m i z a t i o n   d i r e c t o r y .   T h i s   f l a g   c a n ' t   b e   u s e d   t o g e t h e r   w i t h   - f   o r   - R .   O u t p u t   f o r m a t .   O n e   o f :   ( j s o n ,   y a m l ,   n a m e ,   g o - t e m p l a t e ,   g o - t e m p l a t e - f i l e ,   t e m p l a t e ,   t e m p l a t e f i l e ,   j s o n p a t h ,   j s o n p a t h - a s - j s o n ,   j s o n p a t h - f i l e ) .   O u t p u t   t h e   p a t c h   i f   t h e   r e s o u r c e   i s   e d i t e d .   P r o c e s s   t h e   d i r e c t o r y   u s e d   i n   - f ,   - - f i l e n a m e   r e c u r s i v e l y .   U s e f u l   w h e n   y o u   w a n t   t o   m a n a g e   r e l a t e d   m a n i f e s t s   o r g a n i z e d   w i t h i n   t h e   s a m e   d i r e c t o r y .   I f   t r u e ,   t h e   c o n f i g u r a t i o n   o f   c u r r e n t   o b j e c t   w i l l   b e   s a v e d   i n   i t s   a n n o t a t i o n .   O t h e r w i s e ,   t h e   a n n o t a t i o n   w i l l   b e   u n c h a n g e d .   T h i s   f l a g   i s   u s e f u l   w h e n   y o u   w a n t   t o   p e r f o r m   k u b e c t l   a p p l y   o n   t h i s   o b j e c t   i n   t h e   f u t u r e .   I f   t r u e ,   k e e p   t h e   m a n a g e d F i e l d s   w h e n   p r i n t i n g   o b j e c t s   i n   J S O N   o r   Y A M L   f o r m a t .   I f   s p e c i f i e d ,   e d i t   w i l


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 API-initiated Eviction?

Answer: API-initiated EvictionAPI-initiated eviction is the process by which you use the Eviction API to create an Eviction object that triggers graceful pod termination.You can request eviction by calling the Eviction API directly, or programmatically using a client of the API server, like the kubectl drain command. This creates an Eviction object, which causes the API server to terminate the Pod.API-initiated evictions respect your configured PodDisruptionBudgets and terminationGracePeriodSeconds.Using the API to create an Eviction object for a Pod is like performing a policy-controlled DELETE operation on the Pod.Calling the Eviction APIYou can use a Kubernetes language client to access the Kubernetes API and create an Eviction object. To do this, you POST the attempted operation, similar to the following example:Note:policy/v1 Eviction is available in v1.22+. Use policy/v1beta1 with prior releases.{ "apiVersion": "policy/v1", "kind": "Eviction", "metadata": { "name": "quux", "namespace": "default" } } Note:Deprecated in v1.22 in favor of policy/v1{ "apiVersion": "policy/v1beta1", "kind": "Eviction", "metadata": { "name": "quux", "namespace": "default" } } Alternatively, you can attempt an eviction operation by accessing the API using curl or wget, similar to the following example:curl -v -H 'Content-type: application/json' https://your-cluster-api-endpoint.example/api/v1/namespaces/default/pods/quux/eviction -d @eviction.json How API-initiated eviction worksWhen you request an eviction using the API, the API server performs admission checks and responds in one of the following ways:200 OK: the eviction is allowed, the Eviction subresource is created, and the Pod is deleted, similar to sending a DELETE request to the Pod URL.429 Too Many Requests: the eviction is not currently allowed because of the configured PodDisruptionBudget. You may be able to attempt the eviction again later. You might also see this response because of API rate limiting.500 Internal Server Error: the eviction is not allowed because there is a misconfiguration, like if multiple PodDisruptionBudgets reference the same Pod.If the Pod you want to evict isn't part of a workload that has a PodDisruptionBudget, the API server always returns 200 OK and allows the eviction.If the API server allows the eviction, the Pod is deleted as follows:The Pod resource in the API server is updated with a deletion timestamp, after which the API server considers the Pod resource to be terminated. The Pod resource is also marked with the configured grace period.The kubelet on the node where the local Pod is running notices that the Pod resource is marked for termination and starts to gracefully shut down the local Pod.While the kubelet is shutting the Pod down, the control plane removes the Pod from EndpointSlice objects. As a result, controllers no longer consider the Pod as a valid object.After the grace period for the Pod expires, the kubelet forcefully terminates the local Pod.The kubelet tells th


Question: How does API-initiated Eviction work?

Answer: API-initiated EvictionAPI-initiated eviction is the process by which you use the Eviction API to create an Eviction object that triggers graceful pod termination.You can request eviction by calling the Eviction API directly, or programmatically using a client of the API server, like the kubectl drain command. This creates an Eviction object, which causes the API server to terminate the Pod.API-initiated evictions respect your configured PodDisruptionBudgets and terminationGracePeriodSeconds.Using the API to create an Eviction object for a Pod is like performing a policy-controlled DELETE operation on the Pod.Calling the Eviction APIYou can use a Kubernetes language client to access the Kubernetes API and create an Eviction object. To do this, you POST the attempted operation, similar to the following example:Note:policy/v1 Eviction is available in v1.22+. Use policy/v1beta1 with prior releases.{ "apiVersion": "policy/v1", "kind": "Eviction", "metadata": { "name": "quux", "namespace": "default" } } Note:Deprecated in v1.22 in favor of policy/v1{ "apiVersion": "policy/v1beta1", "kind": "Eviction", "metadata": { "name": "quux", "namespace": "default" } } Alternatively, you can attempt an eviction operation by accessing the API using curl or wget, similar to the following example:curl -v -H 'Content-type: application/json' https://your-cluster-api-endpoint.example/api/v1/namespaces/default/pods/quux/eviction -d @eviction.json How API-initiated eviction worksWhen you request an eviction using the API, the API server performs admission checks and responds in one of the following ways:200 OK: the eviction is allowed, the Eviction subresource is created, and the Pod is deleted, similar to sending a DELETE request to the Pod URL.429 Too Many Requests: the eviction is not currently allowed because of the configured PodDisruptionBudget. You may be able to attempt the eviction again later. You might also see this response because of API rate limiting.500 Internal Server Error: the eviction is not allowed because there is a misconfiguration, like if multiple PodDisruptionBudgets reference the same Pod.If the Pod you want to evict isn't part of a workload that has a PodDisruptionBudget, the API server always returns 200 OK and allows the eviction.If the API server allows the eviction, the Pod is deleted as follows:The Pod resource in the API server is updated with a deletion timestamp, after which the API server considers the Pod resource to be terminated. The Pod resource is also marked with the configured grace period.The kubelet on the node where the local Pod is running notices that the Pod resource is marked for termination and starts to gracefully shut down the local Pod.While the kubelet is shutting the Pod down, the control plane removes the Pod from EndpointSlice objects. As a result, controllers no longer consider the Pod as a valid object.After the grace period for the Pod expires, the kubelet forcefully terminates the local Pod.The kubelet tells th


Question: When would you use API-initiated Eviction?

Answer: API-initiated EvictionAPI-initiated eviction is the process by which you use the Eviction API to create an Eviction object that triggers graceful pod termination.You can request eviction by calling the Eviction API directly, or programmatically using a client of the API server, like the kubectl drain command. This creates an Eviction object, which causes the API server to terminate the Pod.API-initiated evictions respect your configured PodDisruptionBudgets and terminationGracePeriodSeconds.Using the API to create an Eviction object for a Pod is like performing a policy-controlled DELETE operation on the Pod.Calling the Eviction APIYou can use a Kubernetes language client to access the Kubernetes API and create an Eviction object. To do this, you POST the attempted operation, similar to the following example:Note:policy/v1 Eviction is available in v1.22+. Use policy/v1beta1 with prior releases.{ "apiVersion": "policy/v1", "kind": "Eviction", "metadata": { "name": "quux", "namespace": "default" } } Note:Deprecated in v1.22 in favor of policy/v1{ "apiVersion": "policy/v1beta1", "kind": "Eviction", "metadata": { "name": "quux", "namespace": "default" } } Alternatively, you can attempt an eviction operation by accessing the API using curl or wget, similar to the following example:curl -v -H 'Content-type: application/json' https://your-cluster-api-endpoint.example/api/v1/namespaces/default/pods/quux/eviction -d @eviction.json How API-initiated eviction worksWhen you request an eviction using the API, the API server performs admission checks and responds in one of the following ways:200 OK: the eviction is allowed, the Eviction subresource is created, and the Pod is deleted, similar to sending a DELETE request to the Pod URL.429 Too Many Requests: the eviction is not currently allowed because of the configured PodDisruptionBudget. You may be able to attempt the eviction again later. You might also see this response because of API rate limiting.500 Internal Server Error: the eviction is not allowed because there is a misconfiguration, like if multiple PodDisruptionBudgets reference the same Pod.If the Pod you want to evict isn't part of a workload that has a PodDisruptionBudget, the API server always returns 200 OK and allows the eviction.If the API server allows the eviction, the Pod is deleted as follows:The Pod resource in the API server is updated with a deletion timestamp, after which the API server considers the Pod resource to be terminated. The Pod resource is also marked with the configured grace period.The kubelet on the node where the local Pod is running notices that the Pod resource is marked for termination and starts to gracefully shut down the local Pod.While the kubelet is shutting the Pod down, the control plane removes the Pod from EndpointSlice objects. As a result, controllers no longer consider the Pod as a valid object.After the grace period for the Pod expires, the kubelet forcefully terminates the local Pod.The kubelet tells th


Question: What are the benefits of API-initiated Eviction?

Answer: API-initiated EvictionAPI-initiated eviction is the process by which you use the Eviction API to create an Eviction object that triggers graceful pod termination.You can request eviction by calling the Eviction API directly, or programmatically using a client of the API server, like the kubectl drain command. This creates an Eviction object, which causes the API server to terminate the Pod.API-initiated evictions respect your configured PodDisruptionBudgets and terminationGracePeriodSeconds.Using the API to create an Eviction object for a Pod is like performing a policy-controlled DELETE operation on the Pod.Calling the Eviction APIYou can use a Kubernetes language client to access the Kubernetes API and create an Eviction object. To do this, you POST the attempted operation, similar to the following example:Note:policy/v1 Eviction is available in v1.22+. Use policy/v1beta1 with prior releases.{ "apiVersion": "policy/v1", "kind": "Eviction", "metadata": { "name": "quux", "namespace": "default" } } Note:Deprecated in v1.22 in favor of policy/v1{ "apiVersion": "policy/v1beta1", "kind": "Eviction", "metadata": { "name": "quux", "namespace": "default" } } Alternatively, you can attempt an eviction operation by accessing the API using curl or wget, similar to the following example:curl -v -H 'Content-type: application/json' https://your-cluster-api-endpoint.example/api/v1/namespaces/default/pods/quux/eviction -d @eviction.json How API-initiated eviction worksWhen you request an eviction using the API, the API server performs admission checks and responds in one of the following ways:200 OK: the eviction is allowed, the Eviction subresource is created, and the Pod is deleted, similar to sending a DELETE request to the Pod URL.429 Too Many Requests: the eviction is not currently allowed because of the configured PodDisruptionBudget. You may be able to attempt the eviction again later. You might also see this response because of API rate limiting.500 Internal Server Error: the eviction is not allowed because there is a misconfiguration, like if multiple PodDisruptionBudgets reference the same Pod.If the Pod you want to evict isn't part of a workload that has a PodDisruptionBudget, the API server always returns 200 OK and allows the eviction.If the API server allows the eviction, the Pod is deleted as follows:The Pod resource in the API server is updated with a deletion timestamp, after which the API server considers the Pod resource to be terminated. The Pod resource is also marked with the configured grace period.The kubelet on the node where the local Pod is running notices that the Pod resource is marked for termination and starts to gracefully shut down the local Pod.While the kubelet is shutting the Pod down, the control plane removes the Pod from EndpointSlice objects. As a result, controllers no longer consider the Pod as a valid object.After the grace period for the Pod expires, the kubelet forcefully terminates the local Pod.The kubelet tells th


Question: What is API-initiated Eviction?

Answer: A P I - i n i t i a t e d   e v i c t i o n   i s   t h e   p r o c e s s   b y   w h i c h   y o u   u s e   t h e   E v i c t i o n   A P I   t o   c r e a t e   a n   E v i c t i o n   o b j e c t   t h a t   t r i g g e r s   g r a c e f u l   p o d   t e r m i n a t i o n .   Y o u   c a n   r e q u e s t   e v i c t i o n   b y   c a l l i n g   t h e   E v i c t i o n   A P I   d i r e c t l y ,   o r   p r o g r a m m a t i c a l l y   u s i n g   a   c l i e n t   o f   t h e   A P I   s e r v e r ,   l i k e   t h e   k u b e c t l   d r a i n   c o m m a n d .   T h i s   c r e a t e s   a n   E v i c t i o n   o b j e c t ,   w h i c h   c a u s e s   t h e   A P I   s e r v e r   t o   t e r m i n a t e   t h e   P o d .   A P I - i n i t i a t e d   e v i c t i o n s   r e s p e c t   y o u r   c o n f i g u r e d   P o d D i s r u p t i o n B u d g e t s   a n d   t e r m i n a t i o n G r a c e P e r i o d S e c o n d s .   U s i n g   t h e   A P I   t o   c r e a t e   a n   E v i c t i o n   o b j e c t   f o r   a   P o d   i s   l i k e   p e r f o r m i n g   a   p o l i c y - c o n t r o l l e d   D E L E T E   o p e r a t i o n   o n   t h e   P o d .


Question: What is Calling the Eviction API?

Answer: Y o u   c a n   u s e   a   K u b e r n e t e s   l a n g u a g e   c l i e n t   t o   a c c e s s   t h e   K u b e r n e t e s   A P I   a n d   c r e a t e   a n   E v i c t i o n   o b j e c t .   T o   d o   t h i s ,   y o u   P O S T   t h e   a t t e m p t e d   o p e r a t i o n ,   s i m i l a r   t o   t h e   f o l l o w i n g   e x a m p l e :   N o t e : p o l i c y / v 1   E v i c t i o n   i s   a v a i l a b l e   i n   v 1 . 2 2 + .   U s e   p o l i c y / v 1 b e t a 1   w i t h   p r i o r   r e l e a s e s . {   " a p i V e r s i o n " :   " p o l i c y / v 1 " ,   " k i n d " :   " E v i c t i o n " ,   " m e t a d a t a " :   {   " n a m e " :   " q u u x " ,   " n a m e s p a c e " :   " d e f a u l t "   }   }


Question: What is Note:?

Answer: {   " a p i V e r s i o n " :   " p o l i c y / v 1 " ,   " k i n d " :   " E v i c t i o n " ,   " m e t a d a t a " :   {   " n a m e " :   " q u u x " ,   " n a m e s p a c e " :   " d e f a u l t "   }   }   N o t e : D e p r e c a t e d   i n   v 1 . 2 2   i n   f a v o r   o f   p o l i c y / v 1 {   " a p i V e r s i o n " :   " p o l i c y / v 1 b e t a 1 " ,   " k i n d " :   " E v i c t i o n " ,   " m e t a d a t a " :   {   " n a m e " :   " q u u x " ,   " n a m e s p a c e " :   " d e f a u l t "   }   }


Question: What is Note:?

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


Question: What is How API-initiated eviction works?

Answer: W h e n   y o u   r e q u e s t   a n   e v i c t i o n   u s i n g   t h e   A P I ,   t h e   A P I   s e r v e r   p e r f o r m s   a d m i s s i o n   c h e c k s   a n d   r e s p o n d s   i n   o n e   o f   t h e   f o l l o w i n g   w a y s :   2 0 0   O K :   t h e   e v i c t i o n   i s   a l l o w e d ,   t h e   E v i c t i o n   s u b r e s o u r c e   i s   c r e a t e d ,   a n d   t h e   P o d   i s   d e l e t e d ,   s i m i l a r   t o   s e n d i n g   a   D E L E T E   r e q u e s t   t o   t h e   P o d   U R L . 4 2 9   T o o   M a n y   R e q u e s t s :   t h e   e v i c t i o n   i s   n o t   c u r r e n t l y   a l l o w e d   b e c a u s e   o f   t h e   c o n f i g u r e d   P o d D i s r u p t i o n B u d g e t .   Y o u   m a y   b e   a b l e   t o   a t t e m p t   t h e   e v i c t i o n   a g a i n   l a t e r .   Y o u   m i g h t   a l s o   s e e   t h i s   r e s p o n s e   b e c a u s e   o f   A P I   r a t e   l i m i t i n g . 5 0 0   I n t e r n a l   S e r v e r   E r r o r :   t h e   e v i c t i o n   i s   n o t   a l l o w e d   b e c a u s e   t h e r e   i s   a   m i s c o n f i g u r a t i o n ,   l i k e   i f   m u l t i p l e   P o d D i s r u p t i o n B u d g e t s   r e f e r e n c e   t h e   s a m e   P o d .   I f   t h e   P o d   y o u   w a n t   t o   e v i c t   i s n ' t   p a r t   o f   a   w o r k l o a d   t h a t   h a s   a   P o d D i s r u p t i o n B u d g e t ,   t h e   A P I   s e r v e r   a l w a y s   r e t u r n s   2 0 0   O K   a n d   a l l o w s   t h e   e v i c t i o n .   I f   t h e   A P I   s e r v e r   a l l o w s   t h e   e v i c t i o n ,   t h e   P o d   i s   d e l e t e d   a s   f o l l o w s :   T h e   P o d   r e s o u r c e   i n   t h e   A P I   s e r v e r   i s   u p d a t e d   w i t h   a   d e l e t i o n   t i m e s t a m p ,   a f t e r   w h i c h   t h e   A P I   s e r v e r   c o n s i d e r s   t h e   P o d   r e s o u r c e   t o   b e


Question: What is Troubleshooting stuck evictions?

Answer: I n   s o m e   c a s e s ,   y o u r   a p p l i c a t i o n s   m a y   e n t e r   a   b r o k e n   s t a t e ,   w h e r e   t h e   E v i c t i o n   A P I   w i l l   o n l y   r e t u r n   4 2 9   o r   5 0 0   r e s p o n s e s   u n t i l   y o u   i n t e r v e n e .   T h i s   c a n   h a p p e n   i f ,   f o r   e x a m p l e ,   a   R e p l i c a S e t   c r e a t e s   p o d s   f o r   y o u r   a p p l i c a t i o n   b u t   n e w   p o d s   d o   n o t   e n t e r   a   R e a d y   s t a t e .   Y o u   m a y   a l s o   n o t i c e   t h i s   b e h a v i o r   i n   c a s e s   w h e r e   t h e   l a s t   e v i c t e d   P o d   h a d   a   l o n g   t e r m i n a t i o n   g r a c e   p e r i o d .   I f   y o u   n o t i c e   s t u c k   e v i c t i o n s ,   t r y   o n e   o f   t h e   f o l l o w i n g   s o l u t i o n s :   A b o r t   o r   p a u s e   t h e   a u t o m a t e d   o p e r a t i o n   c a u s i n g   t h e   i s s u e .   I n v e s t i g a t e   t h e   s t u c k   a p p l i c a t i o n   b e f o r e   y o u   r e s t a r t   t h e   o p e r a t i o n . W a i t   a   w h i l e ,   t h e n   d i r e c t l y   d e l e t e   t h e   P o d   f r o m   y o u r   c l u s t e r   c o n t r o l   p l a n e   i n s t e a d   o f   u s i n g   t h e   E v i c t i o n   A P I .


Question: What is What's next?

Answer: L e a r n   h o w   t o   p r o t e c t   y o u r   a p p l i c a t i o n s   w i t h   a   P o d   D i s r u p t i o n   B u d g e t . L e a r n   a b o u t   N o d e - p r e s s u r e   E v i c t i o n . L e a r n   a b o u t   P o d   P r i o r i t y   a n d   P r e e m p t i o n .


Question: What is Connect a Frontend to a Backend Using Services?

Answer: Connect a Frontend to a Backend Using ServicesThis task shows how to create a frontend and a backend microservice. The backend microservice is a hello greeter. The frontend exposes the backend using nginx and a Kubernetes Service object.ObjectivesCreate and run a sample hello backend microservice using a Deployment object.Use a Service object to send traffic to the backend microservice's multiple replicas.Create and run a nginx frontend microservice, also using a Deployment object.Configure the frontend microservice to send traffic to the backend microservice.Use a Service object of type=LoadBalancer to expose the frontend microservice outside the 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 task uses Services with external load balancers, which require a supported environment. If your environment does not support this, you can use a Service of type NodePort instead.Creating the backend using a DeploymentThe backend is a simple hello greeter microservice. Here is the configuration file for the backend Deployment:service/access/backend-deployment.yaml --- apiVersion: apps/v1 kind: Deployment metadata: name: backend spec: selector: matchLabels: app: hello tier: backend track: stable replicas: 3 template: metadata: labels: app: hello tier: backend track: stable spec: containers: - name: hello image: "gcr.io/google-samples/hello-go-gke:1.0" ports: - name: http containerPort: 80 ...Create the backend Deployment:kubectl apply -f https://k8s.io/examples/service/access/backend-deployment.yaml View information about the backend Deployment:kubectl describe deployment backend The output is similar to this:Name: backend Namespace: default CreationTimestamp: Mon, 24 Oct 2016 14:21:02 -0700 Labels: app=hello tier=backend track=stable Annotations: deployment.kubernetes.io/revision=1 Selector: app=hello,tier=backend,track=stable Replicas: 3 desired | 3 updated | 3 total | 3 available | 0 unavailable StrategyType: RollingUpdate MinReadySeconds: 0 RollingUpdateStrategy: 1 max unavailable, 1 max surge Pod Template: Labels: app=hello tier=backend track=stable Containers: hello: Image: "gcr.io/google-samples/hello-go-gke:1.0" Port: 80/TCP Environment: <none> Mounts: <none> Volumes: <none> Conditions: Type Status Reason ---- ------ ------ Available True MinimumReplicasAvailable Progressing True NewReplicaSetAvailable OldReplicaSets: <none> NewReplicaSet: hello-3621623197 (3/3 replicas created) Events: ... Creating the hello Service objectThe key to sending requests from a frontend to a backend is the backend Service. A Servic


Question: How does Connect a Frontend to a Backend Using Services work?

Answer: Connect a Frontend to a Backend Using ServicesThis task shows how to create a frontend and a backend microservice. The backend microservice is a hello greeter. The frontend exposes the backend using nginx and a Kubernetes Service object.ObjectivesCreate and run a sample hello backend microservice using a Deployment object.Use a Service object to send traffic to the backend microservice's multiple replicas.Create and run a nginx frontend microservice, also using a Deployment object.Configure the frontend microservice to send traffic to the backend microservice.Use a Service object of type=LoadBalancer to expose the frontend microservice outside the 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 task uses Services with external load balancers, which require a supported environment. If your environment does not support this, you can use a Service of type NodePort instead.Creating the backend using a DeploymentThe backend is a simple hello greeter microservice. Here is the configuration file for the backend Deployment:service/access/backend-deployment.yaml --- apiVersion: apps/v1 kind: Deployment metadata: name: backend spec: selector: matchLabels: app: hello tier: backend track: stable replicas: 3 template: metadata: labels: app: hello tier: backend track: stable spec: containers: - name: hello image: "gcr.io/google-samples/hello-go-gke:1.0" ports: - name: http containerPort: 80 ...Create the backend Deployment:kubectl apply -f https://k8s.io/examples/service/access/backend-deployment.yaml View information about the backend Deployment:kubectl describe deployment backend The output is similar to this:Name: backend Namespace: default CreationTimestamp: Mon, 24 Oct 2016 14:21:02 -0700 Labels: app=hello tier=backend track=stable Annotations: deployment.kubernetes.io/revision=1 Selector: app=hello,tier=backend,track=stable Replicas: 3 desired | 3 updated | 3 total | 3 available | 0 unavailable StrategyType: RollingUpdate MinReadySeconds: 0 RollingUpdateStrategy: 1 max unavailable, 1 max surge Pod Template: Labels: app=hello tier=backend track=stable Containers: hello: Image: "gcr.io/google-samples/hello-go-gke:1.0" Port: 80/TCP Environment: <none> Mounts: <none> Volumes: <none> Conditions: Type Status Reason ---- ------ ------ Available True MinimumReplicasAvailable Progressing True NewReplicaSetAvailable OldReplicaSets: <none> NewReplicaSet: hello-3621623197 (3/3 replicas created) Events: ... Creating the hello Service objectThe key to sending requests from a frontend to a backend is the backend Service. A Servic


Question: When would you use Connect a Frontend to a Backend Using Services?

Answer: Connect a Frontend to a Backend Using ServicesThis task shows how to create a frontend and a backend microservice. The backend microservice is a hello greeter. The frontend exposes the backend using nginx and a Kubernetes Service object.ObjectivesCreate and run a sample hello backend microservice using a Deployment object.Use a Service object to send traffic to the backend microservice's multiple replicas.Create and run a nginx frontend microservice, also using a Deployment object.Configure the frontend microservice to send traffic to the backend microservice.Use a Service object of type=LoadBalancer to expose the frontend microservice outside the 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 task uses Services with external load balancers, which require a supported environment. If your environment does not support this, you can use a Service of type NodePort instead.Creating the backend using a DeploymentThe backend is a simple hello greeter microservice. Here is the configuration file for the backend Deployment:service/access/backend-deployment.yaml --- apiVersion: apps/v1 kind: Deployment metadata: name: backend spec: selector: matchLabels: app: hello tier: backend track: stable replicas: 3 template: metadata: labels: app: hello tier: backend track: stable spec: containers: - name: hello image: "gcr.io/google-samples/hello-go-gke:1.0" ports: - name: http containerPort: 80 ...Create the backend Deployment:kubectl apply -f https://k8s.io/examples/service/access/backend-deployment.yaml View information about the backend Deployment:kubectl describe deployment backend The output is similar to this:Name: backend Namespace: default CreationTimestamp: Mon, 24 Oct 2016 14:21:02 -0700 Labels: app=hello tier=backend track=stable Annotations: deployment.kubernetes.io/revision=1 Selector: app=hello,tier=backend,track=stable Replicas: 3 desired | 3 updated | 3 total | 3 available | 0 unavailable StrategyType: RollingUpdate MinReadySeconds: 0 RollingUpdateStrategy: 1 max unavailable, 1 max surge Pod Template: Labels: app=hello tier=backend track=stable Containers: hello: Image: "gcr.io/google-samples/hello-go-gke:1.0" Port: 80/TCP Environment: <none> Mounts: <none> Volumes: <none> Conditions: Type Status Reason ---- ------ ------ Available True MinimumReplicasAvailable Progressing True NewReplicaSetAvailable OldReplicaSets: <none> NewReplicaSet: hello-3621623197 (3/3 replicas created) Events: ... Creating the hello Service objectThe key to sending requests from a frontend to a backend is the backend Service. A Servic


Question: What are the benefits of Connect a Frontend to a Backend Using Services?

Answer: Connect a Frontend to a Backend Using ServicesThis task shows how to create a frontend and a backend microservice. The backend microservice is a hello greeter. The frontend exposes the backend using nginx and a Kubernetes Service object.ObjectivesCreate and run a sample hello backend microservice using a Deployment object.Use a Service object to send traffic to the backend microservice's multiple replicas.Create and run a nginx frontend microservice, also using a Deployment object.Configure the frontend microservice to send traffic to the backend microservice.Use a Service object of type=LoadBalancer to expose the frontend microservice outside the 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 task uses Services with external load balancers, which require a supported environment. If your environment does not support this, you can use a Service of type NodePort instead.Creating the backend using a DeploymentThe backend is a simple hello greeter microservice. Here is the configuration file for the backend Deployment:service/access/backend-deployment.yaml --- apiVersion: apps/v1 kind: Deployment metadata: name: backend spec: selector: matchLabels: app: hello tier: backend track: stable replicas: 3 template: metadata: labels: app: hello tier: backend track: stable spec: containers: - name: hello image: "gcr.io/google-samples/hello-go-gke:1.0" ports: - name: http containerPort: 80 ...Create the backend Deployment:kubectl apply -f https://k8s.io/examples/service/access/backend-deployment.yaml View information about the backend Deployment:kubectl describe deployment backend The output is similar to this:Name: backend Namespace: default CreationTimestamp: Mon, 24 Oct 2016 14:21:02 -0700 Labels: app=hello tier=backend track=stable Annotations: deployment.kubernetes.io/revision=1 Selector: app=hello,tier=backend,track=stable Replicas: 3 desired | 3 updated | 3 total | 3 available | 0 unavailable StrategyType: RollingUpdate MinReadySeconds: 0 RollingUpdateStrategy: 1 max unavailable, 1 max surge Pod Template: Labels: app=hello tier=backend track=stable Containers: hello: Image: "gcr.io/google-samples/hello-go-gke:1.0" Port: 80/TCP Environment: <none> Mounts: <none> Volumes: <none> Conditions: Type Status Reason ---- ------ ------ Available True MinimumReplicasAvailable Progressing True NewReplicaSetAvailable OldReplicaSets: <none> NewReplicaSet: hello-3621623197 (3/3 replicas created) Events: ... Creating the hello Service objectThe key to sending requests from a frontend to a backend is the backend Service. A Servic


Question: What is Connect a Frontend to a Backend Using Services?

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


Question: What is Objectives?

Answer: C r e a t e   a n d   r u n   a   s a m p l e   h e l l o   b a c k e n d   m i c r o s e r v i c e   u s i n g   a   D e p l o y m e n t   o b j e c t . U s e   a   S e r v i c e   o b j e c t   t o   s e n d   t r a f f i c   t o   t h e   b a c k e n d   m i c r o s e r v i c e ' s   m u l t i p l e   r e p l i c a s . C r e a t e   a n d   r u n   a   n g i n x   f r o n t e n d   m i c r o s e r v i c e ,   a l s o   u s i n g   a   D e p l o y m e n t   o b j e c t . C o n f i g u r e   t h e   f r o n t e n d   m i c r o s e r v i c e   t o   s e n d   t r a f f i c   t o   t h e   b a c k e n d   m i c r o s e r v i c e . U s e   a   S e r v i c e   o b j e c t   o f   t y p e = L o a d B a l a n c e r   t o   e x p o s e   t h e   f r o n t e n d   m i c r o s e r v i c e   o u t s i d e   t h e   c l u s t e r .


Question: What is Before you begin?

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


Question: What is Creating the backend using a Deployment?

Answer: T h e   b a c k e n d   i s   a   s i m p l e   h e l l o   g r e e t e r   m i c r o s e r v i c e .   H e r e   i s   t h e   c o n f i g u r a t i o n   f i l e   f o r   t h e   b a c k e n d   D e p l o y m e n t :   - - -   a p i V e r s i o n :   a p p s / v 1   k i n d :   D e p l o y m e n t   m e t a d a t a :   n a m e :   b a c k e n d   s p e c :   s e l e c t o r :   m a t c h L a b e l s :   a p p :   h e l l o   t i e r :   b a c k e n d   t r a c k :   s t a b l e   r e p l i c a s :   3   t e m p l a t e :   m e t a d a t a :   l a b e l s :   a p p :   h e l l o   t i e r :   b a c k e n d   t r a c k :   s t a b l e   s p e c :   c o n t a i n e r s :   -   n a m e :   h e l l o   i m a g e :   " g c r . i o / g o o g l e - s a m p l e s / h e l l o - g o - g k e : 1 . 0 "   p o r t s :   -   n a m e :   h t t p   c o n t a i n e r P o r t :   8 0   . . .   C r e a t e   t h e   b a c k e n d   D e p l o y m e n t :   k u b e c t l   a p p l y   - f   h t t p s : / / k 8 s . i o / e x a m p l e s / s e r v i c e / a c c e s s / b a c k e n d - d e p l o y m e n t . y a m l   V i e w   i n f o r m a t i o n   a b o u t   t h e   b a c k e n d   D e p l o y m e n t :   k u b e c t l   d e s c r i b e   d e p l o y m e n t   b a c k e n d   T h e   o u t p u t   i s   s i m i l a r   t o   t h i s :   N a m e :   b a c k e n d   N a m e s p a c e :   d e f a u l t   C r e a t i o n T i m e s t a m p :   M o n ,   2 4   O c t   2 0 1 6   1 4 : 2 1 : 0 2   - 0 7 0 0   L a b e l s :   a p p = h e l l o   t i e r = b a c k e n d   t r a c k = s t a b l e   A n n o t a t i o n s :   d e p l o y m e n t . k u b e r n e t e s . i o / r e v i s i o n = 1   S e l e c t o r :   a p p = h e l l o , t i e r = b a c k e n d , t r a c k = s t a b l e   R e p l i c a s :   3   d e s i r e d   |   3   u p d a t e d   |   3   t o t a l   |   3   a v a i l a b l e   |   0   u n a v a i l a b l e   S t r a t e g y T y p e :   R o l l i n g U p d a t e   M i n R e a d


Question: What is Creating the hello Service object?

Answer: T h e   k e y   t o   s e n d i n g   r e q u e s t s   f r o m   a   f r o n t e n d   t o   a   b a c k e n d   i s   t h e   b a c k e n d   S e r v i c e .   A   S e r v i c e   c r e a t e s   a   p e r s i s t e n t   I P   a d d r e s s   a n d   D N S   n a m e   e n t r y   s o   t h a t   t h e   b a c k e n d   m i c r o s e r v i c e   c a n   a l w a y s   b e   r e a c h e d .   A   S e r v i c e   u s e s   s e l e c t o r s   t o   f i n d   t h e   P o d s   t h a t   i t   r o u t e s   t r a f f i c   t o .   F i r s t ,   e x p l o r e   t h e   S e r v i c e   c o n f i g u r a t i o n   f i l e :   - - -   a p i V e r s i o n :   v 1   k i n d :   S e r v i c e   m e t a d a t a :   n a m e :   h e l l o   s p e c :   s e l e c t o r :   a p p :   h e l l o   t i e r :   b a c k e n d   p o r t s :   -   p r o t o c o l :   T C P   p o r t :   8 0   t a r g e t P o r t :   h t t p   . . .   I n   t h e   c o n f i g u r a t i o n   f i l e ,   y o u   c a n   s e e   t h a t   t h e   S e r v i c e ,   n a m e d   h e l l o   r o u t e s   t r a f f i c   t o   P o d s   t h a t   h a v e   t h e   l a b e l s   a p p :   h e l l o   a n d   t i e r :   b a c k e n d .   C r e a t e   t h e   b a c k e n d   S e r v i c e :   k u b e c t l   a p p l y   - f   h t t p s : / / k 8 s . i o / e x a m p l e s / s e r v i c e / a c c e s s / b a c k e n d - s e r v i c e . y a m l   A t   t h i s   p o i n t ,   y o u   h a v e   a   b a c k e n d   D e p l o y m e n t   r u n n i n g   t h r e e   r e p l i c a s   o f   y o u r   h e l l o   a p p l i c a t i o n ,   a n d   y o u   h a v e   a   S e r v i c e   t h a t   c a n   r o u t e   t r a f f i c   t o   t h e m .   H o w e v e r ,   t h i s   s e r v i c e   i s   n e i t h e r   a v a i l a b l e   n o r   r e s o l v a b l e   o u t s i d e   t h e   c l u s t e r .


Question: What is Creating the frontend?

Answer: N o w   t h a t   y o u   h a v e   y o u r   b a c k e n d   r u n n i n g ,   y o u   c a n   c r e a t e   a   f r o n t e n d   t h a t   i s   a c c e s s i b l e   o u t s i d e   t h e   c l u s t e r ,   a n d   c o n n e c t s   t o   t h e   b a c k e n d   b y   p r o x y i n g   r e q u e s t s   t o   i t .   T h e   f r o n t e n d   s e n d s   r e q u e s t s   t o   t h e   b a c k e n d   w o r k e r   P o d s   b y   u s i n g   t h e   D N S   n a m e   g i v e n   t o   t h e   b a c k e n d   S e r v i c e .   T h e   D N S   n a m e   i s   h e l l o ,   w h i c h   i s   t h e   v a l u e   o f   t h e   n a m e   f i e l d   i n   t h e   e x a m p l e s / s e r v i c e / a c c e s s / b a c k e n d - s e r v i c e . y a m l   c o n f i g u r a t i o n   f i l e .   T h e   P o d s   i n   t h e   f r o n t e n d   D e p l o y m e n t   r u n   a   n g i n x   i m a g e   t h a t   i s   c o n f i g u r e d   t o   p r o x y   r e q u e s t s   t o   t h e   h e l l o   b a c k e n d   S e r v i c e .   H e r e   i s   t h e   n g i n x   c o n f i g u r a t i o n   f i l e :   #   T h e   i d e n t i f i e r   B a c k e n d   i s   i n t e r n a l   t o   n g i n x ,   a n d   u s e d   t o   n a m e   t h i s   s p e c i f i c   u p s t r e a m   u p s t r e a m   B a c k e n d   {   #   h e l l o   i s   t h e   i n t e r n a l   D N S   n a m e   u s e d   b y   t h e   b a c k e n d   S e r v i c e   i n s i d e   K u b e r n e t e s   s e r v e r   h e l l o ;   }   s e r v e r   {   l i s t e n   8 0 ;   l o c a t i o n   /   {   #   T h e   f o l l o w i n g   s t a t e m e n t   w i l l   p r o x y   t r a f f i c   t o   t h e   u p s t r e a m   n a m e d   B a c k e n d   p r o x y _ p a s s   h t t p : / / B a c k e n d ;   }   }   s e r v e r   {   l i s t e n   8 0 ;   l o c a t i o n   /   {   #   T h e   f o l l o w i n g   s t a t e m e n t   w i l l   p r o x y   t r a f f i c   t o   t h e   u p s t r e a m   n a m e d


Question: What is Interact with the frontend Service?

Answer: O n c e   y o u ' v e   c r e a t e d   a   S e r v i c e   o f   t y p e   L o a d B a l a n c e r ,   y o u   c a n   u s e   t h i s   c o m m a n d   t o   f i n d   t h e   e x t e r n a l   I P :   k u b e c t l   g e t   s e r v i c e   f r o n t e n d   - - w a t c h   T h i s   d i s p l a y s   t h e   c o n f i g u r a t i o n   f o r   t h e   f r o n t e n d   S e r v i c e   a n d   w a t c h e s   f o r   c h a n g e s .   I n i t i a l l y ,   t h e   e x t e r n a l   I P   i s   l i s t e d   a s   < p e n d i n g > :   N A M E   T Y P E   C L U S T E R - I P   E X T E R N A L - I P   P O R T ( S )   A G E   f r o n t e n d   L o a d B a l a n c e r   1 0 . 5 1 . 2 5 2 . 1 1 6   < p e n d i n g >   8 0 / T C P   1 0 s   A s   s o o n   a s   a n   e x t e r n a l   I P   i s   p r o v i s i o n e d ,   h o w e v e r ,   t h e   c o n f i g u r a t i o n   u p d a t e s   t o   i n c l u d e   t h e   n e w   I P   u n d e r   t h e   E X T E R N A L - I P   h e a d i n g :   N A M E   T Y P E   C L U S T E R - I P   E X T E R N A L - I P   P O R T ( S )   A G E   f r o n t e n d   L o a d B a l a n c e r   1 0 . 5 1 . 2 5 2 . 1 1 6   X X X . X X X . X X X . X X X   8 0 / T C P   1 m   T h a t   I P   c a n   n o w   b e   u s e d   t o   i n t e r a c t   w i t h   t h e   f r o n t e n d   s e r v i c e   f r o m   o u t s i d e   t h e   c l u s t e r .


Question: What is Send traffic through the frontend?

Answer: T h e   f r o n t e n d   a n d   b a c k e n d   a r e   n o w   c o n n e c t e d .   Y o u   c a n   h i t   t h e   e n d p o i n t   b y   u s i n g   t h e   c u r l   c o m m a n d   o n   t h e   e x t e r n a l   I P   o f   y o u r   f r o n t e n d   S e r v i c e .   c u r l   h t t p : / / $ { E X T E R N A L _ I P }   #   r e p l a c e   t h i s   w i t h   t h e   E X T E R N A L - I P   y o u   s a w   e a r l i e r   T h e   o u t p u t   s h o w s   t h e   m e s s a g e   g e n e r a t e d   b y   t h e   b a c k e n d :   { " m e s s a g e " : " H e l l o " }


Question: What is Cleaning up?

Answer: T o   d e l e t e   t h e   S e r v i c e s ,   e n t e r   t h i s   c o m m a n d :   k u b e c t l   d e l e t e   s e r v i c e s   f r o n t e n d   b a c k e n d   T o   d e l e t e   t h e   D e p l o y m e n t s ,   t h e   R e p l i c a S e t s   a n d   t h e   P o d s   t h a t   a r e   r u n n i n g   t h e   b a c k e n d   a n d   f r o n t e n d   a p p l i c a t i o n s ,   e n t e r   t h i s   c o m m a n d :   k u b e c t l   d e l e t e   d e p l o y m e n t   f r o n t e n d   b a c k e n d


Question: What is What's next?

Answer: L e a r n   m o r e   a b o u t   S e r v i c e s L e a r n   m o r e   a b o u t   C o n f i g M a p s L e a r n   m o r e   a b o u t   D N S   f o r   S e r v i c e   a n d   P o d s


Question: What is Cloud Controller Manager?

Answer: Cloud Controller ManagerFEATURE STATE: Kubernetes v1.11 [beta]Cloud infrastructure technologies let you run Kubernetes on public, private, and hybrid clouds. Kubernetes believes in automated, API-driven infrastructure without tight coupling between components.The cloud-controller-manager is a Kubernetes control plane component that embeds cloud-specific control logic. The cloud controller manager lets you link your cluster into your cloud provider's API, and separates out the components that interact with that cloud platform from components that only interact with your cluster.By decoupling the interoperability logic between Kubernetes and the underlying cloud infrastructure, the cloud-controller-manager component enables cloud providers to release features at a different pace compared to the main Kubernetes project.The cloud-controller-manager is structured using a plugin mechanism that allows different cloud providers to integrate their platforms with Kubernetes.DesignThe cloud controller manager runs in the control plane as a replicated set of processes (usually, these are containers in Pods). Each cloud-controller-manager implements multiple controllers in a single process.Note:You can also run the cloud controller manager as a Kubernetes addon rather than as part of the control plane.Cloud controller manager functionsThe controllers inside the cloud controller manager include:Node controllerThe node controller is responsible for updating Node objects when new servers are created in your cloud infrastructure. The node controller obtains information about the hosts running inside your tenancy with the cloud provider. The node controller performs the following functions:Update a Node object with the corresponding server's unique identifier obtained from the cloud provider API.Annotating and labelling the Node object with cloud-specific information, such as the region the node is deployed into and the resources (CPU, memory, etc) that it has available.Obtain the node's hostname and network addresses.Verifying the node's health. In case a node becomes unresponsive, this controller checks with your cloud provider's API to see if the server has been deactivated / deleted / terminated. If the node has been deleted from the cloud, the controller deletes the Node object from your Kubernetes cluster.Some cloud provider implementations split this into a node controller and a separate node lifecycle controller.Route controllerThe route controller is responsible for configuring routes in the cloud appropriately so that containers on different nodes in your Kubernetes cluster can communicate with each other.Depending on the cloud provider, the route controller might also allocate blocks of IP addresses for the Pod network.Service controllerServices integrate with cloud infrastructure components such as managed load balancers, IP addresses, network packet filtering, and target health checking. The service controller interacts with your cloud provider's APIs


Question: How does Cloud Controller Manager work?

Answer: Cloud Controller ManagerFEATURE STATE: Kubernetes v1.11 [beta]Cloud infrastructure technologies let you run Kubernetes on public, private, and hybrid clouds. Kubernetes believes in automated, API-driven infrastructure without tight coupling between components.The cloud-controller-manager is a Kubernetes control plane component that embeds cloud-specific control logic. The cloud controller manager lets you link your cluster into your cloud provider's API, and separates out the components that interact with that cloud platform from components that only interact with your cluster.By decoupling the interoperability logic between Kubernetes and the underlying cloud infrastructure, the cloud-controller-manager component enables cloud providers to release features at a different pace compared to the main Kubernetes project.The cloud-controller-manager is structured using a plugin mechanism that allows different cloud providers to integrate their platforms with Kubernetes.DesignThe cloud controller manager runs in the control plane as a replicated set of processes (usually, these are containers in Pods). Each cloud-controller-manager implements multiple controllers in a single process.Note:You can also run the cloud controller manager as a Kubernetes addon rather than as part of the control plane.Cloud controller manager functionsThe controllers inside the cloud controller manager include:Node controllerThe node controller is responsible for updating Node objects when new servers are created in your cloud infrastructure. The node controller obtains information about the hosts running inside your tenancy with the cloud provider. The node controller performs the following functions:Update a Node object with the corresponding server's unique identifier obtained from the cloud provider API.Annotating and labelling the Node object with cloud-specific information, such as the region the node is deployed into and the resources (CPU, memory, etc) that it has available.Obtain the node's hostname and network addresses.Verifying the node's health. In case a node becomes unresponsive, this controller checks with your cloud provider's API to see if the server has been deactivated / deleted / terminated. If the node has been deleted from the cloud, the controller deletes the Node object from your Kubernetes cluster.Some cloud provider implementations split this into a node controller and a separate node lifecycle controller.Route controllerThe route controller is responsible for configuring routes in the cloud appropriately so that containers on different nodes in your Kubernetes cluster can communicate with each other.Depending on the cloud provider, the route controller might also allocate blocks of IP addresses for the Pod network.Service controllerServices integrate with cloud infrastructure components such as managed load balancers, IP addresses, network packet filtering, and target health checking. The service controller interacts with your cloud provider's APIs


Question: When would you use Cloud Controller Manager?

Answer: Cloud Controller ManagerFEATURE STATE: Kubernetes v1.11 [beta]Cloud infrastructure technologies let you run Kubernetes on public, private, and hybrid clouds. Kubernetes believes in automated, API-driven infrastructure without tight coupling between components.The cloud-controller-manager is a Kubernetes control plane component that embeds cloud-specific control logic. The cloud controller manager lets you link your cluster into your cloud provider's API, and separates out the components that interact with that cloud platform from components that only interact with your cluster.By decoupling the interoperability logic between Kubernetes and the underlying cloud infrastructure, the cloud-controller-manager component enables cloud providers to release features at a different pace compared to the main Kubernetes project.The cloud-controller-manager is structured using a plugin mechanism that allows different cloud providers to integrate their platforms with Kubernetes.DesignThe cloud controller manager runs in the control plane as a replicated set of processes (usually, these are containers in Pods). Each cloud-controller-manager implements multiple controllers in a single process.Note:You can also run the cloud controller manager as a Kubernetes addon rather than as part of the control plane.Cloud controller manager functionsThe controllers inside the cloud controller manager include:Node controllerThe node controller is responsible for updating Node objects when new servers are created in your cloud infrastructure. The node controller obtains information about the hosts running inside your tenancy with the cloud provider. The node controller performs the following functions:Update a Node object with the corresponding server's unique identifier obtained from the cloud provider API.Annotating and labelling the Node object with cloud-specific information, such as the region the node is deployed into and the resources (CPU, memory, etc) that it has available.Obtain the node's hostname and network addresses.Verifying the node's health. In case a node becomes unresponsive, this controller checks with your cloud provider's API to see if the server has been deactivated / deleted / terminated. If the node has been deleted from the cloud, the controller deletes the Node object from your Kubernetes cluster.Some cloud provider implementations split this into a node controller and a separate node lifecycle controller.Route controllerThe route controller is responsible for configuring routes in the cloud appropriately so that containers on different nodes in your Kubernetes cluster can communicate with each other.Depending on the cloud provider, the route controller might also allocate blocks of IP addresses for the Pod network.Service controllerServices integrate with cloud infrastructure components such as managed load balancers, IP addresses, network packet filtering, and target health checking. The service controller interacts with your cloud provider's APIs


Question: What are the benefits of Cloud Controller Manager?

Answer: Cloud Controller ManagerFEATURE STATE: Kubernetes v1.11 [beta]Cloud infrastructure technologies let you run Kubernetes on public, private, and hybrid clouds. Kubernetes believes in automated, API-driven infrastructure without tight coupling between components.The cloud-controller-manager is a Kubernetes control plane component that embeds cloud-specific control logic. The cloud controller manager lets you link your cluster into your cloud provider's API, and separates out the components that interact with that cloud platform from components that only interact with your cluster.By decoupling the interoperability logic between Kubernetes and the underlying cloud infrastructure, the cloud-controller-manager component enables cloud providers to release features at a different pace compared to the main Kubernetes project.The cloud-controller-manager is structured using a plugin mechanism that allows different cloud providers to integrate their platforms with Kubernetes.DesignThe cloud controller manager runs in the control plane as a replicated set of processes (usually, these are containers in Pods). Each cloud-controller-manager implements multiple controllers in a single process.Note:You can also run the cloud controller manager as a Kubernetes addon rather than as part of the control plane.Cloud controller manager functionsThe controllers inside the cloud controller manager include:Node controllerThe node controller is responsible for updating Node objects when new servers are created in your cloud infrastructure. The node controller obtains information about the hosts running inside your tenancy with the cloud provider. The node controller performs the following functions:Update a Node object with the corresponding server's unique identifier obtained from the cloud provider API.Annotating and labelling the Node object with cloud-specific information, such as the region the node is deployed into and the resources (CPU, memory, etc) that it has available.Obtain the node's hostname and network addresses.Verifying the node's health. In case a node becomes unresponsive, this controller checks with your cloud provider's API to see if the server has been deactivated / deleted / terminated. If the node has been deleted from the cloud, the controller deletes the Node object from your Kubernetes cluster.Some cloud provider implementations split this into a node controller and a separate node lifecycle controller.Route controllerThe route controller is responsible for configuring routes in the cloud appropriately so that containers on different nodes in your Kubernetes cluster can communicate with each other.Depending on the cloud provider, the route controller might also allocate blocks of IP addresses for the Pod network.Service controllerServices integrate with cloud infrastructure components such as managed load balancers, IP addresses, network packet filtering, and target health checking. The service controller interacts with your cloud provider's APIs


Question: What is Cloud Controller Manager?

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


Question: What is Design?

Answer: T h e   c l o u d   c o n t r o l l e r   m a n a g e r   r u n s   i n   t h e   c o n t r o l   p l a n e   a s   a   r e p l i c a t e d   s e t   o f   p r o c e s s e s   ( u s u a l l y ,   t h e s e   a r e   c o n t a i n e r s   i n   P o d s ) .   E a c h   c l o u d - c o n t r o l l e r - m a n a g e r   i m p l e m e n t s   m u l t i p l e   c o n t r o l l e r s   i n   a   s i n g l e   p r o c e s s .


Question: What is Cloud controller manager functions?

Answer: T h e   c o n t r o l l e r s   i n s i d e   t h e   c l o u d   c o n t r o l l e r   m a n a g e r   i n c l u d e :


Question: What is Node controller?

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


Question: What is Route controller?

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


Question: What is Service controller?

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


Question: What is Authorization?

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


Question: What is Node controller?

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


Question: What is Route controller?

Answer: T h e   r o u t e   c o n t r o l l e r   l i s t e n s   t o   N o d e   o b j e c t   c r e a t i o n   a n d   c o n f i g u r e s   r o u t e s   a p p r o p r i a t e l y .   I t   r e q u i r e s   G e t   a c c e s s   t o   N o d e   o b j e c t s .   v 1 / N o d e :   g e t


Question: What is Service controller?

Answer: T h e   s e r v i c e   c o n t r o l l e r   w a t c h e s   f o r   S e r v i c e   o b j e c t   c r e a t e ,   u p d a t e   a n d   d e l e t e   e v e n t s   a n d   t h e n   c o n f i g u r e s   l o a d   b a l a n c e r s   f o r   t h o s e   S e r v i c e s   a p p r o p r i a t e l y .   T o   a c c e s s   S e r v i c e s ,   i t   r e q u i r e s   l i s t ,   a n d   w a t c h   a c c e s s .   T o   u p d a t e   S e r v i c e s ,   i t   r e q u i r e s   p a t c h   a n d   u p d a t e   a c c e s s   t o   t h e   s t a t u s   s u b r e s o u r c e .   v 1 / S e r v i c e :   l i s t g e t w a t c h p a t c h u p d a t e


Question: What is Others?

Answer: T h e   i m p l e m e n t a t i o n   o f   t h e   c o r e   o f   t h e   c l o u d   c o n t r o l l e r   m a n a g e r   r e q u i r e s   a c c e s s   t o   c r e a t e   E v e n t   o b j e c t s ,   a n d   t o   e n s u r e   s e c u r e   o p e r a t i o n ,   i t   r e q u i r e s   a c c e s s   t o   c r e a t e   S e r v i c e A c c o u n t s .   v 1 / E v e n t :   c r e a t e p a t c h u p d a t e   v 1 / S e r v i c e A c c o u n t :   c r e a t e   T h e   R B A C   C l u s t e r R o l e   f o r   t h e   c l o u d   c o n t r o l l e r   m a n a g e r   l o o k s   l i k e :   a p i V e r s i o n :   r b a c . a u t h o r i z a t i o n . k 8 s . i o / v 1   k i n d :   C l u s t e r R o l e   m e t a d a t a :   n a m e :   c l o u d - c o n t r o l l e r - m a n a g e r   r u l e s :   -   a p i G r o u p s :   -   " "   r e s o u r c e s :   -   e v e n t s   v e r b s :   -   c r e a t e   -   p a t c h   -   u p d a t e   -   a p i G r o u p s :   -   " "   r e s o u r c e s :   -   n o d e s   v e r b s :   -   ' * '   -   a p i G r o u p s :   -   " "   r e s o u r c e s :   -   n o d e s / s t a t u s   v e r b s :   -   p a t c h   -   a p i G r o u p s :   -   " "   r e s o u r c e s :   -   s e r v i c e s   v e r b s :   -   l i s t   -   w a t c h   -   a p i G r o u p s :   -   " "   r e s o u r c e s :   -   s e r v i c e s / s t a t u s   v e r b s :   -   p a t c h   -   u p d a t e   -   a p i G r o u p s :   -   " "   r e s o u r c e s :   -   s e r v i c e a c c o u n t s   v e r b s :   -   c r e a t e   -   a p i G r o u p s :   -   " "   r e s o u r c e s :   -   p e r s i s t e n t v o l u m e s   v e r b s :   -   g e t   -   l i s t   -   u p d a t e   -   w a t c h


Question: What is What's next?

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


Question: What is Blog article mirroring?

Answer: Blog article mirroringThere are two official Kubernetes blogs, and the CNCF has its own blog where you can cover Kubernetes too. For the main Kubernetes blog, we (the Kubernetes project) like to publish articles with different perspectives and special focuses, that have a link to Kubernetes.Some articles appear on both blogs: there is a primary version of the article, and a mirror article on the other blog.This page describes the criteria for mirroring, the motivation for mirroring, and explains what you should do to ensure that an article publishes to both blogs.Before you beginMake sure you are familiar with the introduction sections of contributing to Kubernetes blogs, not just to learn about the two official blogs and the differences between them, but also to get an overview of the process.Why we mirrorMirroring is nearly always from the contributor blog to the main blog. The project does this for articles that are about the contributor community, or a part of it, but are also relevant to the wider set of readers for Kubernetes' main blog.As an author (or reviewer), consider the target audience and whether the blog post is appropriate for the main blog. For example: if the target audience are Kubernetes contributors only, then the contributor blog. may be more appropriate; if the blog post is about open source in general then it may be more suitable on another site outside the Kubernetes project.This consideration about target audience applies to original and mirrored articles equally.The Kubernetes project is willing to mirror any blog article that was published to https://kubernetes.dev/blog/ (the contributor blog), provided that all of the following criteria are met:the mirrored article has the same publication date as the original (it should have the same publication time too, but you can also set a time stamp up to 12 hours later for special cases)For PRs that add a mirrored article to the main blog after the original article has merged into the contributor blog, ensure that all of the following criteria are met:No articles were published to the main blog after the original article was published to the contributor blog.There are no main blog articles scheduled for publication between the publication time of the original article and the publication time of your mirrored article.This is because the Kubernetes project doesn't want to add articles to people's feeds, such as RSS, except at the very end of their feed.the original article doesn't contravene any strongly recommended review guidelines or community normsthe mirrored article will have canonicalUrl set correctly in its front matterthe audience for the original article would find it relevantthe article content is not off-topic for the target blog where the mirror article would appearMirroring from the main blog to the contributor blog is rare, but could feasibly happen.How to mirrorYou make a PR against the other Git repository (usually, https://github.com/kubernetes/website) that ad


Question: How does Blog article mirroring work?

Answer: Blog article mirroringThere are two official Kubernetes blogs, and the CNCF has its own blog where you can cover Kubernetes too. For the main Kubernetes blog, we (the Kubernetes project) like to publish articles with different perspectives and special focuses, that have a link to Kubernetes.Some articles appear on both blogs: there is a primary version of the article, and a mirror article on the other blog.This page describes the criteria for mirroring, the motivation for mirroring, and explains what you should do to ensure that an article publishes to both blogs.Before you beginMake sure you are familiar with the introduction sections of contributing to Kubernetes blogs, not just to learn about the two official blogs and the differences between them, but also to get an overview of the process.Why we mirrorMirroring is nearly always from the contributor blog to the main blog. The project does this for articles that are about the contributor community, or a part of it, but are also relevant to the wider set of readers for Kubernetes' main blog.As an author (or reviewer), consider the target audience and whether the blog post is appropriate for the main blog. For example: if the target audience are Kubernetes contributors only, then the contributor blog. may be more appropriate; if the blog post is about open source in general then it may be more suitable on another site outside the Kubernetes project.This consideration about target audience applies to original and mirrored articles equally.The Kubernetes project is willing to mirror any blog article that was published to https://kubernetes.dev/blog/ (the contributor blog), provided that all of the following criteria are met:the mirrored article has the same publication date as the original (it should have the same publication time too, but you can also set a time stamp up to 12 hours later for special cases)For PRs that add a mirrored article to the main blog after the original article has merged into the contributor blog, ensure that all of the following criteria are met:No articles were published to the main blog after the original article was published to the contributor blog.There are no main blog articles scheduled for publication between the publication time of the original article and the publication time of your mirrored article.This is because the Kubernetes project doesn't want to add articles to people's feeds, such as RSS, except at the very end of their feed.the original article doesn't contravene any strongly recommended review guidelines or community normsthe mirrored article will have canonicalUrl set correctly in its front matterthe audience for the original article would find it relevantthe article content is not off-topic for the target blog where the mirror article would appearMirroring from the main blog to the contributor blog is rare, but could feasibly happen.How to mirrorYou make a PR against the other Git repository (usually, https://github.com/kubernetes/website) that ad