Question: What is Examples?

Answer: #   C r e a t e   a   p o d   u s i n g   t h e   d a t a   i n   p o d . j s o n   k u b e c t l   c r e a t e   - f   . / p o d . j s o n   #   C r e a t e   a   p o d   b a s e d   o n   t h e   J S O N   p a s s e d   i n t o   s t d i n   c a t   p o d . j s o n   |   k u b e c t l   c r e a t e   - f   -   #   E d i t   t h e   d a t a   i n   r e g i s t r y . y a m l   i n   J S O N   t h e n   c r e a t e   t h e   r e s o u r c e   u s i n g   t h e   e d i t e d   d a t a   k u b e c t l   c r e a t e   - f   r e g i s t r y . y a m l   - - e d i t   - o   j s o n


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 .   M u s t   b e   " n o n e " ,   " s e r v e r " ,   o r   " c l i e n t " .   I f   c l i e n t   s t r a t e g y ,   o n l y   p r i n t   t h e   o b j e c t   t h a t   w o u l d   b e   s e n t ,   w i t h o u t   s e n d i n g   i t .   I f   s e r v e r   s t r a t e g y ,   s u b m i t   s e r v e r - s i d e   r e q u e s t   w i t h o u t   p e r s i s t i n g   t h e   r e s o u r c e .   E d i t   t h e   A P I   r e s o u r c e   b e f o r e   c r e a t i n g   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   c r e a t e   t h e   r e s o u r c e   h e l p   f o r   c r e a t e   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 ) .   R a w   U R I   t o   P O S T   t o   t h e   s e r v e r .   U s e s   t h e   t r a n s p o r t   s p e c i f i e d   b y   t h e   k u b e c o n f i g   f i l e .   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


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 k u b e c t l   c r e a t e   c l u s t e r r o l e   -   C r e a t e   a   c l u s t e r   r o l e k u b e c t l   c r e a t e   c l u s t e r r o l e b i n d i n g   -   C r e a t e   a   c l u s t e r   r o l e   b i n d i n g   f o r   a   p a r t i c u l a r   c l u s t e r   r o l e k u b e c t l   c r e a t e   c o n f i g m a p   -   C r e a t e   a   c o n f i g   m a p   f r o m   a   l o c a l   f i l e ,   d i r e c t o r y   o r   l i t e r a l   v a l u e k u b e c t l   c r e a t e   c r o n j o b   -   C r e a t e   a   c r o n   j o b   w i t h   t h e   s p e c i f i e d   n a m e k u b e c t l   c r e a t e   d e p l o y m e n t   -   C r e a t e   a   d e p l o y m e n t   w i t h   t h e   s p e c i f i e d   n a m e k u b e c t l   c r e a t e   i n g r e s s   -   C r e a t e   a n   i n g r e s s   w i t h   t h e   s p e c i f i e d   n a m e k u b e c t l   c r e a t e   j o b   -   C r e a t e   a   j o b   w i t h   t h e   s p e c i f i e d   n a m e k u b e c t l   c r e a t e   n a m e s p a c e   -   C r e a t e   a   n a m e s p a c e   w i t h   t h e   s p e c i f i e d   n a m e k u b e c t l   c r e a t e   p o d d i s r u p t i o n b u d g e t   -   C r e a t e   a   p o d   d i s r u p t i o n   b u d g e t   w i t h   t h e   s p e c i f i e d   n a m e k u b e c t l   c r e a t e   p r i o r i t y c l a s s   -   C r e a t e   a   p r i o r i t y   c l a s s   w i t h   t h e   s p e c i f i e d   n a m e k u b e c t l   c r e a t e   q u o t a   -   C r e a t e   a   q u o t a   w i t h   t h e   s p e c i f i e d   n a m e k u b e c t l   c r e a t e   r o l e   -   C r e a t e   a   r o l e   w i t h   s i n g l e   r u l e k u b e c t l   c r e a t e   r o l e b i n d i n g   -   C r e a t e   a   r o l e   b i n d i n g   f o r   a   p a r t i c u l a r   r o l e   o r   c l u s t e r   r o l e k u b e c t l


Question: What is kubectl rollout?

Answer: kubectl rolloutSynopsisManage the rollout of one or many resources.Valid resource types include:deploymentsdaemonsetsstatefulsetskubectl rollout SUBCOMMAND Examples # Rollback to the previous deployment kubectl rollout undo deployment/abc # Check the rollout status of a daemonset kubectl rollout status daemonset/foo # Restart a deployment kubectl rollout restart deployment/abc # Restart deployments with the 'app=nginx' label kubectl rollout restart deployment --selector=app=nginx Options-h, --helphelp for rolloutParent Options Inherited--as stringUsername to impersonate for the operation. User could be a regular user or a service account in a namespace.--as-group stringsGroup to impersonate for the operation, this flag can be repeated to specify multiple groups.--as-uid stringUID to impersonate for the operation.--cache-dir string Default: "$HOME/.kube/cache"Default cache directory--certificate-authority stringPath to a cert file for the certificate authority--client-certificate stringPath to a client certificate file for TLS--client-key stringPath to a client key file for TLS--cluster stringThe name of the kubeconfig cluster to use--context stringThe name of the kubeconfig context to use--disable-compressionIf true, opt-out of response compression for all requests to the server--insecure-skip-tls-verifyIf true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure--kubeconfig stringPath to the kubeconfig file to use for CLI requests.--kuberc stringPath to the kuberc file to use for preferences. This can be disabled by exporting KUBECTL_KUBERC=false feature gate or turning off the feature KUBERC=off.--match-server-versionRequire server version to match client version-n, --namespace stringIf present, the namespace scope for this CLI request--password stringPassword for basic authentication to the API server--profile string Default: "none"Name of profile to capture. One of (none|cpu|heap|goroutine|threadcreate|block|mutex)--profile-output string Default: "profile.pprof"Name of the file to write the profile to--request-timeout string Default: "0"The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests.-s, --server stringThe address and port of the Kubernetes API server--storage-driver-buffer-duration duration Default: 1m0sWrites in the storage driver will be buffered for this duration, and committed to the non memory backends as a single transaction--storage-driver-db string Default: "cadvisor"database name--storage-driver-host string Default: "localhost:8086"database host:port--storage-driver-password string Default: "root"database password--storage-driver-secureuse secure connection with database--storage-driver-table string Default: "stats"table name--storage-driver-user string Default: "root"database username--tls-server-name stringServer name to use for server


Question: How does kubectl rollout work?

Answer: kubectl rolloutSynopsisManage the rollout of one or many resources.Valid resource types include:deploymentsdaemonsetsstatefulsetskubectl rollout SUBCOMMAND Examples # Rollback to the previous deployment kubectl rollout undo deployment/abc # Check the rollout status of a daemonset kubectl rollout status daemonset/foo # Restart a deployment kubectl rollout restart deployment/abc # Restart deployments with the 'app=nginx' label kubectl rollout restart deployment --selector=app=nginx Options-h, --helphelp for rolloutParent Options Inherited--as stringUsername to impersonate for the operation. User could be a regular user or a service account in a namespace.--as-group stringsGroup to impersonate for the operation, this flag can be repeated to specify multiple groups.--as-uid stringUID to impersonate for the operation.--cache-dir string Default: "$HOME/.kube/cache"Default cache directory--certificate-authority stringPath to a cert file for the certificate authority--client-certificate stringPath to a client certificate file for TLS--client-key stringPath to a client key file for TLS--cluster stringThe name of the kubeconfig cluster to use--context stringThe name of the kubeconfig context to use--disable-compressionIf true, opt-out of response compression for all requests to the server--insecure-skip-tls-verifyIf true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure--kubeconfig stringPath to the kubeconfig file to use for CLI requests.--kuberc stringPath to the kuberc file to use for preferences. This can be disabled by exporting KUBECTL_KUBERC=false feature gate or turning off the feature KUBERC=off.--match-server-versionRequire server version to match client version-n, --namespace stringIf present, the namespace scope for this CLI request--password stringPassword for basic authentication to the API server--profile string Default: "none"Name of profile to capture. One of (none|cpu|heap|goroutine|threadcreate|block|mutex)--profile-output string Default: "profile.pprof"Name of the file to write the profile to--request-timeout string Default: "0"The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests.-s, --server stringThe address and port of the Kubernetes API server--storage-driver-buffer-duration duration Default: 1m0sWrites in the storage driver will be buffered for this duration, and committed to the non memory backends as a single transaction--storage-driver-db string Default: "cadvisor"database name--storage-driver-host string Default: "localhost:8086"database host:port--storage-driver-password string Default: "root"database password--storage-driver-secureuse secure connection with database--storage-driver-table string Default: "stats"table name--storage-driver-user string Default: "root"database username--tls-server-name stringServer name to use for server


Question: When would you use kubectl rollout?

Answer: kubectl rolloutSynopsisManage the rollout of one or many resources.Valid resource types include:deploymentsdaemonsetsstatefulsetskubectl rollout SUBCOMMAND Examples # Rollback to the previous deployment kubectl rollout undo deployment/abc # Check the rollout status of a daemonset kubectl rollout status daemonset/foo # Restart a deployment kubectl rollout restart deployment/abc # Restart deployments with the 'app=nginx' label kubectl rollout restart deployment --selector=app=nginx Options-h, --helphelp for rolloutParent Options Inherited--as stringUsername to impersonate for the operation. User could be a regular user or a service account in a namespace.--as-group stringsGroup to impersonate for the operation, this flag can be repeated to specify multiple groups.--as-uid stringUID to impersonate for the operation.--cache-dir string Default: "$HOME/.kube/cache"Default cache directory--certificate-authority stringPath to a cert file for the certificate authority--client-certificate stringPath to a client certificate file for TLS--client-key stringPath to a client key file for TLS--cluster stringThe name of the kubeconfig cluster to use--context stringThe name of the kubeconfig context to use--disable-compressionIf true, opt-out of response compression for all requests to the server--insecure-skip-tls-verifyIf true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure--kubeconfig stringPath to the kubeconfig file to use for CLI requests.--kuberc stringPath to the kuberc file to use for preferences. This can be disabled by exporting KUBECTL_KUBERC=false feature gate or turning off the feature KUBERC=off.--match-server-versionRequire server version to match client version-n, --namespace stringIf present, the namespace scope for this CLI request--password stringPassword for basic authentication to the API server--profile string Default: "none"Name of profile to capture. One of (none|cpu|heap|goroutine|threadcreate|block|mutex)--profile-output string Default: "profile.pprof"Name of the file to write the profile to--request-timeout string Default: "0"The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests.-s, --server stringThe address and port of the Kubernetes API server--storage-driver-buffer-duration duration Default: 1m0sWrites in the storage driver will be buffered for this duration, and committed to the non memory backends as a single transaction--storage-driver-db string Default: "cadvisor"database name--storage-driver-host string Default: "localhost:8086"database host:port--storage-driver-password string Default: "root"database password--storage-driver-secureuse secure connection with database--storage-driver-table string Default: "stats"table name--storage-driver-user string Default: "root"database username--tls-server-name stringServer name to use for server


Question: What are the benefits of kubectl rollout?

Answer: kubectl rolloutSynopsisManage the rollout of one or many resources.Valid resource types include:deploymentsdaemonsetsstatefulsetskubectl rollout SUBCOMMAND Examples # Rollback to the previous deployment kubectl rollout undo deployment/abc # Check the rollout status of a daemonset kubectl rollout status daemonset/foo # Restart a deployment kubectl rollout restart deployment/abc # Restart deployments with the 'app=nginx' label kubectl rollout restart deployment --selector=app=nginx Options-h, --helphelp for rolloutParent Options Inherited--as stringUsername to impersonate for the operation. User could be a regular user or a service account in a namespace.--as-group stringsGroup to impersonate for the operation, this flag can be repeated to specify multiple groups.--as-uid stringUID to impersonate for the operation.--cache-dir string Default: "$HOME/.kube/cache"Default cache directory--certificate-authority stringPath to a cert file for the certificate authority--client-certificate stringPath to a client certificate file for TLS--client-key stringPath to a client key file for TLS--cluster stringThe name of the kubeconfig cluster to use--context stringThe name of the kubeconfig context to use--disable-compressionIf true, opt-out of response compression for all requests to the server--insecure-skip-tls-verifyIf true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure--kubeconfig stringPath to the kubeconfig file to use for CLI requests.--kuberc stringPath to the kuberc file to use for preferences. This can be disabled by exporting KUBECTL_KUBERC=false feature gate or turning off the feature KUBERC=off.--match-server-versionRequire server version to match client version-n, --namespace stringIf present, the namespace scope for this CLI request--password stringPassword for basic authentication to the API server--profile string Default: "none"Name of profile to capture. One of (none|cpu|heap|goroutine|threadcreate|block|mutex)--profile-output string Default: "profile.pprof"Name of the file to write the profile to--request-timeout string Default: "0"The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests.-s, --server stringThe address and port of the Kubernetes API server--storage-driver-buffer-duration duration Default: 1m0sWrites in the storage driver will be buffered for this duration, and committed to the non memory backends as a single transaction--storage-driver-db string Default: "cadvisor"database name--storage-driver-host string Default: "localhost:8086"database host:port--storage-driver-password string Default: "root"database password--storage-driver-secureuse secure connection with database--storage-driver-table string Default: "stats"table name--storage-driver-user string Default: "root"database username--tls-server-name stringServer name to use for server


Question: What is Synopsis?

Answer: M a n a g e   t h e   r o l l o u t   o f   o n e   o r   m a n y   r e s o u r c e s .   V a l i d   r e s o u r c e   t y p e s   i n c l u d e :   d e p l o y m e n t s d a e m o n s e t s s t a t e f u l s e t s   k u b e c t l   r o l l o u t   S U B C O M M A N D


Question: What is Examples?

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


Question: What is Options?

Answer: h e l p   f o r   r o l l o u t


Question: What is Parent Options Inherited?

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


Question: What is See Also?

Answer: k u b e c t l   -   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 k u b e c t l   r o l l o u t   h i s t o r y   -   V i e w   r o l l o u t   h i s t o r y k u b e c t l   r o l l o u t   p a u s e   -   M a r k   t h e   p r o v i d e d   r e s o u r c e   a s   p a u s e d k u b e c t l   r o l l o u t   r e s t a r t   -   R e s t a r t   a   r e s o u r c e k u b e c t l   r o l l o u t   r e s u m e   -   R e s u m e   a   p a u s e d   r e s o u r c e k u b e c t l   r o l l o u t   s t a t u s   -   S h o w   t h e   s t a t u s   o f   t h e   r o l l o u t k u b e c t l   r o l l o u t   u n d o   -   U n d o   a   p r e v i o u s   r o l l o u t   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 Define a Command and Arguments for a Container?

Answer: Define a Command and Arguments for a ContainerThis page shows how to define commands and arguments when you run a container in a Pod.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.Define a command and arguments when you create a PodWhen you create a Pod, you can define a command and arguments for the containers that run in the Pod. To define a command, include the command field in the configuration file. To define arguments for the command, include the args field in the configuration file. The command and arguments that you define cannot be changed after the Pod is created.The command and arguments that you define in the configuration file override the default command and arguments provided by the container image. If you define args, but do not define a command, the default command is used with your new arguments.Note:The command field corresponds to ENTRYPOINT, and the args field corresponds to CMD in some container runtimes.In this exercise, you create a Pod that runs one container. The configuration file for the Pod defines a command and two arguments:pods/commands.yaml apiVersion: v1 kind: Pod metadata: name: command-demo labels: purpose: demonstrate-command spec: containers: - name: command-demo-container image: debian command: ["printenv"] args: ["HOSTNAME", "KUBERNETES_PORT"] restartPolicy: OnFailure Create a Pod based on the YAML configuration file:kubectl apply -f https://k8s.io/examples/pods/commands.yaml List the running Pods:kubectl get pods The output shows that the container that ran in the command-demo Pod has completed.To see the output of the command that ran in the container, view the logs from the Pod:kubectl logs command-demo The output shows the values of the HOSTNAME and KUBERNETES_PORT environment variables:command-demo tcp://10.3.240.1:443 Use environment variables to define argumentsIn the preceding example, you defined the arguments directly by providing strings. As an alternative to providing strings directly, you can define arguments by using environment variables:env: - name: MESSAGE value: "hello world" command: ["/bin/echo"] args: ["$(MESSAGE)"] This means you can define an argument for a Pod using any of the techniques available for defining environment variables, including ConfigMaps and Secrets.Note:The environment variable appears in parentheses, "$(VAR)". This is required for the variable to be expanded in the command or args field.Run a command in a shellIn some cases, you need your command to run in a shell. For example, your command might consist of several commands piped together


Question: How does Define a Command and Arguments for a Container work?

Answer: Define a Command and Arguments for a ContainerThis page shows how to define commands and arguments when you run a container in a Pod.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.Define a command and arguments when you create a PodWhen you create a Pod, you can define a command and arguments for the containers that run in the Pod. To define a command, include the command field in the configuration file. To define arguments for the command, include the args field in the configuration file. The command and arguments that you define cannot be changed after the Pod is created.The command and arguments that you define in the configuration file override the default command and arguments provided by the container image. If you define args, but do not define a command, the default command is used with your new arguments.Note:The command field corresponds to ENTRYPOINT, and the args field corresponds to CMD in some container runtimes.In this exercise, you create a Pod that runs one container. The configuration file for the Pod defines a command and two arguments:pods/commands.yaml apiVersion: v1 kind: Pod metadata: name: command-demo labels: purpose: demonstrate-command spec: containers: - name: command-demo-container image: debian command: ["printenv"] args: ["HOSTNAME", "KUBERNETES_PORT"] restartPolicy: OnFailure Create a Pod based on the YAML configuration file:kubectl apply -f https://k8s.io/examples/pods/commands.yaml List the running Pods:kubectl get pods The output shows that the container that ran in the command-demo Pod has completed.To see the output of the command that ran in the container, view the logs from the Pod:kubectl logs command-demo The output shows the values of the HOSTNAME and KUBERNETES_PORT environment variables:command-demo tcp://10.3.240.1:443 Use environment variables to define argumentsIn the preceding example, you defined the arguments directly by providing strings. As an alternative to providing strings directly, you can define arguments by using environment variables:env: - name: MESSAGE value: "hello world" command: ["/bin/echo"] args: ["$(MESSAGE)"] This means you can define an argument for a Pod using any of the techniques available for defining environment variables, including ConfigMaps and Secrets.Note:The environment variable appears in parentheses, "$(VAR)". This is required for the variable to be expanded in the command or args field.Run a command in a shellIn some cases, you need your command to run in a shell. For example, your command might consist of several commands piped together


Question: When would you use Define a Command and Arguments for a Container?

Answer: Define a Command and Arguments for a ContainerThis page shows how to define commands and arguments when you run a container in a Pod.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.Define a command and arguments when you create a PodWhen you create a Pod, you can define a command and arguments for the containers that run in the Pod. To define a command, include the command field in the configuration file. To define arguments for the command, include the args field in the configuration file. The command and arguments that you define cannot be changed after the Pod is created.The command and arguments that you define in the configuration file override the default command and arguments provided by the container image. If you define args, but do not define a command, the default command is used with your new arguments.Note:The command field corresponds to ENTRYPOINT, and the args field corresponds to CMD in some container runtimes.In this exercise, you create a Pod that runs one container. The configuration file for the Pod defines a command and two arguments:pods/commands.yaml apiVersion: v1 kind: Pod metadata: name: command-demo labels: purpose: demonstrate-command spec: containers: - name: command-demo-container image: debian command: ["printenv"] args: ["HOSTNAME", "KUBERNETES_PORT"] restartPolicy: OnFailure Create a Pod based on the YAML configuration file:kubectl apply -f https://k8s.io/examples/pods/commands.yaml List the running Pods:kubectl get pods The output shows that the container that ran in the command-demo Pod has completed.To see the output of the command that ran in the container, view the logs from the Pod:kubectl logs command-demo The output shows the values of the HOSTNAME and KUBERNETES_PORT environment variables:command-demo tcp://10.3.240.1:443 Use environment variables to define argumentsIn the preceding example, you defined the arguments directly by providing strings. As an alternative to providing strings directly, you can define arguments by using environment variables:env: - name: MESSAGE value: "hello world" command: ["/bin/echo"] args: ["$(MESSAGE)"] This means you can define an argument for a Pod using any of the techniques available for defining environment variables, including ConfigMaps and Secrets.Note:The environment variable appears in parentheses, "$(VAR)". This is required for the variable to be expanded in the command or args field.Run a command in a shellIn some cases, you need your command to run in a shell. For example, your command might consist of several commands piped together


Question: What are the benefits of Define a Command and Arguments for a Container?

Answer: Define a Command and Arguments for a ContainerThis page shows how to define commands and arguments when you run a container in a Pod.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.Define a command and arguments when you create a PodWhen you create a Pod, you can define a command and arguments for the containers that run in the Pod. To define a command, include the command field in the configuration file. To define arguments for the command, include the args field in the configuration file. The command and arguments that you define cannot be changed after the Pod is created.The command and arguments that you define in the configuration file override the default command and arguments provided by the container image. If you define args, but do not define a command, the default command is used with your new arguments.Note:The command field corresponds to ENTRYPOINT, and the args field corresponds to CMD in some container runtimes.In this exercise, you create a Pod that runs one container. The configuration file for the Pod defines a command and two arguments:pods/commands.yaml apiVersion: v1 kind: Pod metadata: name: command-demo labels: purpose: demonstrate-command spec: containers: - name: command-demo-container image: debian command: ["printenv"] args: ["HOSTNAME", "KUBERNETES_PORT"] restartPolicy: OnFailure Create a Pod based on the YAML configuration file:kubectl apply -f https://k8s.io/examples/pods/commands.yaml List the running Pods:kubectl get pods The output shows that the container that ran in the command-demo Pod has completed.To see the output of the command that ran in the container, view the logs from the Pod:kubectl logs command-demo The output shows the values of the HOSTNAME and KUBERNETES_PORT environment variables:command-demo tcp://10.3.240.1:443 Use environment variables to define argumentsIn the preceding example, you defined the arguments directly by providing strings. As an alternative to providing strings directly, you can define arguments by using environment variables:env: - name: MESSAGE value: "hello world" command: ["/bin/echo"] args: ["$(MESSAGE)"] This means you can define an argument for a Pod using any of the techniques available for defining environment variables, including ConfigMaps and Secrets.Note:The environment variable appears in parentheses, "$(VAR)". This is required for the variable to be expanded in the command or args field.Run a command in a shellIn some cases, you need your command to run in a shell. For example, your command might consist of several commands piped together


Question: What is Define a Command and Arguments for a Container?

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


Question: What is Before you begin?

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


Question: What is Define a command and arguments when you create a Pod?

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


Question: What is Note:?

Answer: I n   t h i s   e x e r c i s e ,   y o u   c r e a t e   a   P o d   t h a t   r u n s   o n e   c o n t a i n e r .   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   P o d   d e f i n e s   a   c o m m a n d   a n d   t w o   a r g u m e n t s :   a p i V e r s i o n :   v 1   k i n d :   P o d   m e t a d a t a :   n a m e :   c o m m a n d - d e m o   l a b e l s :   p u r p o s e :   d e m o n s t r a t e - c o m m a n d   s p e c :   c o n t a i n e r s :   -   n a m e :   c o m m a n d - d e m o - c o n t a i n e r   i m a g e :   d e b i a n   c o m m a n d :   [ " p r i n t e n v " ]   a r g s :   [ " H O S T N A M E " ,   " K U B E R N E T E S _ P O R T " ]   r e s t a r t P o l i c y :   O n F a i l u r e   C r e a t e   a   P o d   b a s e d   o n   t h e   Y A M L   c o n f i g u r a t i o n   f i l 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 / p o d s / c o m m a n d s . y a m l   L i s t   t h e   r u n n i n g   P o d s : k u b e c t l   g e t   p o d s   T h e   o u t p u t   s h o w s   t h a t   t h e   c o n t a i n e r   t h a t   r a n   i n   t h e   c o m m a n d - d e m o   P o d   h a s   c o m p l e t e d . T o   s e e   t h e   o u t p u t   o f   t h e   c o m m a n d   t h a t   r a n   i n   t h e   c o n t a i n e r ,   v i e w   t h e   l o g s   f r o m   t h e   P o d : k u b e c t l   l o g s   c o m m a n d - d e m o   T h e   o u t p u t   s h o w s   t h e   v a l u e s   o f   t h e   H O S T N A M E   a n d   K U B E R N E T E S _ P O R T   e n v i r o n m e n t   v a r i a b l e s : c o m m a n d - d e m o   t c p : / / 1 0 . 3 . 2 4 0 . 1 : 4 4 3   C r e a t e   a   P o d   b a s e d   o n   t h e   Y A M L   c o n f i g u r a t i o n   f i l 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 / p o d s / c o m m a n d s . y a m l   L i s t   t h e   r u n n i n g   P o d s :   k u b e c t l   g e t   p o d s   T h e   o u t p u t   s h


Question: What is Use environment variables to define arguments?

Answer: I n   t h e   p r e c e d i n g   e x a m p l e ,   y o u   d e f i n e d   t h e   a r g u m e n t s   d i r e c t l y   b y   p r o v i d i n g   s t r i n g s .   A s   a n   a l t e r n a t i v e   t o   p r o v i d i n g   s t r i n g s   d i r e c t l y ,   y o u   c a n   d e f i n e   a r g u m e n t s   b y   u s i n g   e n v i r o n m e n t   v a r i a b l e s :   e n v :   -   n a m e :   M E S S A G E   v a l u e :   " h e l l o   w o r l d "   c o m m a n d :   [ " / b i n / e c h o " ]   a r g s :   [ " $ ( M E S S A G E ) " ]   T h i s   m e a n s   y o u   c a n   d e f i n e   a n   a r g u m e n t   f o r   a   P o d   u s i n g   a n y   o f   t h e   t e c h n i q u e s   a v a i l a b l e   f o r   d e f i n i n g   e n v i r o n m e n t   v a r i a b l e s ,   i n c l u d i n g   C o n f i g M a p s   a n d   S e c r e t s .


Question: What is Run a command in a shell?

Answer: I n   s o m e   c a s e s ,   y o u   n e e d   y o u r   c o m m a n d   t o   r u n   i n   a   s h e l l .   F o r   e x a m p l e ,   y o u r   c o m m a n d   m i g h t   c o n s i s t   o f   s e v e r a l   c o m m a n d s   p i p e d   t o g e t h e r ,   o r   i t   m i g h t   b e   a   s h e l l   s c r i p t .   T o   r u n   y o u r   c o m m a n d   i n   a   s h e l l ,   w r a p   i t   l i k e   t h i s :   c o m m a n d :   [ " / b i n / s h " ]   a r g s :   [ " - c " ,   " w h i l e   t r u e ;   d o   e c h o   h e l l o ;   s l e e p   1 0 ; d o n e " ]


Question: What is What's next?

Answer: L e a r n   m o r e   a b o u t   c o n f i g u r i n g   p o d s   a n d   c o n t a i n e r s . L e a r n   m o r e   a b o u t   r u n n i n g   c o m m a n d s   i n   a   c o n t a i n e r . S e e   C o n t a i n e r .


Question: What is Perform a Rollback on a DaemonSet?

Answer: Perform a Rollback on a DaemonSetThis page shows how to perform a rollback on a DaemonSet.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 KubernetesYour Kubernetes server must be at or later than version 1.7.To check the version, enter kubectl version.You should already know how to perform a rolling update on a DaemonSet.Performing a rollback on a DaemonSetStep 1: Find the DaemonSet revision you want to roll back toYou can skip this step if you only want to roll back to the last revision.List all revisions of a DaemonSet:kubectl rollout history daemonset <daemonset-name> This returns a list of DaemonSet revisions:daemonsets "<daemonset-name>" REVISION CHANGE-CAUSE 1 ... 2 ... ... Change cause is copied from DaemonSet annotation kubernetes.io/change-cause to its revisions upon creation. You may specify --record=true in kubectl to record the command executed in the change cause annotation.To see the details of a specific revision:kubectl rollout history daemonset <daemonset-name> --revision=1 This returns the details of that revision:daemonsets "<daemonset-name>" with revision #1 Pod Template: Labels: foo=bar Containers: app: Image: ... Port: ... Environment: ... Mounts: ... Volumes: ... Step 2: Roll back to a specific revision# Specify the revision number you get from Step 1 in --to-revision kubectl rollout undo daemonset <daemonset-name> --to-revision=<revision> If it succeeds, the command returns:daemonset "<daemonset-name>" rolled back Note:If --to-revision flag is not specified, kubectl picks the most recent revision.Step 3: Watch the progress of the DaemonSet rollbackkubectl rollout undo daemonset tells the server to start rolling back the DaemonSet. The real rollback is done asynchronously inside the cluster control plane.To watch the progress of the rollback:kubectl rollout status ds/<daemonset-name> When the rollback is complete, the output is similar to:daemonset "<daemonset-name>" successfully rolled out Understanding DaemonSet revisionsIn the previous kubectl rollout history step, you got a list of DaemonSet revisions. Each revision is stored in a resource named ControllerRevision.To see what is stored in each revision, find the DaemonSet revision raw resources:kubectl get controllerrevision -l <daemonset-selector-key>=<daemonset-selector-value> This returns a list of ControllerRevisions:NAME CONTROLLER REVISION AGE <daemonset-name>-<revision-hash> DaemonSet/<daemonset-name> 1 1h <daemonset-name>-<revision-hash> DaemonSet/<daemonset-name> 2 1h Each ControllerRevision stores the annotations and template of a DaemonSet revision.kubectl rollout undo takes a specific


Question: How does Perform a Rollback on a DaemonSet work?

Answer: Perform a Rollback on a DaemonSetThis page shows how to perform a rollback on a DaemonSet.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 KubernetesYour Kubernetes server must be at or later than version 1.7.To check the version, enter kubectl version.You should already know how to perform a rolling update on a DaemonSet.Performing a rollback on a DaemonSetStep 1: Find the DaemonSet revision you want to roll back toYou can skip this step if you only want to roll back to the last revision.List all revisions of a DaemonSet:kubectl rollout history daemonset <daemonset-name> This returns a list of DaemonSet revisions:daemonsets "<daemonset-name>" REVISION CHANGE-CAUSE 1 ... 2 ... ... Change cause is copied from DaemonSet annotation kubernetes.io/change-cause to its revisions upon creation. You may specify --record=true in kubectl to record the command executed in the change cause annotation.To see the details of a specific revision:kubectl rollout history daemonset <daemonset-name> --revision=1 This returns the details of that revision:daemonsets "<daemonset-name>" with revision #1 Pod Template: Labels: foo=bar Containers: app: Image: ... Port: ... Environment: ... Mounts: ... Volumes: ... Step 2: Roll back to a specific revision# Specify the revision number you get from Step 1 in --to-revision kubectl rollout undo daemonset <daemonset-name> --to-revision=<revision> If it succeeds, the command returns:daemonset "<daemonset-name>" rolled back Note:If --to-revision flag is not specified, kubectl picks the most recent revision.Step 3: Watch the progress of the DaemonSet rollbackkubectl rollout undo daemonset tells the server to start rolling back the DaemonSet. The real rollback is done asynchronously inside the cluster control plane.To watch the progress of the rollback:kubectl rollout status ds/<daemonset-name> When the rollback is complete, the output is similar to:daemonset "<daemonset-name>" successfully rolled out Understanding DaemonSet revisionsIn the previous kubectl rollout history step, you got a list of DaemonSet revisions. Each revision is stored in a resource named ControllerRevision.To see what is stored in each revision, find the DaemonSet revision raw resources:kubectl get controllerrevision -l <daemonset-selector-key>=<daemonset-selector-value> This returns a list of ControllerRevisions:NAME CONTROLLER REVISION AGE <daemonset-name>-<revision-hash> DaemonSet/<daemonset-name> 1 1h <daemonset-name>-<revision-hash> DaemonSet/<daemonset-name> 2 1h Each ControllerRevision stores the annotations and template of a DaemonSet revision.kubectl rollout undo takes a specific


Question: When would you use Perform a Rollback on a DaemonSet?

Answer: Perform a Rollback on a DaemonSetThis page shows how to perform a rollback on a DaemonSet.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 KubernetesYour Kubernetes server must be at or later than version 1.7.To check the version, enter kubectl version.You should already know how to perform a rolling update on a DaemonSet.Performing a rollback on a DaemonSetStep 1: Find the DaemonSet revision you want to roll back toYou can skip this step if you only want to roll back to the last revision.List all revisions of a DaemonSet:kubectl rollout history daemonset <daemonset-name> This returns a list of DaemonSet revisions:daemonsets "<daemonset-name>" REVISION CHANGE-CAUSE 1 ... 2 ... ... Change cause is copied from DaemonSet annotation kubernetes.io/change-cause to its revisions upon creation. You may specify --record=true in kubectl to record the command executed in the change cause annotation.To see the details of a specific revision:kubectl rollout history daemonset <daemonset-name> --revision=1 This returns the details of that revision:daemonsets "<daemonset-name>" with revision #1 Pod Template: Labels: foo=bar Containers: app: Image: ... Port: ... Environment: ... Mounts: ... Volumes: ... Step 2: Roll back to a specific revision# Specify the revision number you get from Step 1 in --to-revision kubectl rollout undo daemonset <daemonset-name> --to-revision=<revision> If it succeeds, the command returns:daemonset "<daemonset-name>" rolled back Note:If --to-revision flag is not specified, kubectl picks the most recent revision.Step 3: Watch the progress of the DaemonSet rollbackkubectl rollout undo daemonset tells the server to start rolling back the DaemonSet. The real rollback is done asynchronously inside the cluster control plane.To watch the progress of the rollback:kubectl rollout status ds/<daemonset-name> When the rollback is complete, the output is similar to:daemonset "<daemonset-name>" successfully rolled out Understanding DaemonSet revisionsIn the previous kubectl rollout history step, you got a list of DaemonSet revisions. Each revision is stored in a resource named ControllerRevision.To see what is stored in each revision, find the DaemonSet revision raw resources:kubectl get controllerrevision -l <daemonset-selector-key>=<daemonset-selector-value> This returns a list of ControllerRevisions:NAME CONTROLLER REVISION AGE <daemonset-name>-<revision-hash> DaemonSet/<daemonset-name> 1 1h <daemonset-name>-<revision-hash> DaemonSet/<daemonset-name> 2 1h Each ControllerRevision stores the annotations and template of a DaemonSet revision.kubectl rollout undo takes a specific


Question: What are the benefits of Perform a Rollback on a DaemonSet?

Answer: Perform a Rollback on a DaemonSetThis page shows how to perform a rollback on a DaemonSet.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 KubernetesYour Kubernetes server must be at or later than version 1.7.To check the version, enter kubectl version.You should already know how to perform a rolling update on a DaemonSet.Performing a rollback on a DaemonSetStep 1: Find the DaemonSet revision you want to roll back toYou can skip this step if you only want to roll back to the last revision.List all revisions of a DaemonSet:kubectl rollout history daemonset <daemonset-name> This returns a list of DaemonSet revisions:daemonsets "<daemonset-name>" REVISION CHANGE-CAUSE 1 ... 2 ... ... Change cause is copied from DaemonSet annotation kubernetes.io/change-cause to its revisions upon creation. You may specify --record=true in kubectl to record the command executed in the change cause annotation.To see the details of a specific revision:kubectl rollout history daemonset <daemonset-name> --revision=1 This returns the details of that revision:daemonsets "<daemonset-name>" with revision #1 Pod Template: Labels: foo=bar Containers: app: Image: ... Port: ... Environment: ... Mounts: ... Volumes: ... Step 2: Roll back to a specific revision# Specify the revision number you get from Step 1 in --to-revision kubectl rollout undo daemonset <daemonset-name> --to-revision=<revision> If it succeeds, the command returns:daemonset "<daemonset-name>" rolled back Note:If --to-revision flag is not specified, kubectl picks the most recent revision.Step 3: Watch the progress of the DaemonSet rollbackkubectl rollout undo daemonset tells the server to start rolling back the DaemonSet. The real rollback is done asynchronously inside the cluster control plane.To watch the progress of the rollback:kubectl rollout status ds/<daemonset-name> When the rollback is complete, the output is similar to:daemonset "<daemonset-name>" successfully rolled out Understanding DaemonSet revisionsIn the previous kubectl rollout history step, you got a list of DaemonSet revisions. Each revision is stored in a resource named ControllerRevision.To see what is stored in each revision, find the DaemonSet revision raw resources:kubectl get controllerrevision -l <daemonset-selector-key>=<daemonset-selector-value> This returns a list of ControllerRevisions:NAME CONTROLLER REVISION AGE <daemonset-name>-<revision-hash> DaemonSet/<daemonset-name> 1 1h <daemonset-name>-<revision-hash> DaemonSet/<daemonset-name> 2 1h Each ControllerRevision stores the annotations and template of a DaemonSet revision.kubectl rollout undo takes a specific


Question: What is Perform a Rollback on a DaemonSet?

Answer: T h i s   p a g e   s h o w s   h o w   t o   p e r f o r m   a   r o l l b a c k   o n   a   D a e m o n S e t .


Question: What is Before you begin?

Answer: Y o u   n e e d   t o   h a v e   a   K u b e r n e t e s   c l u s t e r ,   a n d   t h e   k u b e c t l   c o m m a n d - l i n e   t o o l   m u s t   b e   c o n f i g u r e d   t o   c o m m u n i c a t e   w i t h   y o u r   c l u s t e r .   I t   i s   r e c o m m e n d e d   t o   r u n   t h i s   t u t o r i a l   o n   a   c l u s t e r   w i t h   a t   l e a s t   t w o   n o d e s   t h a t   a r e   n o t   a c t i n g   a s   c o n t r o l   p l a n e   h o s t s .   I f   y o u   d o   n o t   a l r e a d y   h a v e   a   c l u s t e r ,   y o u   c a n   c r e a t e   o n e   b y   u s i n g   m i n i k u b e   o r   y o u   c a n   u s e   o n e   o f   t h e s e   K u b e r n e t e s   p l a y g r o u n d s : i x i m i u z   L a b s K i l l e r c o d a K o d e K l o u d P l a y   w i t h   K u b e r n e t e s Y o u r   K u b e r n e t e s   s e r v e r   m u s t   b e   a t   o r   l a t e r   t h a n   v e r s i o n   1 . 7 . 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 .   Y o


Question: What is Step 1: Find the DaemonSet revision you want to roll back to?

Answer: Y o u   c a n   s k i p   t h i s   s t e p   i f   y o u   o n l y   w a n t   t o   r o l l   b a c k   t o   t h e   l a s t   r e v i s i o n .   L i s t   a l l   r e v i s i o n s   o f   a   D a e m o n S e t :   k u b e c t l   r o l l o u t   h i s t o r y   d a e m o n s e t   < d a e m o n s e t - n a m e >   T h i s   r e t u r n s   a   l i s t   o f   D a e m o n S e t   r e v i s i o n s :   d a e m o n s e t s   " < d a e m o n s e t - n a m e > "   R E V I S I O N   C H A N G E - C A U S E   1   . . .   2   . . .   . . .   C h a n g e   c a u s e   i s   c o p i e d   f r o m   D a e m o n S e t   a n n o t a t i o n   k u b e r n e t e s . i o / c h a n g e - c a u s e   t o   i t s   r e v i s i o n s   u p o n   c r e a t i o n .   Y o u   m a y   s p e c i f y   - - r e c o r d = t r u e   i n   k u b e c t l   t o   r e c o r d   t h e   c o m m a n d   e x e c u t e d   i n   t h e   c h a n g e   c a u s e   a n n o t a t i o n .   T o   s e e   t h e   d e t a i l s   o f   a   s p e c i f i c   r e v i s i o n :   k u b e c t l   r o l l o u t   h i s t o r y   d a e m o n s e t   < d a e m o n s e t - n a m e >   - - r e v i s i o n = 1   T h i s   r e t u r n s   t h e   d e t a i l s   o f   t h a t   r e v i s i o n :   d a e m o n s e t s   " < d a e m o n s e t - n a m e > "   w i t h   r e v i s i o n   # 1   P o d   T e m p l a t e :   L a b e l s :   f o o = b a r   C o n t a i n e r s :   a p p :   I m a g e :   . . .   P o r t :   . . .   E n v i r o n m e n t :   . . .   M o u n t s :   . . .   V o l u m e s :   . . .


Question: What is Step 2: Roll back to a specific revision?

Answer: #   S p e c i f y   t h e   r e v i s i o n   n u m b e r   y o u   g e t   f r o m   S t e p   1   i n   - - t o - r e v i s i o n   k u b e c t l   r o l l o u t   u n d o   d a e m o n s e t   < d a e m o n s e t - n a m e >   - - t o - r e v i s i o n = < r e v i s i o n >   I f   i t   s u c c e e d s ,   t h e   c o m m a n d   r e t u r n s :   d a e m o n s e t   " < d a e m o n s e t - n a m e > "   r o l l e d   b a c k


Question: What is Step 3: Watch the progress of the DaemonSet rollback?

Answer: k u b e c t l   r o l l o u t   u n d o   d a e m o n s e t   t e l l s   t h e   s e r v e r   t o   s t a r t   r o l l i n g   b a c k   t h e   D a e m o n S e t .   T h e   r e a l   r o l l b a c k   i s   d o n e   a s y n c h r o n o u s l y   i n s i d e   t h e   c l u s t e r   c o n t r o l   p l a n e .   T o   w a t c h   t h e   p r o g r e s s   o f   t h e   r o l l b a c k :   k u b e c t l   r o l l o u t   s t a t u s   d s / < d a e m o n s e t - n a m e >   W h e n   t h e   r o l l b a c k   i s   c o m p l e t e ,   t h e   o u t p u t   i s   s i m i l a r   t o :   d a e m o n s e t   " < d a e m o n s e t - n a m e > "   s u c c e s s f u l l y   r o l l e d   o u t


Question: What is Understanding DaemonSet revisions?

Answer: I n   t h e   p r e v i o u s   k u b e c t l   r o l l o u t   h i s t o r y   s t e p ,   y o u   g o t   a   l i s t   o f   D a e m o n S e t   r e v i s i o n s .   E a c h   r e v i s i o n   i s   s t o r e d   i n   a   r e s o u r c e   n a m e d   C o n t r o l l e r R e v i s i o n .   T o   s e e   w h a t   i s   s t o r e d   i n   e a c h   r e v i s i o n ,   f i n d   t h e   D a e m o n S e t   r e v i s i o n   r a w   r e s o u r c e s :   k u b e c t l   g e t   c o n t r o l l e r r e v i s i o n   - l   < d a e m o n s e t - s e l e c t o r - k e y > = < d a e m o n s e t - s e l e c t o r - v a l u e >   T h i s   r e t u r n s   a   l i s t   o f   C o n t r o l l e r R e v i s i o n s :   N A M E   C O N T R O L L E R   R E V I S I O N   A G E   < d a e m o n s e t - n a m e > - < r e v i s i o n - h a s h >   D a e m o n S e t / < d a e m o n s e t - n a m e >   1   1 h   < d a e m o n s e t - n a m e > - < r e v i s i o n - h a s h >   D a e m o n S e t / < d a e m o n s e t - n a m e >   2   1 h   E a c h   C o n t r o l l e r R e v i s i o n   s t o r e s   t h e   a n n o t a t i o n s   a n d   t e m p l a t e   o f   a   D a e m o n S e t   r e v i s i o n .   k u b e c t l   r o l l o u t   u n d o   t a k e s   a   s p e c i f i c   C o n t r o l l e r R e v i s i o n   a n d   r e p l a c e s   D a e m o n S e t   t e m p l a t e   w i t h   t h e   t e m p l a t e   s t o r e d   i n   t h e   C o n t r o l l e r R e v i s i o n .   k u b e c t l   r o l l o u t   u n d o   i s   e q u i v a l e n t   t o   u p d a t i n g   D a e m o n S e t   t e m p l a t e   t o   a   p r e v i o u s   r e v i s i o n   t h r o u g h   o t h e r   c o m m a n d s ,   s u c h   a s   k u b e c t l   e d i t   o r   k u b e c t l   a p p l y .


Question: What is Troubleshooting?

Answer: S e e   t r o u b l e s h o o t i n g   D a e m o n S e t   r o l l i n g   u p d a t e .


Question: What is Schedule GPUs?

Answer: Schedule GPUsConfigure and schedule GPUs for use as a resource by nodes in a cluster.FEATURE STATE: Kubernetes v1.26 [stable]Kubernetes includes stable support for managing AMD and NVIDIA GPUs (graphical processing units) across different nodes in your cluster, using device plugins.This page describes how users can consume GPUs, and outlines some of the limitations in the implementation.Using device pluginsKubernetes implements device plugins to let Pods access specialized hardware features such as GPUs.Note: This section links to third party projects that provide functionality required by Kubernetes. The Kubernetes project authors aren't responsible for these projects, which are listed alphabetically. To add a project to this list, read the content guide before submitting a change. More information.As an administrator, you have to install GPU drivers from the corresponding hardware vendor on the nodes and run the corresponding device plugin from the GPU vendor. Here are some links to vendors' instructions:AMDIntelNVIDIAOnce you have installed the plugin, your cluster exposes a custom schedulable resource such as amd.com/gpu or nvidia.com/gpu.You can consume these GPUs from your containers by requesting the custom GPU resource, the same way you request cpu or memory. However, there are some limitations in how you specify the resource requirements for custom devices.GPUs are only supposed to be specified in the limits section, which means:You can specify GPU limits without specifying requests, because Kubernetes will use the limit as the request value by default.You can specify GPU in both limits and requests but these two values must be equal.You cannot specify GPU requests without specifying limits.Here's an example manifest for a Pod that requests a GPU:apiVersion: v1 kind: Pod metadata: name: example-vector-add spec: restartPolicy: OnFailure containers: - name: example-vector-add image: "registry.example/example-vector-add:v42" resources: limits: gpu-vendor.example/example-gpu: 1 # requesting 1 GPU Manage clusters with different types of GPUsIf different nodes in your cluster have different types of GPUs, then you can use Node Labels and Node Selectors to schedule pods to appropriate nodes.For example:# Label your nodes with the accelerator type they have. kubectl label nodes node1 accelerator=example-gpu-x100 kubectl label nodes node2 accelerator=other-gpu-k915 That label key accelerator is just an example; you can use a different label key if you prefer.Automatic node labellingAs an administrator, you can automatically discover and label all your GPU enabled nodes by deploying Kubernetes Node Feature Discovery (NFD). NFD detects the hardware features that are available on each node in a Kubernetes cluster. Typically, NFD is configured to advertise those features as node labels, but NFD can also add extended resources, annotations, and node taints. NFD is compatible with all supported versions of Kubernetes. By default NFD create the feature


Question: How does Schedule GPUs work?

Answer: Schedule GPUsConfigure and schedule GPUs for use as a resource by nodes in a cluster.FEATURE STATE: Kubernetes v1.26 [stable]Kubernetes includes stable support for managing AMD and NVIDIA GPUs (graphical processing units) across different nodes in your cluster, using device plugins.This page describes how users can consume GPUs, and outlines some of the limitations in the implementation.Using device pluginsKubernetes implements device plugins to let Pods access specialized hardware features such as GPUs.Note: This section links to third party projects that provide functionality required by Kubernetes. The Kubernetes project authors aren't responsible for these projects, which are listed alphabetically. To add a project to this list, read the content guide before submitting a change. More information.As an administrator, you have to install GPU drivers from the corresponding hardware vendor on the nodes and run the corresponding device plugin from the GPU vendor. Here are some links to vendors' instructions:AMDIntelNVIDIAOnce you have installed the plugin, your cluster exposes a custom schedulable resource such as amd.com/gpu or nvidia.com/gpu.You can consume these GPUs from your containers by requesting the custom GPU resource, the same way you request cpu or memory. However, there are some limitations in how you specify the resource requirements for custom devices.GPUs are only supposed to be specified in the limits section, which means:You can specify GPU limits without specifying requests, because Kubernetes will use the limit as the request value by default.You can specify GPU in both limits and requests but these two values must be equal.You cannot specify GPU requests without specifying limits.Here's an example manifest for a Pod that requests a GPU:apiVersion: v1 kind: Pod metadata: name: example-vector-add spec: restartPolicy: OnFailure containers: - name: example-vector-add image: "registry.example/example-vector-add:v42" resources: limits: gpu-vendor.example/example-gpu: 1 # requesting 1 GPU Manage clusters with different types of GPUsIf different nodes in your cluster have different types of GPUs, then you can use Node Labels and Node Selectors to schedule pods to appropriate nodes.For example:# Label your nodes with the accelerator type they have. kubectl label nodes node1 accelerator=example-gpu-x100 kubectl label nodes node2 accelerator=other-gpu-k915 That label key accelerator is just an example; you can use a different label key if you prefer.Automatic node labellingAs an administrator, you can automatically discover and label all your GPU enabled nodes by deploying Kubernetes Node Feature Discovery (NFD). NFD detects the hardware features that are available on each node in a Kubernetes cluster. Typically, NFD is configured to advertise those features as node labels, but NFD can also add extended resources, annotations, and node taints. NFD is compatible with all supported versions of Kubernetes. By default NFD create the feature


Question: When would you use Schedule GPUs?

Answer: Schedule GPUsConfigure and schedule GPUs for use as a resource by nodes in a cluster.FEATURE STATE: Kubernetes v1.26 [stable]Kubernetes includes stable support for managing AMD and NVIDIA GPUs (graphical processing units) across different nodes in your cluster, using device plugins.This page describes how users can consume GPUs, and outlines some of the limitations in the implementation.Using device pluginsKubernetes implements device plugins to let Pods access specialized hardware features such as GPUs.Note: This section links to third party projects that provide functionality required by Kubernetes. The Kubernetes project authors aren't responsible for these projects, which are listed alphabetically. To add a project to this list, read the content guide before submitting a change. More information.As an administrator, you have to install GPU drivers from the corresponding hardware vendor on the nodes and run the corresponding device plugin from the GPU vendor. Here are some links to vendors' instructions:AMDIntelNVIDIAOnce you have installed the plugin, your cluster exposes a custom schedulable resource such as amd.com/gpu or nvidia.com/gpu.You can consume these GPUs from your containers by requesting the custom GPU resource, the same way you request cpu or memory. However, there are some limitations in how you specify the resource requirements for custom devices.GPUs are only supposed to be specified in the limits section, which means:You can specify GPU limits without specifying requests, because Kubernetes will use the limit as the request value by default.You can specify GPU in both limits and requests but these two values must be equal.You cannot specify GPU requests without specifying limits.Here's an example manifest for a Pod that requests a GPU:apiVersion: v1 kind: Pod metadata: name: example-vector-add spec: restartPolicy: OnFailure containers: - name: example-vector-add image: "registry.example/example-vector-add:v42" resources: limits: gpu-vendor.example/example-gpu: 1 # requesting 1 GPU Manage clusters with different types of GPUsIf different nodes in your cluster have different types of GPUs, then you can use Node Labels and Node Selectors to schedule pods to appropriate nodes.For example:# Label your nodes with the accelerator type they have. kubectl label nodes node1 accelerator=example-gpu-x100 kubectl label nodes node2 accelerator=other-gpu-k915 That label key accelerator is just an example; you can use a different label key if you prefer.Automatic node labellingAs an administrator, you can automatically discover and label all your GPU enabled nodes by deploying Kubernetes Node Feature Discovery (NFD). NFD detects the hardware features that are available on each node in a Kubernetes cluster. Typically, NFD is configured to advertise those features as node labels, but NFD can also add extended resources, annotations, and node taints. NFD is compatible with all supported versions of Kubernetes. By default NFD create the feature


Question: What are the benefits of Schedule GPUs?

Answer: Schedule GPUsConfigure and schedule GPUs for use as a resource by nodes in a cluster.FEATURE STATE: Kubernetes v1.26 [stable]Kubernetes includes stable support for managing AMD and NVIDIA GPUs (graphical processing units) across different nodes in your cluster, using device plugins.This page describes how users can consume GPUs, and outlines some of the limitations in the implementation.Using device pluginsKubernetes implements device plugins to let Pods access specialized hardware features such as GPUs.Note: This section links to third party projects that provide functionality required by Kubernetes. The Kubernetes project authors aren't responsible for these projects, which are listed alphabetically. To add a project to this list, read the content guide before submitting a change. More information.As an administrator, you have to install GPU drivers from the corresponding hardware vendor on the nodes and run the corresponding device plugin from the GPU vendor. Here are some links to vendors' instructions:AMDIntelNVIDIAOnce you have installed the plugin, your cluster exposes a custom schedulable resource such as amd.com/gpu or nvidia.com/gpu.You can consume these GPUs from your containers by requesting the custom GPU resource, the same way you request cpu or memory. However, there are some limitations in how you specify the resource requirements for custom devices.GPUs are only supposed to be specified in the limits section, which means:You can specify GPU limits without specifying requests, because Kubernetes will use the limit as the request value by default.You can specify GPU in both limits and requests but these two values must be equal.You cannot specify GPU requests without specifying limits.Here's an example manifest for a Pod that requests a GPU:apiVersion: v1 kind: Pod metadata: name: example-vector-add spec: restartPolicy: OnFailure containers: - name: example-vector-add image: "registry.example/example-vector-add:v42" resources: limits: gpu-vendor.example/example-gpu: 1 # requesting 1 GPU Manage clusters with different types of GPUsIf different nodes in your cluster have different types of GPUs, then you can use Node Labels and Node Selectors to schedule pods to appropriate nodes.For example:# Label your nodes with the accelerator type they have. kubectl label nodes node1 accelerator=example-gpu-x100 kubectl label nodes node2 accelerator=other-gpu-k915 That label key accelerator is just an example; you can use a different label key if you prefer.Automatic node labellingAs an administrator, you can automatically discover and label all your GPU enabled nodes by deploying Kubernetes Node Feature Discovery (NFD). NFD detects the hardware features that are available on each node in a Kubernetes cluster. Typically, NFD is configured to advertise those features as node labels, but NFD can also add extended resources, annotations, and node taints. NFD is compatible with all supported versions of Kubernetes. By default NFD create the feature


Question: What is Schedule GPUs?

Answer: K u b e r n e t e s   i n c l u d e s   s t a b l e   s u p p o r t   f o r   m a n a g i n g   A M D   a n d   N V I D I A   G P U s   ( g r a p h i c a l   p r o c e s s i n g   u n i t s )   a c r o s s   d i f f e r e n t   n o d e s   i n   y o u r   c l u s t e r ,   u s i n g   d e v i c e   p l u g i n s .   T h i s   p a g e   d e s c r i b e s   h o w   u s e r s   c a n   c o n s u m e   G P U s ,   a n d   o u t l i n e s   s o m e   o f   t h e   l i m i t a t i o n s   i n   t h e   i m p l e m e n t a t i o n .


Question: What is Using device plugins?

Answer: K u b e r n e t e s   i m p l e m e n t s   d e v i c e   p l u g i n s   t o   l e t   P o d s   a c c e s s   s p e c i a l i z e d   h a r d w a r e   f e a t u r e s   s u c h   a s   G P U s .   A s   a n   a d m i n i s t r a t o r ,   y o u   h a v e   t o   i n s t a l l   G P U   d r i v e r s   f r o m   t h e   c o r r e s p o n d i n g   h a r d w a r e   v e n d o r   o n   t h e   n o d e s   a n d   r u n   t h e   c o r r e s p o n d i n g   d e v i c e   p l u g i n   f r o m   t h e   G P U   v e n d o r .   H e r e   a r e   s o m e   l i n k s   t o   v e n d o r s '   i n s t r u c t i o n s :   A M D I n t e l N V I D I A   O n c e   y o u   h a v e   i n s t a l l e d   t h e   p l u g i n ,   y o u r   c l u s t e r   e x p o s e s   a   c u s t o m   s c h e d u l a b l e   r e s o u r c e   s u c h   a s   a m d . c o m / g p u   o r   n v i d i a . c o m / g p u .   Y o u   c a n   c o n s u m e   t h e s e   G P U s   f r o m   y o u r   c o n t a i n e r s   b y   r e q u e s t i n g   t h e   c u s t o m   G P U   r e s o u r c e ,   t h e   s a m e   w a y   y o u   r e q u e s t   c p u   o r   m e m o r y .   H o w e v e r ,   t h e r e   a r e   s o m e   l i m i t a t i o n s   i n   h o w   y o u   s p e c i f y   t h e   r e s o u r c e   r e q u i r e m e n t s   f o r   c u s t o m   d e v i c e s .   G P U s   a r e   o n l y   s u p p o s e d   t o   b e   s p e c i f i e d   i n   t h e   l i m i t s   s e c t i o n ,   w h i c h   m e a n s :   Y o u   c a n   s p e c i f y   G P U   l i m i t s   w i t h o u t   s p e c i f y i n g   r e q u e s t s ,   b e c a u s e   K u b e r n e t e s   w i l l   u s e   t h e   l i m i t   a s   t h e   r e q u e s t   v a l u e   b y   d e f a u l t . Y o u   c a n   s p e c i f y   G P U   i n   b o t h   l i m i t s   a n d   r e q u e s t s   b u t   t h e s e   t w o   v a l u e s   m u s t   b e   e q u a l . Y o u   c a n n o t   s p e c i f y   G P U   r e q u e s t s   w i t


Question: What is Manage clusters with different types of GPUs?

Answer: I f   d i f f e r e n t   n o d e s   i n   y o u r   c l u s t e r   h a v e   d i f f e r e n t   t y p e s   o f   G P U s ,   t h e n   y o u   c a n   u s e   N o d e   L a b e l s   a n d   N o d e   S e l e c t o r s   t o   s c h e d u l e   p o d s   t o   a p p r o p r i a t e   n o d e s .   F o r   e x a m p l e :   #   L a b e l   y o u r   n o d e s   w i t h   t h e   a c c e l e r a t o r   t y p e   t h e y   h a v e .   k u b e c t l   l a b e l   n o d e s   n o d e 1   a c c e l e r a t o r = e x a m p l e - g p u - x 1 0 0   k u b e c t l   l a b e l   n o d e s   n o d e 2   a c c e l e r a t o r = o t h e r - g p u - k 9 1 5   T h a t   l a b e l   k e y   a c c e l e r a t o r   i s   j u s t   a n   e x a m p l e ;   y o u   c a n   u s e   a   d i f f e r e n t   l a b e l   k e y   i f   y o u   p r e f e r .


Question: What is Automatic node labelling?

Answer: A s   a n   a d m i n i s t r a t o r ,   y o u   c a n   a u t o m a t i c a l l y   d i s c o v e r   a n d   l a b e l   a l l   y o u r   G P U   e n a b l e d   n o d e s   b y   d e p l o y i n g   K u b e r n e t e s   N o d e   F e a t u r e   D i s c o v e r y   ( N F D ) .   N F D   d e t e c t s   t h e   h a r d w a r e   f e a t u r e s   t h a t   a r e   a v a i l a b l e   o n   e a c h   n o d e   i n   a   K u b e r n e t e s   c l u s t e r .   T y p i c a l l y ,   N F D   i s   c o n f i g u r e d   t o   a d v e r t i s e   t h o s e   f e a t u r e s   a s   n o d e   l a b e l s ,   b u t   N F D   c a n   a l s o   a d d   e x t e n d e d   r e s o u r c e s ,   a n n o t a t i o n s ,   a n d   n o d e   t a i n t s .   N F D   i s   c o m p a t i b l e   w i t h   a l l   s u p p o r t e d   v e r s i o n s   o f   K u b e r n e t e s .   B y   d e f a u l t   N F D   c r e a t e   t h e   f e a t u r e   l a b e l s   f o r   t h e   d e t e c t e d   f e a t u r e s .   A d m i n i s t r a t o r s   c a n   l e v e r a g e   N F D   t o   a l s o   t a i n t   n o d e s   w i t h   s p e c i f i c   f e a t u r e s ,   s o   t h a t   o n l y   p o d s   t h a t   r e q u e s t   t h o s e   f e a t u r e s   c a n   b e   s c h e d u l e d   o n   t h o s e   n o d e s .   Y o u   a l s o   n e e d   a   p l u g i n   f o r   N F D   t h a t   a d d s   a p p r o p r i a t e   l a b e l s   t o   y o u r   n o d e s ;   t h e s e   m i g h t   b e   g e n e r i c   l a b e l s   o r   t h e y   c o u l d   b e   v e n d o r   s p e c i f i c .   Y o u r   G P U   v e n d o r   m a y   p r o v i d e   a   t h i r d   p a r t y   p l u g i n   f o r   N F D ;   c h e c k   t h e i r   d o c u m e n t a t i o n   f o r   m o r e   d e t a i l s .   a p i V e r s i o n :   v 1   k i n d :   P o d   m e t a d a t a :   n a m e :   e x a m p l e - v e c t o r - a d d   s p e c :   r e s t a r t P o l i c y :   O n F a i l u r e   #   Y o u


Question: What is GPU vendor implementations?

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


Question: What is Kubernetes API Aggregation Layer?

Answer: Kubernetes API Aggregation LayerThe aggregation layer allows Kubernetes to be extended with additional APIs, beyond what is offered by the core Kubernetes APIs. The additional APIs can either be ready-made solutions such as a metrics server, or APIs that you develop yourself.The aggregation layer is different from Custom Resource Definitions, which are a way to make the kube-apiserver recognise new kinds of object.Aggregation layerThe aggregation layer runs in-process with the kube-apiserver. Until an extension resource is registered, the aggregation layer will do nothing. To register an API, you add an APIService object, which "claims" the URL path in the Kubernetes API. At that point, the aggregation layer will proxy anything sent to that API path (e.g. /apis/myextension.mycompany.io/v1/…) to the registered APIService.The most common way to implement the APIService is to run an extension API server in Pod(s) that run in your cluster. If you're using the extension API server to manage resources in your cluster, the extension API server (also written as "extension-apiserver") is typically paired with one or more controllers. The apiserver-builder library provides a skeleton for both extension API servers and the associated controller(s).Response latencyExtension API servers should have low latency networking to and from the kube-apiserver. Discovery requests are required to round-trip from the kube-apiserver in five seconds or less.If your extension API server cannot achieve that latency requirement, consider making changes that let you meet it.What's nextTo get the aggregator working in your environment, configure the aggregation layer.Then, setup an extension api-server to work with the aggregation layer.Read about APIService in the API referenceLearn about Declarative Validation Concepts, an internal mechanism for defining validation rules that in the future will help support validation for extension API server development.Alternatively: learn how to extend the Kubernetes API using Custom Resource Definitions.


Question: How does Kubernetes API Aggregation Layer work?

Answer: Kubernetes API Aggregation LayerThe aggregation layer allows Kubernetes to be extended with additional APIs, beyond what is offered by the core Kubernetes APIs. The additional APIs can either be ready-made solutions such as a metrics server, or APIs that you develop yourself.The aggregation layer is different from Custom Resource Definitions, which are a way to make the kube-apiserver recognise new kinds of object.Aggregation layerThe aggregation layer runs in-process with the kube-apiserver. Until an extension resource is registered, the aggregation layer will do nothing. To register an API, you add an APIService object, which "claims" the URL path in the Kubernetes API. At that point, the aggregation layer will proxy anything sent to that API path (e.g. /apis/myextension.mycompany.io/v1/…) to the registered APIService.The most common way to implement the APIService is to run an extension API server in Pod(s) that run in your cluster. If you're using the extension API server to manage resources in your cluster, the extension API server (also written as "extension-apiserver") is typically paired with one or more controllers. The apiserver-builder library provides a skeleton for both extension API servers and the associated controller(s).Response latencyExtension API servers should have low latency networking to and from the kube-apiserver. Discovery requests are required to round-trip from the kube-apiserver in five seconds or less.If your extension API server cannot achieve that latency requirement, consider making changes that let you meet it.What's nextTo get the aggregator working in your environment, configure the aggregation layer.Then, setup an extension api-server to work with the aggregation layer.Read about APIService in the API referenceLearn about Declarative Validation Concepts, an internal mechanism for defining validation rules that in the future will help support validation for extension API server development.Alternatively: learn how to extend the Kubernetes API using Custom Resource Definitions.


Question: When would you use Kubernetes API Aggregation Layer?

Answer: Kubernetes API Aggregation LayerThe aggregation layer allows Kubernetes to be extended with additional APIs, beyond what is offered by the core Kubernetes APIs. The additional APIs can either be ready-made solutions such as a metrics server, or APIs that you develop yourself.The aggregation layer is different from Custom Resource Definitions, which are a way to make the kube-apiserver recognise new kinds of object.Aggregation layerThe aggregation layer runs in-process with the kube-apiserver. Until an extension resource is registered, the aggregation layer will do nothing. To register an API, you add an APIService object, which "claims" the URL path in the Kubernetes API. At that point, the aggregation layer will proxy anything sent to that API path (e.g. /apis/myextension.mycompany.io/v1/…) to the registered APIService.The most common way to implement the APIService is to run an extension API server in Pod(s) that run in your cluster. If you're using the extension API server to manage resources in your cluster, the extension API server (also written as "extension-apiserver") is typically paired with one or more controllers. The apiserver-builder library provides a skeleton for both extension API servers and the associated controller(s).Response latencyExtension API servers should have low latency networking to and from the kube-apiserver. Discovery requests are required to round-trip from the kube-apiserver in five seconds or less.If your extension API server cannot achieve that latency requirement, consider making changes that let you meet it.What's nextTo get the aggregator working in your environment, configure the aggregation layer.Then, setup an extension api-server to work with the aggregation layer.Read about APIService in the API referenceLearn about Declarative Validation Concepts, an internal mechanism for defining validation rules that in the future will help support validation for extension API server development.Alternatively: learn how to extend the Kubernetes API using Custom Resource Definitions.


Question: What are the benefits of Kubernetes API Aggregation Layer?

Answer: Kubernetes API Aggregation LayerThe aggregation layer allows Kubernetes to be extended with additional APIs, beyond what is offered by the core Kubernetes APIs. The additional APIs can either be ready-made solutions such as a metrics server, or APIs that you develop yourself.The aggregation layer is different from Custom Resource Definitions, which are a way to make the kube-apiserver recognise new kinds of object.Aggregation layerThe aggregation layer runs in-process with the kube-apiserver. Until an extension resource is registered, the aggregation layer will do nothing. To register an API, you add an APIService object, which "claims" the URL path in the Kubernetes API. At that point, the aggregation layer will proxy anything sent to that API path (e.g. /apis/myextension.mycompany.io/v1/…) to the registered APIService.The most common way to implement the APIService is to run an extension API server in Pod(s) that run in your cluster. If you're using the extension API server to manage resources in your cluster, the extension API server (also written as "extension-apiserver") is typically paired with one or more controllers. The apiserver-builder library provides a skeleton for both extension API servers and the associated controller(s).Response latencyExtension API servers should have low latency networking to and from the kube-apiserver. Discovery requests are required to round-trip from the kube-apiserver in five seconds or less.If your extension API server cannot achieve that latency requirement, consider making changes that let you meet it.What's nextTo get the aggregator working in your environment, configure the aggregation layer.Then, setup an extension api-server to work with the aggregation layer.Read about APIService in the API referenceLearn about Declarative Validation Concepts, an internal mechanism for defining validation rules that in the future will help support validation for extension API server development.Alternatively: learn how to extend the Kubernetes API using Custom Resource Definitions.


Question: What is Kubernetes API Aggregation Layer?

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


Question: What is Aggregation layer?

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


Question: What is Response latency?

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


Question: What is What's next?

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


Question: What is HorizontalPodAutoscaler?

Answer: HorizontalPodAutoscalerconfiguration of a horizontal pod autoscaler.apiVersion: autoscaling/v1import "k8s.io/api/autoscaling/v1"HorizontalPodAutoscalerconfiguration of a horizontal pod autoscaler.apiVersion: autoscaling/v1kind: HorizontalPodAutoscalermetadata (ObjectMeta)Standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadataspec (HorizontalPodAutoscalerSpec)spec defines the behaviour of autoscaler. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status.status (HorizontalPodAutoscalerStatus)status is the current information about the autoscaler.HorizontalPodAutoscalerSpecspecification of a horizontal pod autoscaler.maxReplicas (int32), requiredmaxReplicas is the upper limit for the number of pods that can be set by the autoscaler; cannot be smaller than MinReplicas.scaleTargetRef (CrossVersionObjectReference), requiredreference to scaled resource; horizontal pod autoscaler will learn the current resource consumption and will set the desired number of pods by using its Scale subresource.CrossVersionObjectReference contains enough information to let you identify the referred resource.scaleTargetRef.kind (string), requiredkind is the kind of the referent; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kindsscaleTargetRef.name (string), requiredname is the name of the referent; More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#namesscaleTargetRef.apiVersion (string)apiVersion is the API version of the referentminReplicas (int32)minReplicas is the lower limit for the number of replicas to which the autoscaler can scale down. It defaults to 1 pod. minReplicas is allowed to be 0 if the alpha feature gate HPAScaleToZero is enabled and at least one Object or External metric is configured. Scaling is active as long as at least one metric value is available.targetCPUUtilizationPercentage (int32)targetCPUUtilizationPercentage is the target average CPU utilization (represented as a percentage of requested CPU) over all the pods; if not specified the default autoscaling policy will be used.HorizontalPodAutoscalerStatuscurrent status of a horizontal pod autoscalercurrentReplicas (int32), requiredcurrentReplicas is the current number of replicas of pods managed by this autoscaler.desiredReplicas (int32), requireddesiredReplicas is the desired number of replicas of pods managed by this autoscaler.currentCPUUtilizationPercentage (int32)currentCPUUtilizationPercentage is the current average CPU utilization over all pods, represented as a percentage of requested CPU, e.g. 70 means that an average pod is using now 70% of its requested CPU.lastScaleTime (Time)lastScaleTime is the last time the HorizontalPodAutoscaler scaled the number of pods; used by the autoscaler to control how often the number of pods is changed.Time is a wrapper around time.Time whi


Question: How does HorizontalPodAutoscaler work?

Answer: HorizontalPodAutoscalerconfiguration of a horizontal pod autoscaler.apiVersion: autoscaling/v1import "k8s.io/api/autoscaling/v1"HorizontalPodAutoscalerconfiguration of a horizontal pod autoscaler.apiVersion: autoscaling/v1kind: HorizontalPodAutoscalermetadata (ObjectMeta)Standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadataspec (HorizontalPodAutoscalerSpec)spec defines the behaviour of autoscaler. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status.status (HorizontalPodAutoscalerStatus)status is the current information about the autoscaler.HorizontalPodAutoscalerSpecspecification of a horizontal pod autoscaler.maxReplicas (int32), requiredmaxReplicas is the upper limit for the number of pods that can be set by the autoscaler; cannot be smaller than MinReplicas.scaleTargetRef (CrossVersionObjectReference), requiredreference to scaled resource; horizontal pod autoscaler will learn the current resource consumption and will set the desired number of pods by using its Scale subresource.CrossVersionObjectReference contains enough information to let you identify the referred resource.scaleTargetRef.kind (string), requiredkind is the kind of the referent; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kindsscaleTargetRef.name (string), requiredname is the name of the referent; More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#namesscaleTargetRef.apiVersion (string)apiVersion is the API version of the referentminReplicas (int32)minReplicas is the lower limit for the number of replicas to which the autoscaler can scale down. It defaults to 1 pod. minReplicas is allowed to be 0 if the alpha feature gate HPAScaleToZero is enabled and at least one Object or External metric is configured. Scaling is active as long as at least one metric value is available.targetCPUUtilizationPercentage (int32)targetCPUUtilizationPercentage is the target average CPU utilization (represented as a percentage of requested CPU) over all the pods; if not specified the default autoscaling policy will be used.HorizontalPodAutoscalerStatuscurrent status of a horizontal pod autoscalercurrentReplicas (int32), requiredcurrentReplicas is the current number of replicas of pods managed by this autoscaler.desiredReplicas (int32), requireddesiredReplicas is the desired number of replicas of pods managed by this autoscaler.currentCPUUtilizationPercentage (int32)currentCPUUtilizationPercentage is the current average CPU utilization over all pods, represented as a percentage of requested CPU, e.g. 70 means that an average pod is using now 70% of its requested CPU.lastScaleTime (Time)lastScaleTime is the last time the HorizontalPodAutoscaler scaled the number of pods; used by the autoscaler to control how often the number of pods is changed.Time is a wrapper around time.Time whi