Question: What is Why does the kubelet manage the hosts file??

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


Question: What is Caution:?

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


Question: What is 14.2 - Extend Service IP Ranges?

Answer: T h i s   d o c u m e n t   s h a r e s   h o w   t o   e x t e n d   t h e   e x i s t i n g   S e r v i c e   I P   r a n g e   a s s i g n e d   t o   a   c l u s t e r .


Question: What is Before you begin?

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


Question: What is Extend Service IP Ranges?

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


Question: What is Extend the number of available IPs for Services?

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


Question: What is Adding a new ServiceCIDR?

Answer: O n   a   c l u s t e r   w i t h   a   1 0 . 9 6 . 0 . 0 / 2 8   r a n g e   f o r   S e r v i c e s ,   t h e r e   i s   o n l y   2 ^ ( 3 2 - 2 8 )   -   2   =   1 4   I P   a d d r e s s e s   a v a i l a b l e .   T h e   k u b e r n e t e s . d e f a u l t   S e r v i c e   i s   a l w a y s   c r e a t e d ;   f o r   t h i s   e x a m p l e ,   t h a t   l e a v e s   y o u   w i t h   o n l y   1 3   p o s s i b l e   S e r v i c e s .   f o r   i   i n   $ ( s e q   1   1 3 ) ;   d o   k u b e c t l   c r e a t e   s e r v i c e   c l u s t e r i p   " t e s t - $ i "   - - t c p   8 0   - o   j s o n   |   j q   - r   . s p e c . c l u s t e r I P ;   d o n e   1 0 . 9 6 . 0 . 1 1   1 0 . 9 6 . 0 . 5   1 0 . 9 6 . 0 . 1 2   1 0 . 9 6 . 0 . 1 3   1 0 . 9 6 . 0 . 1 4   1 0 . 9 6 . 0 . 2   1 0 . 9 6 . 0 . 3   1 0 . 9 6 . 0 . 4   1 0 . 9 6 . 0 . 6   1 0 . 9 6 . 0 . 7   1 0 . 9 6 . 0 . 8   1 0 . 9 6 . 0 . 9   e r r o r :   f a i l e d   t o   c r e a t e   C l u s t e r I P   s e r v i c e :   I n t e r n a l   e r r o r   o c c u r r e d :   f a i l e d   t o   a l l o c a t e   a   s e r v i c e I P :   r a n g e   i s   f u l l   Y o u   c a n   i n c r e a s e   t h e   n u m b e r   o f   I P   a d d r e s s e s   a v a i l a b l e   f o r   S e r v i c e s ,   b y   c r e a t i n g   a   n e w   S e r v i c e C I D R   t h a t   e x t e n d s   o r   a d d s   n e w   I P   a d d r e s s   r a n g e s .   c a t   < E O F   |   k u b e c t l   a p p l y   - f   -   a p i V e r s i o n :   n e t w o r k i n g . k 8 s . i o / v 1 b e t a 1   k i n d :   S e r v i c e C I D R   m e t a d a t a :   n a m e :   n e w c i d r 1   s p e c :   c i d r s :   -   1 0 . 9 6 . 0 . 0 / 2 4   E O F   s e r v i c e c i d r . n e t w o r k i n g . k 8 s . i o / n e w c i d r 1   c r e a t e d   a n d   t h i s   w i l l   a l l o w   y o u   t o   c r e a t e   n e w   S e r v i c e s   w i t h   C l u s t e r I P s   t h a t   w i l l   b e   p i c k e d   f r o m   t


Question: What is Deleting a ServiceCIDR?

Answer: Y o u   c a n n o t   d e l e t e   a   S e r v i c e C I D R   i f   t h e r e   a r e   I P A d d r e s s e s   t h a t   d e p e n d   o n   t h e   S e r v i c e C I D R .   k u b e c t l   d e l e t e   s e r v i c e c i d r   n e w c i d r 1   s e r v i c e c i d r . n e t w o r k i n g . k 8 s . i o   " n e w c i d r 1 "   d e l e t e d   K u b e r n e t e s   u s e s   a   f i n a l i z e r   o n   t h e   S e r v i c e C I D R   t o   t r a c k   t h i s   d e p e n d e n t   r e l a t i o n s h i p .   k u b e c t l   g e t   s e r v i c e c i d r   n e w c i d r 1   - o   y a m l   a p i V e r s i o n :   n e t w o r k i n g . k 8 s . i o / v 1 b e t a 1   k i n d :   S e r v i c e C I D R   m e t a d a t a :   c r e a t i o n T i m e s t a m p :   " 2 0 2 3 - 1 0 - 1 2 T 1 5 : 1 1 : 0 7 Z "   d e l e t i o n G r a c e P e r i o d S e c o n d s :   0   d e l e t i o n T i m e s t a m p :   " 2 0 2 3 - 1 0 - 1 2 T 1 5 : 1 2 : 4 5 Z "   f i n a l i z e r s :   -   n e t w o r k i n g . k 8 s . i o / s e r v i c e - c i d r - f i n a l i z e r   n a m e :   n e w c i d r 1   r e s o u r c e V e r s i o n :   " 1 1 3 3 "   u i d :   5 f f d 8 a f e - c 7 8 f - 4 e 6 0 - a e 7 6 - c e c 4 4 8 a 8 a f 4 0   s p e c :   c i d r s :   -   1 0 . 9 6 . 0 . 0 / 2 4   s t a t u s :   c o n d i t i o n s :   -   l a s t T r a n s i t i o n T i m e :   " 2 0 2 3 - 1 0 - 1 2 T 1 5 : 1 2 : 4 5 Z "   m e s s a g e :   T h e r e   a r e   s t i l l   I P A d d r e s s e s   r e f e r e n c i n g   t h e   S e r v i c e C I D R ,   p l e a s e   r e m o v e   t h e m   o r   c r e a t e   a   n e w   S e r v i c e C I D R   r e a s o n :   O r p h a n I P A d d r e s s   s t a t u s :   " F a l s e "   t y p e :   R e a d y   B y   r e m o v i n g   t h e   S e r v i c e s   c o n t a i n i n g   t h e   I P   a d d r e s s e s   t h a t   a r e   b l o c k i n g   t h e   d e l e t i o n   o f   t h e   S e r v i c e C I D R   f o r   i   i n   $ ( s e q   1 3   1 6 ) ;


Question: What is Kubernetes Service CIDR Policies?

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


Question: What is Preventing Unauthorized ServiceCIDR Creation/Update using Validating Admission Policy?

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


Question: What is Note:?

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


Question: What is Restrict Service CIDR ranges to some specific ranges?

Answer: T h e   f o l l o w i n g   i s   a n   e x a m p l e   o f   a   V a l i d a t i n g A d m i s s i o n P o l i c y   t h a t   o n l y   a l l o w s   S e r v i c e C I D R s   t o   b e   c r e a t e d   i f   t h e y   a r e   s u b r a n g e s   o f   t h e   g i v e n   a l l o w e d   r a n g e s .   ( S o   t h e   e x a m p l e   p o l i c y   w o u l d   a l l o w   a   S e r v i c e C I D R   w i t h   c i d r s :   [ ' 1 0 . 9 6 . 1 . 0 / 2 4 ' ]   o r   c i d r s :   [ ' 2 0 0 1 : d b 8 : 0 : 0 : f f f f : : / 8 0 ' ,   ' 1 0 . 9 6 . 0 . 0 / 2 0 ' ]   b u t   w o u l d   n o t   a l l o w   a   S e r v i c e C I D R   w i t h   c i d r s :   [ ' 1 7 2 . 2 0 . 0 . 0 / 1 6 ' ] . )   Y o u   c a n   c o p y   t h i s   p o l i c y   a n d   c h a n g e   t h e   v a l u e   o f   a l l o w e d   t o   s o m e t h i n g   a p p r o p r i a t e   f o r   y o u   c l u s t e r .   a p i V e r s i o n :   a d m i s s i o n r e g i s t r a t i o n . k 8 s . i o / v 1   k i n d :   V a l i d a t i n g A d m i s s i o n P o l i c y   m e t a d a t a :   n a m e :   " s e r v i c e c i d r s . d e f a u l t "   s p e c :   f a i l u r e P o l i c y :   F a i l   m a t c h C o n s t r a i n t s :   r e s o u r c e R u l e s :   -   a p i G r o u p s :   [ " n e t w o r k i n g . k 8 s . i o " ]   a p i V e r s i o n s :   [ " v 1 " , " v 1 b e t a 1 " ]   o p e r a t i o n s :   [ " C R E A T E " ,   " U P D A T E " ]   r e s o u r c e s :   [ " s e r v i c e c i d r s " ]   m a t c h C o n d i t i o n s :   -   n a m e :   ' e x c l u d e - d e f a u l t - s e r v i c e c i d r '   e x p r e s s i o n :   " o b j e c t . m e t a d a t a . n a m e   ! =   ' k u b e r n e t e s ' "   v a r i a b l e s :   -   n a m e :   a l l o w e d   e x p r e s s i o n :   " [ ' 1 0 . 9 6 . 0 . 0 / 1 6 ' , ' 2 0 0 1 : d b 8 : : / 6 4 ' ] "   v a l i d a t i o n s :   -   e x p r e s s i o n :   " o b j e c t . s p e c . c i d r s . a l l ( n e w C I D R ,   v a r i a b l e s . a


Question: What is Restrict any usage of the ServiceCIDR API?

Answer: T h e   f o l l o w i n g   e x a m p l e   d e m o n s t r a t e s   h o w   t o   u s e   a   V a l i d a t i n g A d m i s s i o n P o l i c y   a n d   i t s   b i n d i n g   t o   r e s t r i c t   t h e   c r e a t i o n   o f   a n y   n e w   S e r v i c e   C I D R   r a n g e s ,   e x c l u d i n g   t h e   d e f a u l t   " k u b e r n e t e s "   S e r v i c e C I D R :   a p i V e r s i o n :   a d m i s s i o n r e g i s t r a t i o n . k 8 s . i o / v 1   k i n d :   V a l i d a t i n g A d m i s s i o n P o l i c y   m e t a d a t a :   n a m e :   " s e r v i c e c i d r s . d e n y "   s p e c :   f a i l u r e P o l i c y :   F a i l   m a t c h C o n s t r a i n t s :   r e s o u r c e R u l e s :   -   a p i G r o u p s :   [ " n e t w o r k i n g . k 8 s . i o " ]   a p i V e r s i o n s :   [ " v 1 " , " v 1 b e t a 1 " ]   o p e r a t i o n s :   [ " C R E A T E " ,   " U P D A T E " ]   r e s o u r c e s :   [ " s e r v i c e c i d r s " ]   v a l i d a t i o n s :   -   e x p r e s s i o n :   " o b j e c t . m e t a d a t a . n a m e   = =   ' k u b e r n e t e s ' "   - - -   a p i V e r s i o n :   a d m i s s i o n r e g i s t r a t i o n . k 8 s . i o / v 1   k i n d :   V a l i d a t i n g A d m i s s i o n P o l i c y B i n d i n g   m e t a d a t a :   n a m e :   " s e r v i c e c i d r s - d e n y - b i n d i n g "   s p e c :   p o l i c y N a m e :   " s e r v i c e c i d r s . d e n y "   v a l i d a t i o n A c t i o n s :   [ D e n y , A u d i t ]


Question: What is 14.3 - Kubernetes Default Service CIDR Reconfiguration?

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


Question: What is Before you begin?

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


Question: What is Kubernetes Default Service CIDR Reconfiguration?

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


Question: What is Kubernetes Service CIDR Reconfiguration Categories?

Answer: W e   c a n   c a t e g o r i z e   S e r v i c e   C I D R   r e c o n f i g u r a t i o n   i n t o   t h e   f o l l o w i n g   s c e n a r i o s :   E x t e n d i n g   t h e   e x i s t i n g   S e r v i c e   C I D R s :   T h i s   c a n   b e   d o n e   d y n a m i c a l l y   b y   a d d i n g   n e w   S e r v i c e C I D R   o b j e c t s   w i t h o u t   t h e   n e e d   o f   r e c o n f i g u r a t i o n   o f   t h e   k u b e - a p i s e r v e r .   P l e a s e   r e f e r   t o   t h e   d e d i c a t e d   d o c u m e n t a t i o n   o n   E x t e n d i n g   S e r v i c e   I P   R a n g e s . S i n g l e - t o - d u a l - s t a c k   c o n v e r s i o n   p r e s e r v i n g   t h e   p r i m a r y   s e r v i c e   C I D R :   T h i s   i n v o l v e s   i n t r o d u c i n g   a   s e c o n d a r y   I P   f a m i l y   ( I P v 6   t o   a n   I P v 4 - o n l y   c l u s t e r ,   o r   I P v 4   t o   a n   I P v 6 - o n l y   c l u s t e r )   w h i l e   k e e p i n g   t h e   o r i g i n a l   I P   f a m i l y   a s   p r i m a r y .   T h i s   r e q u i r e s   a n   u p d a t e   t o   t h e   k u b e - a p i s e r v e r   c o n f i g u r a t i o n   a n d   a   c o r r e s p o n d i n g   m o d i f i c a t i o n   o f   v a r i o u s   c l u s t e r   c o m p o n e n t s   t h a t   n e e d   t o   h a n d l e   t h i s   a d d i t i o n a l   I P   f a m i l y .   T h e s e   c o m p o n e n t s   i n c l u d e ,   b u t   a r e   n o t   l i m i t e d   t o ,   k u b e - p r o x y ,   t h e   C N I   o r   n e t w o r k   p l u g i n ,   s e r v i c e   m e s h   i m p l e m e n t a t i o n s ,   a n d   D N S   s e r v i c e s . D u a l - t o - s i n g l e   c o n v e r s i o n   p r e s e r v i n g   t h e   p r i m a r y   s e r v i c e   C I D R :   T h i s   i n v o l v e s   r e m o v i n g   t h e   s e c o n d a r y   I P   f a m i l y   f r o m   a   d u a l - s t a c k   c l u s t e r ,   r e v e r t i n g   t o   a


Question: What is Manual Operations for Replacing the Default Service CIDR?

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


Question: What is Illustrative Reconfiguration Steps?

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


Question: What is What's next?

Answer: K u b e r n e t e s   N e t w o r k i n g   C o n c e p t s :   h t t p s : / / k u b e r n e t e s . i o / d o c s / c o n c e p t s / c l u s t e r - a d m i n i s t r a t i o n / n e t w o r k i n g / K u b e r n e t e s   D u a l - S t a c k   S e r v i c e s :   h t t p s : / / k u b e r n e t e s . i o / d o c s / c o n c e p t s / s e r v i c e s - n e t w o r k i n g / d u a l - s t a c k / E x t e n d i n g   K u b e r n e t e s   S e r v i c e   I P   R a n g e s :   h t t p s : / / k u b e r n e t e s . i o / d o c s / t a s k s / n e t w o r k / e x t e n d - s e r v i c e - i p - r a n g e s /


Question: What is 14.4 - Validate IPv4/IPv6 dual-stack?

Answer: T h i s   d o c u m e n t   s h a r e s   h o w   t o   v a l i d a t e   I P v 4 / I P v 6   d u a l - s t a c k   e n a b l e d   K u b e r n e t e s   c l u s t e r s .


Question: What is Before you begin?

Answer: P r o v i d e r   s u p p o r t   f o r   d u a l - s t a c k   n e t w o r k i n g   ( C l o u d   p r o v i d e r   o r   o t h e r w i s e   m u s t   b e   a b l e   t o   p r o v i d e   K u b e r n e t e s   n o d e s   w i t h   r o u t a b l e   I P v 4 / I P v 6   n e t w o r k   i n t e r f a c e s ) A   n e t w o r k   p l u g i n   t h a t   s u p p o r t s   d u a l - s t a c k   n e t w o r k i n g . D u a l - s t a c k   e n a b l e d   c l u s t e r   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 Validate node addressing?

Answer: E a c h   d u a l - s t a c k   N o d e   s h o u l d   h a v e   a   s i n g l e   I P v 4   b l o c k   a n d   a   s i n g l e   I P v 6   b l o c k   a l l o c a t e d .   V a l i d a t e   t h a t   I P v 4 / I P v 6   P o d   a d d r e s s   r a n g e s   a r e   c o n f i g u r e d   b y   r u n n i n g   t h e   f o l l o w i n g   c o m m a n d .   R e p l a c e   t h e   s a m p l e   n o d e   n a m e   w i t h   a   v a l i d   d u a l - s t a c k   N o d e   f r o m   y o u r   c l u s t e r .   I n   t h i s   e x a m p l e ,   t h e   N o d e ' s   n a m e   i s   k 8 s - l i n u x p o o l 1 - 3 4 4 5 0 3 1 7 - 0 :   k u b e c t l   g e t   n o d e s   k 8 s - l i n u x p o o l 1 - 3 4 4 5 0 3 1 7 - 0   - o   g o - t e m p l a t e   - - t e m p l a t e = ' { { r a n g e   . s p e c . p o d C I D R s } } { { p r i n t f   " % s \ n "   . } } { { e n d } } '   1 0 . 2 4 4 . 1 . 0 / 2 4   2 0 0 1 : d b 8 : : / 6 4   T h e r e   s h o u l d   b e   o n e   I P v 4   b l o c k   a n d   o n e   I P v 6   b l o c k   a l l o c a t e d .   V a l i d a t e   t h a t   t h e   n o d e   h a s   a n   I P v 4   a n d   I P v 6   i n t e r f a c e   d e t e c t e d .   R e p l a c e   n o d e   n a m e   w i t h   a   v a l i d   n o d e   f r o m   t h e   c l u s t e r .   I n   t h i s   e x a m p l e   t h e   n o d e   n a m e   i s   k 8 s - l i n u x p o o l 1 - 3 4 4 5 0 3 1 7 - 0 :   k u b e c t l   g e t   n o d e s   k 8 s - l i n u x p o o l 1 - 3 4 4 5 0 3 1 7 - 0   - o   g o - t e m p l a t e   - - t e m p l a t e = ' { { r a n g e   . s t a t u s . a d d r e s s e s } } { { p r i n t f   " % s :   % s \ n "   . t y p e   . a d d r e s s } } { { e n d } } '   H o s t n a m e :   k 8 s - l i n u x p o o l 1 - 3 4 4 5 0 3 1 7 - 0   I n t e r n a l I P :   1 0 . 0 . 0 . 5   I n t e r n a l I P :   2 0 0 1 : d b 8 : 1 0 : : 5


Question: What is Validate Pod addressing?

Answer: V a l i d a t e   t h a t   a   P o d   h a s   a n   I P v 4   a n d   I P v 6   a d d r e s s   a s s i g n e d .   R e p l a c e   t h e   P o d   n a m e   w i t h   a   v a l i d   P o d   i n   y o u r   c l u s t e r .   I n   t h i s   e x a m p l e   t h e   P o d   n a m e   i s   p o d 0 1 :   k u b e c t l   g e t   p o d s   p o d 0 1   - o   g o - t e m p l a t e   - - t e m p l a t e = ' { { r a n g e   . s t a t u s . p o d I P s } } { { p r i n t f   " % s \ n "   . i p } } { { e n d } } '   1 0 . 2 4 4 . 1 . 4   2 0 0 1 : d b 8 : : 4   Y o u   c a n   a l s o   v a l i d a t e   P o d   I P s   u s i n g   t h e   D o w n w a r d   A P I   v i a   t h e   s t a t u s . p o d I P s   f i e l d P a t h .   T h e   f o l l o w i n g   s n i p p e t   d e m o n s t r a t e s   h o w   y o u   c a n   e x p o s e   t h e   P o d   I P s   v i a   a n   e n v i r o n m e n t   v a r i a b l e   c a l l e d   M Y _ P O D _ I P S   w i t h i n   a   c o n t a i n e r .   e n v :   -   n a m e :   M Y _ P O D _ I P S   v a l u e F r o m :   f i e l d R e f :   f i e l d P a t h :   s t a t u s . p o d I P s   T h e   f o l l o w i n g   c o m m a n d   p r i n t s   t h e   v a l u e   o f   t h e   M Y _ P O D _ I P S   e n v i r o n m e n t   v a r i a b l e   f r o m   w i t h i n   a   c o n t a i n e r .   T h e   v a l u e   i s   a   c o m m a   s e p a r a t e d   l i s t   t h a t   c o r r e s p o n d s   t o   t h e   P o d ' s   I P v 4   a n d   I P v 6   a d d r e s s e s .   k u b e c t l   e x e c   - i t   p o d 0 1   - -   s e t   |   g r e p   M Y _ P O D _ I P S   M Y _ P O D _ I P S = 1 0 . 2 4 4 . 1 . 4 , 2 0 0 1 : d b 8 : : 4   T h e   P o d ' s   I P   a d d r e s s e s   w i l l   a l s o   b e   w r i t t e n   t o   / e t c / h o s t s   w i t h i n   a   c o n t a i n e r .   T h e   f o l l o w i n g   c o m m a n d   e x e c u t e s   a   c a t   o n   / e t c / h o s t s   o n   a   d u a l   s t a c k   P o d .   F r o m   t


Question: What is Validate Services?

Answer: C r e a t e   t h e   f o l l o w i n g   S e r v i c e   t h a t   d o e s   n o t   e x p l i c i t l y   d e f i n e   . s p e c . i p F a m i l y P o l i c y .   K u b e r n e t e s   w i l l   a s s i g n   a   c l u s t e r   I P   f o r   t h e   S e r v i c e   f r o m   t h e   f i r s t   c o n f i g u r e d   s e r v i c e - c l u s t e r - i p - r a n g e   a n d   s e t   t h e   . s p e c . i p F a m i l y P o l i c y   t o   S i n g l e S t a c k .   a p i V e r s i o n :   v 1   k i n d :   S e r v i c e   m e t a d a t a :   n a m e :   m y - s e r v i c e   l a b e l s :   a p p . k u b e r n e t e s . i o / n a m e :   M y A p p   s p e c :   s e l e c t o r :   a p p . k u b e r n e t e s . i o / n a m e :   M y A p p   p o r t s :   -   p r o t o c o l :   T C P   p o r t :   8 0   U s e   k u b e c t l   t o   v i e w   t h e   Y A M L   f o r   t h e   S e r v i c e .   k u b e c t l   g e t   s v c   m y - s e r v i c e   - o   y a m l   T h e   S e r v i c e   h a s   . s p e c . i p F a m i l y P o l i c y   s e t   t o   S i n g l e S t a c k   a n d   . s p e c . c l u s t e r I P   s e t   t o   a n   I P v 4   a d d r e s s   f r o m   t h e   f i r s t   c o n f i g u r e d   r a n g e   s e t   v i a   - - s e r v i c e - c l u s t e r - i p - r a n g e   f l a g   o n   k u b e - c o n t r o l l e r - m a n a g e r .   a p i V e r s i o n :   v 1   k i n d :   S e r v i c e   m e t a d a t a :   n a m e :   m y - s e r v i c e   n a m e s p a c e :   d e f a u l t   s p e c :   c l u s t e r I P :   1 0 . 0 . 2 1 7 . 1 6 4   c l u s t e r I P s :   -   1 0 . 0 . 2 1 7 . 1 6 4   i p F a m i l i e s :   -   I P v 4   i p F a m i l y P o l i c y :   S i n g l e S t a c k   p o r t s :   -   p o r t :   8 0   p r o t o c o l :   T C P   t a r g e t P o r t :   9 3 7 6   s e l e c t o r :   a p p . k u b e r n e t e s . i o / n a m e :   M y A p p   s e s s i o n A f f i n i t y :   N o n e   t y p e :   C l u s t e r I P   s t a t u s :


Question: What is Note:?

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


Question: What is Create a dual-stack load balanced Service?

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


Question: What is 15 - Extend kubectl with plugins?

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


Question: What is Before you begin?

Answer: Y o u   n e e d   t o   h a v e   a   w o r k i n g   k u b e c t l   b i n a r y   i n s t a l l e d .


Question: What is Installing kubectl plugins?

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


Question: What is Discovering plugins?

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


Question: What is Create plugins?

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


Question: What is Limitations?

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


Question: What is Writing kubectl plugins?

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


Question: What is Example plugin?

Answer: # ! / b i n / b a s h   #   o p t i o n a l   a r g u m e n t   h a n d l i n g   i f   [ [   " $ 1 "   = =   " v e r s i o n "   ] ]   t h e n   e c h o   " 1 . 0 . 0 "   e x i t   0   f i   #   o p t i o n a l   a r g u m e n t   h a n d l i n g   i f   [ [   " $ 1 "   = =   " c o n f i g "   ] ]   t h e n   e c h o   " $ K U B E C O N F I G "   e x i t   0   f i   e c h o   " I   a m   a   p l u g i n   n a m e d   k u b e c t l - f o o "


Question: What is Using a plugin?

Answer: T o   u s e   a   p l u g i n ,   m a k e   t h e   p l u g i n   e x e c u t a b l e :   s u d o   c h m o d   + x   . / k u b e c t l - f o o   a n d   p l a c e   i t   a n y w h e r e   i n   y o u r   P A T H :   s u d o   m v   . / k u b e c t l - f o o   / u s r / l o c a l / b i n   Y o u   m a y   n o w   i n v o k e   y o u r   p l u g i n   a s   a   k u b e c t l   c o m m a n d :   k u b e c t l   f o o   I   a m   a   p l u g i n   n a m e d   k u b e c t l - f o o   A l l   a r g s   a n d   f l a g s   a r e   p a s s e d   a s - i s   t o   t h e   e x e c u t a b l e :   k u b e c t l   f o o   v e r s i o n   1 . 0 . 0   A l l   e n v i r o n m e n t   v a r i a b l e s   a r e   a l s o   p a s s e d   a s - i s   t o   t h e   e x e c u t a b l e :   e x p o r t   K U B E C O N F I G = ~ / . k u b e / c o n f i g   k u b e c t l   f o o   c o n f i g   / h o m e / < u s e r > / . k u b e / c o n f i g   K U B E C O N F I G = / e t c / k u b e / c o n f i g   k u b e c t l   f o o   c o n f i g   / e t c / k u b e / c o n f i g   A d d i t i o n a l l y ,   t h e   f i r s t   a r g u m e n t   t h a t   i s   p a s s e d   t o   a   p l u g i n   w i l l   a l w a y s   b e   t h e   f u l l   p a t h   t o   t h e   l o c a t i o n   w h e r e   i t   w a s   i n v o k e d   ( $ 0   w o u l d   e q u a l   / u s r / l o c a l / b i n / k u b e c t l - f o o   i n   t h e   e x a m p l e   a b o v e ) .


Question: What is Naming a plugin?

Answer: A s   s e e n   i n   t h e   e x a m p l e   a b o v e ,   a   p l u g i n   d e t e r m i n e s   t h e   c o m m a n d   p a t h   t h a t   i t   w i l l   i m p l e m e n t   b a s e d   o n   i t s   f i l e n a m e .   E v e r y   s u b - c o m m a n d   i n   t h e   c o m m a n d   p a t h   t h a t   a   p l u g i n   t a r g e t s ,   i s   s e p a r a t e d   b y   a   d a s h   ( - ) .   F o r   e x a m p l e ,   a   p l u g i n   t h a t   w i s h e s   t o   b e   i n v o k e d   w h e n e v e r   t h e   c o m m a n d   k u b e c t l   f o o   b a r   b a z   i s   i n v o k e d   b y   t h e   u s e r ,   w o u l d   h a v e   t h e   f i l e n a m e   o f   k u b e c t l - f o o - b a r - b a z .


Question: What is Note:?

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


Question: What is Names with dashes and underscores?

Answer: A l t h o u g h   t h e   k u b e c t l   p l u g i n   m e c h a n i s m   u s e s   t h e   d a s h   ( - )   i n   p l u g i n   f i l e n a m e s   t o   s e p a r a t e   t h e   s e q u e n c e   o f   s u b - c o m m a n d s   p r o c e s s e d   b y   t h e   p l u g i n ,   i t   i s   s t i l l   p o s s i b l e   t o   c r e a t e   a   p l u g i n   c o m m a n d   c o n t a i n i n g   d a s h e s   i n   i t s   c o m m a n d l i n e   i n v o c a t i o n   b y   u s i n g   u n d e r s c o r e s   ( _ )   i n   i t s   f i l e n a m e .   E x a m p l e :   #   c r e a t e   a   p l u g i n   c o n t a i n i n g   a n   u n d e r s c o r e   i n   i t s   f i l e n a m e   e c h o   - e   ' # ! / b i n / b a s h \ n \ n e c h o   " I   a m   a   p l u g i n   w i t h   a   d a s h   i n   m y   n a m e " '   >   . / k u b e c t l - f o o _ b a r   s u d o   c h m o d   + x   . / k u b e c t l - f o o _ b a r   #   m o v e   t h e   p l u g i n   i n t o   y o u r   $ P A T H   s u d o   m v   . / k u b e c t l - f o o _ b a r   / u s r / l o c a l / b i n   #   Y o u   c a n   n o w   i n v o k e   y o u r   p l u g i n   v i a   k u b e c t l :   k u b e c t l   f o o - b a r   I   a m   a   p l u g i n   w i t h   a   d a s h   i n   m y   n a m e   N o t e   t h a t   t h e   i n t r o d u c t i o n   o f   u n d e r s c o r e s   t o   a   p l u g i n   f i l e n a m e   d o e s   n o t   p r e v e n t   y o u   f r o m   h a v i n g   c o m m a n d s   s u c h   a s   k u b e c t l   f o o _ b a r .   T h e   c o m m a n d   f r o m   t h e   a b o v e   e x a m p l e ,   c a n   b e   i n v o k e d   u s i n g   e i t h e r   a   d a s h   ( - )   o r   a n   u n d e r s c o r e   ( _ ) :   #   Y o u   c a n   i n v o k e   y o u r   c u s t o m   c o m m a n d   w i t h   a   d a s h   k u b e c t l   f o o - b a r   I   a m   a   p l u g i n   w i t h   a   d a s h   i n   m y   n a m e   #   Y o u   c a n   a l s o   i n v o k e   y o u r   c


Question: What is Name conflicts and overshadowing?

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


Question: What is Invocation of the longest executable filename?

Answer: T h e r e   i s   a n o t h e r   k i n d   o f   o v e r s h a d o w i n g   t h a t   c a n   o c c u r   w i t h   p l u g i n   f i l e n a m e s .   G i v e n   t w o   p l u g i n s   p r e s e n t   i n   a   u s e r ' s   P A T H :   k u b e c t l - f o o - b a r   a n d   k u b e c t l - f o o - b a r - b a z ,   t h e   k u b e c t l   p l u g i n   m e c h a n i s m   w i l l   a l w a y s   c h o o s e   t h e   l o n g e s t   p o s s i b l e   p l u g i n   n a m e   f o r   a   g i v e n   u s e r   c o m m a n d .   S o m e   e x a m p l e s   b e l o w ,   c l a r i f y   t h i s   f u r t h e r :   #   f o r   a   g i v e n   k u b e c t l   c o m m a n d ,   t h e   p l u g i n   w i t h   t h e   l o n g e s t   p o s s i b l e   f i l e n a m e   w i l l   a l w a y s   b e   p r e f e r r e d   k u b e c t l   f o o   b a r   b a z   P l u g i n   k u b e c t l - f o o - b a r - b a z   i s   e x e c u t e d   k u b e c t l   f o o   b a r   P l u g i n   k u b e c t l - f o o - b a r   i s   e x e c u t e d   k u b e c t l   f o o   b a r   b a z   b u z   P l u g i n   k u b e c t l - f o o - b a r - b a z   i s   e x e c u t e d ,   w i t h   " b u z "   a s   i t s   f i r s t   a r g u m e n t   k u b e c t l   f o o   b a r   b u z   P l u g i n   k u b e c t l - f o o - b a r   i s   e x e c u t e d ,   w i t h   " b u z "   a s   i t s   f i r s t   a r g u m e n t   T h i s   d e s i g n   c h o i c e   e n s u r e s   t h a t   p l u g i n   s u b - c o m m a n d s   c a n   b e   i m p l e m e n t e d   a c r o s s   m u l t i p l e   f i l e s ,   i f   n e e d e d ,   a n d   t h a t   t h e s e   s u b - c o m m a n d s   c a n   b e   n e s t e d   u n d e r   a   " p a r e n t "   p l u g i n   c o m m a n d :   l s   . / p l u g i n _ c o m m a n d _ t r e e   k u b e c t l - p a r e n t   k u b e c t l - p a r e n t - s u b c o m m a n d   k u b e c t l - p a r e n t - s u b c o m m a n d - s u b s u b c o m m a n d


Question: What is Checking for plugin warnings?

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


Question: What is Using the command line runtime package?

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


Question: What is Distributing kubectl plugins?

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


Question: What is Krew?

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


Question: What is Native / platform specific package management?

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


Question: What is Source code?

Answer: Y o u   c a n   p u b l i s h   t h e   s o u r c e   c o d e ;   f o r   e x a m p l e ,   a s   a   G i t   r e p o s i t o r y .   I f   y o u   c h o o s e   t h i s   o p t i o n ,   s o m e o n e   w h o   w a n t s   t o   u s e   t h a t   p l u g i n   m u s t   f e t c h   t h e   c o d e ,   s e t   u p   a   b u i l d   e n v i r o n m e n t   ( i f   i t   n e e d s   c o m p i l i n g ) ,   a n d   d e p l o y   t h e   p l u g i n .   I f   y o u   a l s o   m a k e   c o m p i l e d   p a c k a g e s   a v a i l a b l e ,   o r   u s e   K r e w ,   t h a t   w i l l   m a k e   i n s t a l l s   e a s i e r .


Question: What is What's next?

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


Question: What is 16 - Manage HugePages?

Answer: K u b e r n e t e s   s u p p o r t s   t h e   a l l o c a t i o n   a n d   c o n s u m p t i o n   o f   p r e - a l l o c a t e d   h u g e   p a g e s   b y   a p p l i c a t i o n s   i n   a   P o d .   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   h u g e   p a g e s .


Question: What is Before you begin?

Answer: K u b e r n e t e s   n o d e s   m u s t   p r e - a l l o c a t e   h u g e   p a g e s   i n   o r d e r   f o r   t h e   n o d e   t o   r e p o r t   i t s   h u g e   p a g e   c a p a c i t y .   A   n o d e   c a n   p r e - a l l o c a t e   h u g e   p a g e s   f o r   m u l t i p l e   s i z e s ,   f o r   i n s t a n c e ,   t h e   f o l l o w i n g   l i n e   i n   / e t c / d e f a u l t / g r u b   a l l o c a t e s   2 * 1 G i B   o f   1   G i B   a n d   5 1 2 * 2   M i B   o f   2   M i B   p a g e s :   G R U B _ C M D L I N E _ L I N U X = " h u g e p a g e s z = 1 G   h u g e p a g e s = 2   h u g e p a g e s z = 2 M   h u g e p a g e s = 5 1 2 "   T h e   n o d e s   w i l l   a u t o m a t i c a l l y   d i s c o v e r   a n d   r e p o r t   a l l   h u g e   p a g e   r e s o u r c e s   a s   s c h e d u l a b l e   r e s o u r c e s .   W h e n   y o u   d e s c r i b e   t h e   N o d e ,   y o u   s h o u l d   s e e   s o m e t h i n g   s i m i l a r   t o   t h e   f o l l o w i n g   i n   t h e   f o l l o w i n g   i n   t h e   C a p a c i t y   a n d   A l l o c a t a b l e   s e c t i o n s :   C a p a c i t y :   c p u :   . . .   e p h e m e r a l - s t o r a g e :   . . .   h u g e p a g e s - 1 G i :   2 G i   h u g e p a g e s - 2 M i :   1 G i   m e m o r y :   . . .   p o d s :   . . .   A l l o c a t a b l e :   c p u :   . . .   e p h e m e r a l - s t o r a g e :   . . .   h u g e p a g e s - 1 G i :   2 G i   h u g e p a g e s - 2 M i :   1 G i   m e m o r y :   . . .   p o d s :   . . .


Question: What is API?

Answer: H u g e   p a g e s   c a n   b e   c o n s u m e d   v i a   c o n t a i n e r   l e v e l   r e s o u r c e   r e q u i r e m e n t s   u s i n g   t h e   r e s o u r c e   n a m e   h u g e p a g e s - < s i z e > ,   w h e r e   < s i z e >   i s   t h e   m o s t   c o m p a c t   b i n a r y   n o t a t i o n   u s i n g   i n t e g e r   v a l u e s   s u p p o r t e d   o n   a   p a r t i c u l a r   n o d e .   F o r   e x a m p l e ,   i f   a   n o d e   s u p p o r t s   2 0 4 8 K i B   a n d   1 0 4 8 5 7 6 K i B   p a g e   s i z e s ,   i t   w i l l   e x p o s e   a   s c h e d u l a b l e   r e s o u r c e s   h u g e p a g e s - 2 M i   a n d   h u g e p a g e s - 1 G i .   U n l i k e   C P U   o r   m e m o r y ,   h u g e   p a g e s   d o   n o t   s u p p o r t   o v e r c o m m i t .   N o t e   t h a t   w h e n   r e q u e s t i n g   h u g e p a g e   r e s o u r c e s ,   e i t h e r   m e m o r y   o r   C P U   r e s o u r c e s   m u s t   b e   r e q u e s t e d   a s   w e l l .   A   p o d   m a y   c o n s u m e   m u l t i p l e   h u g e   p a g e   s i z e s   i n   a   s i n g l e   p o d   s p e c .   I n   t h i s   c a s e   i t   m u s t   u s e   m e d i u m :   H u g e P a g e s - < h u g e p a g e s i z e >   n o t a t i o n   f o r   a l l   v o l u m e   m o u 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 :   h u g e - p a g e s - e x a m p l e   s p e c :   c o n t a i n e r s :   -   n a m e :   e x a m p l e   i m a g e :   f e d o r a : l a t e s t   c o m m a n d :   -   s l e e p   -   i n f   v o l u m e M o u n t s :   -   m o u n t P a t h :   / h u g e p a g e s - 2 M i   n a m e :   h u g e p a g e - 2 m i   -   m o u n t P a t h :   / h u g e p a g e s - 1 G i   n a m e :   h u g e p a g e - 1 g i   r e s o u r c e s :   l i m i t s :   h u g e p a g e s - 2 M i :   1 0 0 M i   h u g e p a g e s - 1 G i :   2 G i   m e m o r y :   1 0 0 M i   r e q u e s t s :


Question: What is 17 - 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   ©   2 0 2 5   T h e   K u b e r n e t e s   A u t h o r s   |   D o c u m e n t a t i o n   D i s t r i b u t e d   u n d e r   C C   B Y   4 . 0   ©   2 0 2 5   T h e   L i n u x   F o u n d a t i o n   ® .   A l l   r i g h t s   r e s e r v e d .   T h e   L i n u x   F o u n d a t i o n   h a s   r e g i s t e r e d   t r a d e m a r k s   a n d   u s e s   t r a d e m a r k s .   F o r   a   l i s t   o f   t r a d e m a r k s   o f   T h e   L i n u x   F o u n d a t i o n ,   p l e a s e   s e e   o u r   T r a d e m a r k   U s a g e   p a g e   I C P   l i c e n s e :   京 I C P 备 1 7 0 7 4 2 6 6 号 - 3


Question: What is Run Jobs?

Answer: This is the multi-page printable view of this section. Click here to print.Return to the regular view of this page.Run JobsRun Jobs using parallel processing.1: Running Automated Tasks with a CronJob2: Coarse Parallel Processing Using a Work Queue3: Fine Parallel Processing Using a Work Queue4: Indexed Job for Parallel Processing with Static Work Assignment5: Job with Pod-to-Pod Communication6: Parallel Processing using Expansions7: Handling retriable and non-retriable pod failures with Pod failure policy1 - Running Automated Tasks with a CronJobThis page shows how to run automated tasks using Kubernetes CronJob object.Before you beginYou need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster. It is recommended to run this tutorial on a cluster with at least two nodes that are not acting as control plane hosts. If you do not already have a cluster, you can create one by using minikube or you can use one of these Kubernetes playgrounds:iximiuz LabsKillercodaKodeKloudPlay with KubernetesCreating a CronJobCron jobs require a config file. Here is a manifest for a CronJob that runs a simple demonstration task every minute:application/job/cronjob.yaml apiVersion: batch/v1 kind: CronJob metadata: name: hello spec: schedule: "* * * * *" jobTemplate: spec: template: spec: containers: - name: hello image: busybox:1.28 imagePullPolicy: IfNotPresent command: - /bin/sh - -c - date; echo Hello from the Kubernetes cluster restartPolicy: OnFailure Run the example CronJob by using this command:kubectl create -f https://k8s.io/examples/application/job/cronjob.yaml The output is similar to this:cronjob.batch/hello created After creating the cron job, get its status using this command:kubectl get cronjob hello The output is similar to this:NAME SCHEDULE SUSPEND ACTIVE LAST SCHEDULE AGE hello */1 * * * * False 0 <none> 10s As you can see from the results of the command, the cron job has not scheduled or run any jobs yet. Watch for the job to be created in around one minute:kubectl get jobs --watch The output is similar to this:NAME COMPLETIONS DURATION AGE hello-4111706356 0/1 0s hello-4111706356 0/1 0s 0s hello-4111706356 1/1 5s 5s Now you've seen one running job scheduled by the "hello" cron job. You can stop watching the job and view the cron job again to see that it scheduled the job:kubectl get cronjob hello The output is similar to this:NAME SCHEDULE SUSPEND ACTIVE LAST SCHEDULE AGE hello */1 * * * * False 0 50s 75s You should see that the cron job hello successfully scheduled a job at the time specified in LAST SCHEDULE. There are currently 0 active jobs, meaning that the job has completed or failed.Now, find the pods that the last scheduled job created and view the standard output of one of the pods.Note:The job name is different from the pod name.# Replace "hello-4111706356" with the job name in your system pods=$(kubectl get pods --selector=job-name=hello-4111706356 --output=jsonpath={.items[


Question: How does Run Jobs work?

Answer: This is the multi-page printable view of this section. Click here to print.Return to the regular view of this page.Run JobsRun Jobs using parallel processing.1: Running Automated Tasks with a CronJob2: Coarse Parallel Processing Using a Work Queue3: Fine Parallel Processing Using a Work Queue4: Indexed Job for Parallel Processing with Static Work Assignment5: Job with Pod-to-Pod Communication6: Parallel Processing using Expansions7: Handling retriable and non-retriable pod failures with Pod failure policy1 - Running Automated Tasks with a CronJobThis page shows how to run automated tasks using Kubernetes CronJob object.Before you beginYou need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster. It is recommended to run this tutorial on a cluster with at least two nodes that are not acting as control plane hosts. If you do not already have a cluster, you can create one by using minikube or you can use one of these Kubernetes playgrounds:iximiuz LabsKillercodaKodeKloudPlay with KubernetesCreating a CronJobCron jobs require a config file. Here is a manifest for a CronJob that runs a simple demonstration task every minute:application/job/cronjob.yaml apiVersion: batch/v1 kind: CronJob metadata: name: hello spec: schedule: "* * * * *" jobTemplate: spec: template: spec: containers: - name: hello image: busybox:1.28 imagePullPolicy: IfNotPresent command: - /bin/sh - -c - date; echo Hello from the Kubernetes cluster restartPolicy: OnFailure Run the example CronJob by using this command:kubectl create -f https://k8s.io/examples/application/job/cronjob.yaml The output is similar to this:cronjob.batch/hello created After creating the cron job, get its status using this command:kubectl get cronjob hello The output is similar to this:NAME SCHEDULE SUSPEND ACTIVE LAST SCHEDULE AGE hello */1 * * * * False 0 <none> 10s As you can see from the results of the command, the cron job has not scheduled or run any jobs yet. Watch for the job to be created in around one minute:kubectl get jobs --watch The output is similar to this:NAME COMPLETIONS DURATION AGE hello-4111706356 0/1 0s hello-4111706356 0/1 0s 0s hello-4111706356 1/1 5s 5s Now you've seen one running job scheduled by the "hello" cron job. You can stop watching the job and view the cron job again to see that it scheduled the job:kubectl get cronjob hello The output is similar to this:NAME SCHEDULE SUSPEND ACTIVE LAST SCHEDULE AGE hello */1 * * * * False 0 50s 75s You should see that the cron job hello successfully scheduled a job at the time specified in LAST SCHEDULE. There are currently 0 active jobs, meaning that the job has completed or failed.Now, find the pods that the last scheduled job created and view the standard output of one of the pods.Note:The job name is different from the pod name.# Replace "hello-4111706356" with the job name in your system pods=$(kubectl get pods --selector=job-name=hello-4111706356 --output=jsonpath={.items[


Question: When would you use Run Jobs?

Answer: This is the multi-page printable view of this section. Click here to print.Return to the regular view of this page.Run JobsRun Jobs using parallel processing.1: Running Automated Tasks with a CronJob2: Coarse Parallel Processing Using a Work Queue3: Fine Parallel Processing Using a Work Queue4: Indexed Job for Parallel Processing with Static Work Assignment5: Job with Pod-to-Pod Communication6: Parallel Processing using Expansions7: Handling retriable and non-retriable pod failures with Pod failure policy1 - Running Automated Tasks with a CronJobThis page shows how to run automated tasks using Kubernetes CronJob object.Before you beginYou need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster. It is recommended to run this tutorial on a cluster with at least two nodes that are not acting as control plane hosts. If you do not already have a cluster, you can create one by using minikube or you can use one of these Kubernetes playgrounds:iximiuz LabsKillercodaKodeKloudPlay with KubernetesCreating a CronJobCron jobs require a config file. Here is a manifest for a CronJob that runs a simple demonstration task every minute:application/job/cronjob.yaml apiVersion: batch/v1 kind: CronJob metadata: name: hello spec: schedule: "* * * * *" jobTemplate: spec: template: spec: containers: - name: hello image: busybox:1.28 imagePullPolicy: IfNotPresent command: - /bin/sh - -c - date; echo Hello from the Kubernetes cluster restartPolicy: OnFailure Run the example CronJob by using this command:kubectl create -f https://k8s.io/examples/application/job/cronjob.yaml The output is similar to this:cronjob.batch/hello created After creating the cron job, get its status using this command:kubectl get cronjob hello The output is similar to this:NAME SCHEDULE SUSPEND ACTIVE LAST SCHEDULE AGE hello */1 * * * * False 0 <none> 10s As you can see from the results of the command, the cron job has not scheduled or run any jobs yet. Watch for the job to be created in around one minute:kubectl get jobs --watch The output is similar to this:NAME COMPLETIONS DURATION AGE hello-4111706356 0/1 0s hello-4111706356 0/1 0s 0s hello-4111706356 1/1 5s 5s Now you've seen one running job scheduled by the "hello" cron job. You can stop watching the job and view the cron job again to see that it scheduled the job:kubectl get cronjob hello The output is similar to this:NAME SCHEDULE SUSPEND ACTIVE LAST SCHEDULE AGE hello */1 * * * * False 0 50s 75s You should see that the cron job hello successfully scheduled a job at the time specified in LAST SCHEDULE. There are currently 0 active jobs, meaning that the job has completed or failed.Now, find the pods that the last scheduled job created and view the standard output of one of the pods.Note:The job name is different from the pod name.# Replace "hello-4111706356" with the job name in your system pods=$(kubectl get pods --selector=job-name=hello-4111706356 --output=jsonpath={.items[


Question: What are the benefits of Run Jobs?

Answer: This is the multi-page printable view of this section. Click here to print.Return to the regular view of this page.Run JobsRun Jobs using parallel processing.1: Running Automated Tasks with a CronJob2: Coarse Parallel Processing Using a Work Queue3: Fine Parallel Processing Using a Work Queue4: Indexed Job for Parallel Processing with Static Work Assignment5: Job with Pod-to-Pod Communication6: Parallel Processing using Expansions7: Handling retriable and non-retriable pod failures with Pod failure policy1 - Running Automated Tasks with a CronJobThis page shows how to run automated tasks using Kubernetes CronJob object.Before you beginYou need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster. It is recommended to run this tutorial on a cluster with at least two nodes that are not acting as control plane hosts. If you do not already have a cluster, you can create one by using minikube or you can use one of these Kubernetes playgrounds:iximiuz LabsKillercodaKodeKloudPlay with KubernetesCreating a CronJobCron jobs require a config file. Here is a manifest for a CronJob that runs a simple demonstration task every minute:application/job/cronjob.yaml apiVersion: batch/v1 kind: CronJob metadata: name: hello spec: schedule: "* * * * *" jobTemplate: spec: template: spec: containers: - name: hello image: busybox:1.28 imagePullPolicy: IfNotPresent command: - /bin/sh - -c - date; echo Hello from the Kubernetes cluster restartPolicy: OnFailure Run the example CronJob by using this command:kubectl create -f https://k8s.io/examples/application/job/cronjob.yaml The output is similar to this:cronjob.batch/hello created After creating the cron job, get its status using this command:kubectl get cronjob hello The output is similar to this:NAME SCHEDULE SUSPEND ACTIVE LAST SCHEDULE AGE hello */1 * * * * False 0 <none> 10s As you can see from the results of the command, the cron job has not scheduled or run any jobs yet. Watch for the job to be created in around one minute:kubectl get jobs --watch The output is similar to this:NAME COMPLETIONS DURATION AGE hello-4111706356 0/1 0s hello-4111706356 0/1 0s 0s hello-4111706356 1/1 5s 5s Now you've seen one running job scheduled by the "hello" cron job. You can stop watching the job and view the cron job again to see that it scheduled the job:kubectl get cronjob hello The output is similar to this:NAME SCHEDULE SUSPEND ACTIVE LAST SCHEDULE AGE hello */1 * * * * False 0 50s 75s You should see that the cron job hello successfully scheduled a job at the time specified in LAST SCHEDULE. There are currently 0 active jobs, meaning that the job has completed or failed.Now, find the pods that the last scheduled job created and view the standard output of one of the pods.Note:The job name is different from the pod name.# Replace "hello-4111706356" with the job name in your system pods=$(kubectl get pods --selector=job-name=hello-4111706356 --output=jsonpath={.items[


Question: What is Run Jobs?

Answer: 1 :   R u n n i n g   A u t o m a t e d   T a s k s   w i t h   a   C r o n J o b 2 :   C o a r s e   P a r a l l e l   P r o c e s s i n g   U s i n g   a   W o r k   Q u e u e 3 :   F i n e   P a r a l l e l   P r o c e s s i n g   U s i n g   a   W o r k   Q u e u e 4 :   I n d e x e d   J o b   f o r   P a r a l l e l   P r o c e s s i n g   w i t h   S t a t i c   W o r k   A s s i g n m e n t 5 :   J o b   w i t h   P o d - t o - P o d   C o m m u n i c a t i o n 6 :   P a r a l l e l   P r o c e s s i n g   u s i n g   E x p a n s i o n s 7 :   H a n d l i n g   r e t r i a b l e   a n d   n o n - r e t r i a b l e   p o d   f a i l u r e s   w i t h   P o d   f a i l u r e   p o l i c y


Question: What is 1 - Running Automated Tasks with a CronJob?

Answer: T h i s   p a g e   s h o w s   h o w   t o   r u n   a u t o m a t e d   t a s k s   u s i n g   K u b e r n e t e s   C r o n J o b   o b j e c t .


Question: What is Before you begin?

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


Question: What is Creating a CronJob?

Answer: C r o n   j o b s   r e q u i r e   a   c o n f i g   f i l e .   H e r e   i s   a   m a n i f e s t   f o r   a   C r o n J o b   t h a t   r u n s   a   s i m p l e   d e m o n s t r a t i o n   t a s k   e v e r y   m i n u t e :   a p i V e r s i o n :   b a t c h / v 1   k i n d :   C r o n J o b   m e t a d a t a :   n a m e :   h e l l o   s p e c :   s c h e d u l e :   " *   *   *   *   * "   j o b T e m p l a t e :   s p e c :   t e m p l a t e :   s p e c :   c o n t a i n e r s :   -   n a m e :   h e l l o   i m a g e :   b u s y b o x : 1 . 2 8   i m a g e P u l l P o l i c y :   I f N o t P r e s e n t   c o m m a n d :   -   / b i n / s h   -   - c   -   d a t e ;   e c h o   H e l l o   f r o m   t h e   K u b e r n e t e s   c l u s t e r   r e s t a r t P o l i c y :   O n F a i l u r e   R u n   t h e   e x a m p l e   C r o n J o b   b y   u s i n g   t h i s   c o m m a n d :   k u b e c t l   c r e a t e   - f   h t t p s : / / k 8 s . i o / e x a m p l e s / a p p l i c a t i o n / j o b / c r o n j o b . y a m l   T h e   o u t p u t   i s   s i m i l a r   t o   t h i s :   c r o n j o b . b a t c h / h e l l o   c r e a t e d   A f t e r   c r e a t i n g   t h e   c r o n   j o b ,   g e t   i t s   s t a t u s   u s i n g   t h i s   c o m m a n d :   k u b e c t l   g e t   c r o n j o b   h e l l o   T h e   o u t p u t   i s   s i m i l a r   t o   t h i s :   N A M E   S C H E D U L E   S U S P E N D   A C T I V E   L A S T   S C H E D U L E   A G E   h e l l o   * / 1   *   *   *   *   F a l s e   0   < n o n e >   1 0 s   A s   y o u   c a n   s e e   f r o m   t h e   r e s u l t s   o f   t h e   c o m m a n d ,   t h e   c r o n   j o b   h a s   n o t   s c h e d u l e d   o r   r u n   a n y   j o b s   y e t .   W a t c h   f o r   t h e   j o b   t o   b e   c r e a t e d   i n   a r o u n d   o n e   m i n u t e :   k u b e c t l   g e t   j o b s   - - w a t c h   T h e   o u t p u t   i s   s i m i l a r   t o   t h i s


Question: What is Note:?

Answer: #   R e p l a c e   " h e l l o - 4 1 1 1 7 0 6 3 5 6 "   w i t h   t h e   j o b   n a m e   i n   y o u r   s y s t e m   p o d s = $ ( k u b e c t l   g e t   p o d s   - - s e l e c t o r = j o b - n a m e = h e l l o - 4 1 1 1 7 0 6 3 5 6   - - o u t p u t = j s o n p a t h = { . i t e m s [ * ] . m e t a d a t a . n a m e } )   S h o w   t h e   p o d   l o g :   k u b e c t l   l o g s   $ p o d s   T h e   o u t p u t   i s   s i m i l a r   t o   t h i s :   F r i   F e b   2 2   1 1 : 0 2 : 0 9   U T C   2 0 1 9   H e l l o   f r o m   t h e   K u b e r n e t e s   c l u s t e r


Question: What is Deleting a CronJob?

Answer: W h e n   y o u   d o n ' t   n e e d   a   c r o n   j o b   a n y   m o r e ,   d e l e t e   i t   w i t h   k u b e c t l   d e l e t e   c r o n j o b   < c r o n j o b   n a m e > :   k u b e c t l   d e l e t e   c r o n j o b   h e l l o   D e l e t i n g   t h e   c r o n   j o b   r e m o v e s   a l l   t h e   j o b s   a n d   p o d s   i t   c r e a t e d   a n d   s t o p s   i t   f r o m   c r e a t i n g   a d d i t i o n a l   j o b s .   Y o u   c a n   r e a d   m o r e   a b o u t   r e m o v i n g   j o b s   i n   g a r b a g e   c o l l e c t i o n .


Question: What is 2 - Coarse Parallel Processing Using a Work Queue?

Answer: I n   t h i s   e x a m p l e ,   y o u   w i l l   r u n   a   K u b e r n e t e s   J o b   w i t h   m u l t i p l e   p a r a l l e l   w o r k e r   p r o c e s s e s .   I n   t h i s   e x a m p l e ,   a s   e a c h   p o d   i s   c r e a t e d ,   i t   p i c k s   u p   o n e   u n i t   o f   w o r k   f r o m   a   t a s k   q u e u e ,   c o m p l e t e s   i t ,   d e l e t e s   i t   f r o m   t h e   q u e u e ,   a n d   e x i t s .   H e r e   i s   a n   o v e r v i e w   o f   t h e   s t e p s   i n   t h i s   e x a m p l e :   S t a r t   a   m e s s a g e   q u e u e   s e r v i c e .   I n   t h i s   e x a m p l e ,   y o u   u s e   R a b b i t M Q ,   b u t   y o u   c o u l d   u s e   a n o t h e r   o n e .   I n   p r a c t i c e   y o u   w o u l d   s e t   u p   a   m e s s a g e   q u e u e   s e r v i c e   o n c e   a n d   r e u s e   i t   f o r   m a n y   j o b s . C r e a t e   a   q u e u e ,   a n d   f i l l   i t   w i t h   m e s s a g e s .   E a c h   m e s s a g e   r e p r e s e n t s   o n e   t a s k   t o   b e   d o n e .   I n   t h i s   e x a m p l e ,   a   m e s s a g e   i s   a n   i n t e g e r   t h a t   w e   w i l l   d o   a   l e n g t h y   c o m p u t a t i o n   o n . S t a r t   a   J o b   t h a t   w o r k s   o n   t a s k s   f r o m   t h e   q u e u e .   T h e   J o b   s t a r t s   s e v e r a l   p o d s .   E a c h   p o d   t a k e s   o n e   t a s k   f r o m   t h e   m e s s a g e   q u e u e ,   p r o c e s s e s   i t ,   a n d   e x i t s .


Question: What is Before you begin?

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


Question: What is Starting a message queue service?

Answer: T h i s   e x a m p l e   u s e s   R a b b i t M Q ,   h o w e v e r ,   y o u   c a n   a d a p t   t h e   e x a m p l e   t o   u s e   a n o t h e r   A M Q P - t y p e   m e s s a g e   s e r v i c e .   I n   p r a c t i c e   y o u   c o u l d   s e t   u p   a   m e s s a g e   q u e u e   s e r v i c e   o n c e   i n   a   c l u s t e r   a n d   r e u s e   i t   f o r   m a n y   j o b s ,   a s   w e l l   a s   f o r   l o n g - r u n n i n g   s e r v i c e s .   S t a r t   R a b b i t M Q   a s   f o l l o w s :   #   m a k e   a   S e r v i c e   f o r   t h e   S t a t e f u l S e t   t o   u s e   k u b e c t l   c r e a t e   - f   h t t p s : / / k u b e r n e t e s . i o / e x a m p l e s / a p p l i c a t i o n / j o b / r a b b i t m q / r a b b i t m q - s e r v i c e . y a m l   s e r v i c e   " r a b b i t m q - s e r v i c e "   c r e a t e d   k u b e c t l   c r e a t e   - f   h t t p s : / / k u b e r n e t e s . i o / e x a m p l e s / a p p l i c a t i o n / j o b / r a b b i t m q / r a b b i t m q - s t a t e f u l s e t . y a m l   s t a t e f u l s e t   " r a b b i t m q "   c r e a t e d


Question: What is Testing the message queue service?

Answer: N o w ,   w e   c a n   e x p e r i m e n t   w i t h   a c c e s s i n g   t h e   m e s s a g e   q u e u e .   W e   w i l l   c r e a t e   a   t e m p o r a r y   i n t e r a c t i v e   p o d ,   i n s t a l l   s o m e   t o o l s   o n   i t ,   a n d   e x p e r i m e n t   w i t h   q u e u e s .   F i r s t   c r e a t e   a   t e m p o r a r y   i n t e r a c t i v e   P o d .   #   C r e a t e   a   t e m p o r a r y   i n t e r a c t i v e   c o n t a i n e r   k u b e c t l   r u n   - i   - - t t y   t e m p   - - i m a g e   u b u n t u : 2 2 . 0 4   W a i t i n g   f o r   p o d   d e f a u l t / t e m p - l o e 0 7   t o   b e   r u n n i n g ,   s t a t u s   i s   P e n d i n g ,   p o d   r e a d y :   f a l s e   . . .   [   p r e v i o u s   l i n e   r e p e a t s   s e v e r a l   t i m e s   . .   h i t   r e t u r n   w h e n   i t   s t o p s   ]   . . .   N o t e   t h a t   y o u r   p o d   n a m e   a n d   c o m m a n d   p r o m p t   w i l l   b e   d i f f e r e n t .


Question: What is Fill the queue with tasks?

Answer: N o w ,   f i l l   t h e   q u e u e   w i t h   s o m e   s i m u l a t e d   t a s k s .   I n   t h i s   e x a m p l e ,   t h e   t a s k s   a r e   s t r i n g s   t o   b e   p r i n t e d .   I n   a   p r a c t i c e ,   t h e   c o n t e n t   o f   t h e   m e s s a g e s   m i g h t   b e :   n a m e s   o f   f i l e s   t o   t h a t   n e e d   t o   b e   p r o c e s s e d e x t r a   f l a g s   t o   t h e   p r o g r a m r a n g e s   o f   k e y s   i n   a   d a t a b a s e   t a b l e c o n f i g u r a t i o n   p a r a m e t e r s   t o   a   s i m u l a t i o n f r a m e   n u m b e r s   o f   a   s c e n e   t o   b e   r e n d e r e d   I f   t h e r e   i s   l a r g e   d a t a   t h a t   i s   n e e d e d   i n   a   r e a d - o n l y   m o d e   b y   a l l   p o d s   o f   t h e   J o b ,   y o u   t y p i c a l l y   p u t   t h a t   i n   a   s h a r e d   f i l e   s y s t e m   l i k e   N F S   a n d   m o u n t   t h a t   r e a d o n l y   o n   a l l   t h e   p o d s ,   o r   w r i t e   t h e   p r o g r a m   i n   t h e   p o d   s o   t h a t   i t   c a n   n a t i v e l y   r e a d   d a t a   f r o m   a   c l u s t e r   f i l e   s y s t e m   ( f o r   e x a m p l e :   H D F S ) .   F o r   t h i s   e x a m p l e ,   y o u   w i l l   c r e a t e   t h e   q u e u e   a n d   f i l l   i t   u s i n g   t h e   A M Q P   c o m m a n d   l i n e   t o o l s .   I n   p r a c t i c e ,   y o u   m i g h t   w r i t e   a   p r o g r a m   t o   f i l l   t h e   q u e u e   u s i n g   a n   A M Q P   c l i e n t   l i b r a r y .   #   R u n   t h i s   o n   y o u r   c o m p u t e r ,   n o t   i n   t h e   P o d   / u s r / b i n / a m q p - d e c l a r e - q u e u e   - - u r l = $ B R O K E R _ U R L   - q   j o b 1   - d   j o b 1   A d d   i t e m s   t o   t h e   q u e u e :   f o r   f   i n   a p p l e   b a n a n a   c h e r r y   d a t e   f i g   g r a p e   l e m o n   m e l o n   d o   / u s


Question: What is Create a container image?

Answer: N o w   y o u   a r e   r e a d y   t o   c r e a t e   a n   i m a g e   t h a t   y o u   w i l l   r u n   a s   a   J o b .   T h e   j o b   w i l l   u s e   t h e   a m q p - c o n s u m e   u t i l i t y   t o   r e a d   t h e   m e s s a g e   f r o m   t h e   q u e u e   a n d   r u n   t h e   a c t u a l   w o r k .   H e r e   i s   a   v e r y   s i m p l e   e x a m p l e   p r o g r a m :   # ! / u s r / b i n / e n v   p y t h o n   #   J u s t   p r i n t s   s t a n d a r d   o u t   a n d   s l e e p s   f o r   1 0   s e c o n d s .   i m p o r t   s y s   i m p o r t   t i m e   p r i n t ( " P r o c e s s i n g   "   +   s y s . s t d i n . r e a d l i n e s ( ) [ 0 ] )   t i m e . s l e e p ( 1 0 )   G i v e   t h e   s c r i p t   e x e c u t i o n   p e r m i s s i o n :   c h m o d   + x   w o r k e r . p y   N o w ,   b u i l d   a n   i m a g e .   M a k e   a   t e m p o r a r y   d i r e c t o r y ,   c h a n g e   t o   i t ,   d o w n l o a d   t h e   D o c k e r f i l e ,   a n d   w o r k e r . p y .   I n   e i t h e r   c a s e ,   b u i l d   t h e   i m a g e   w i t h   t h i s   c o m m a n d :   d o c k e r   b u i l d   - t   j o b - w q - 1   .   F o r   t h e   D o c k e r   H u b ,   t a g   y o u r   a p p   i m a g e   w i t h   y o u r   u s e r n a m e   a n d   p u s h   t o   t h e   H u b   w i t h   t h e   b e l o w   c o m m a n d s .   R e p l a c e   < u s e r n a m e >   w i t h   y o u r   H u b   u s e r n a m e .   d o c k e r   t a g   j o b - w q - 1   < u s e r n a m e > / j o b - w q - 1   d o c k e r   p u s h   < u s e r n a m e > / j o b - w q - 1   I f   y o u   a r e   u s i n g   a n   a l t e r n a t i v e   c o n t a i n e r   i m a g e   r e g i s t r y ,   t a g   t h e   i m a g e   a n d   p u s h   i t   t h e r e   i n s t e a d .


Question: What is Defining a Job?

Answer: H e r e   i s   a   m a n i f e s t   f o r   a   J o b .   Y o u ' l l   n e e d   t o   m a k e   a   c o p y   o f   t h e   J o b   m a n i f e s t   ( c a l l   i t   . / j o b . y a m l ) ,   a n d   e d i t   t h e   n a m e   o f   t h e   c o n t a i n e r   i m a g e   t o   m a t c h   t h e   n a m e   y o u   u s e d .   a p i V e r s i o n :   b a t c h / v 1   k i n d :   J o b   m e t a d a t a :   n a m e :   j o b - w q - 1   s p e c :   c o m p l e t i o n s :   8   p a r a l l e l i s m :   2   t e m p l a t e :   m e t a d a t a :   n a m e :   j o b - w q - 1   s p e c :   c o n t a i n e r s :   -   n a m e :   c   i m a g e :   g c r . i o / < p r o j e c t > / j o b - w q - 1   e n v :   -   n a m e :   B R O K E R _ U R L   v a l u e :   a m q p : / / g u e s t : g u e s t @ r a b b i t m q - s e r v i c e : 5 6 7 2   -   n a m e :   Q U E U E   v a l u e :   j o b 1   r e s t a r t P o l i c y :   O n F a i l u r e   I n   t h i s   e x a m p l e ,   e a c h   p o d   w o r k s   o n   o n e   i t e m   f r o m   t h e   q u e u e   a n d   t h e n   e x i t s .   S o ,   t h e   c o m p l e t i o n   c o u n t   o f   t h e   J o b   c o r r e s p o n d s   t o   t h e   n u m b e r   o f   w o r k   i t e m s   d o n e .   T h a t   i s   w h y   t h e   e x a m p l e   m a n i f e s t   h a s   . s p e c . c o m p l e t i o n s   s e t   t o   8 .


Question: What is Running the Job?

Answer: N o w ,   r u n   t h e   J o b :   #   t h i s   a s s u m e s   y o u   d o w n l o a d e d   a n d   t h e n   e d i t e d   t h e   m a n i f e s t   a l r e a d y   k u b e c t l   a p p l y   - f   . / j o b . y a m l   Y o u   c a n   w a i t   f o r   t h e   J o b   t o   s u c c e e d ,   w i t h   a   t i m e o u t :   #   T h e   c h e c k   f o r   c o n d i t i o n   n a m e   i s   c a s e   i n s e n s i t i v e   k u b e c t l   w a i t   - - f o r = c o n d i t i o n = c o m p l e t e   - - t i m e o u t = 3 0 0 s   j o b / j o b - w q - 1   N e x t ,   c h e c k   o n   t h e   J o b :   k u b e c t l   d e s c r i b e   j o b s / j o b - w q - 1   N a m e :   j o b - w q - 1   N a m e s p a c e :   d e f a u l t   S e l e c t o r :   c o n t r o l l e r - u i d = 4 1 d 7 5 7 0 5 - 9 2 d f - 1 1 e 7 - b 8 5 e - f a 1 6 3 e e 3 c 1 1 f   L a b e l s :   c o n t r o l l e r - u i d = 4 1 d 7 5 7 0 5 - 9 2 d f - 1 1 e 7 - b 8 5 e - f a 1 6 3 e e 3 c 1 1 f   j o b - n a m e = j o b - w q - 1   A n n o t a t i o n s :   < n o n e >   P a r a l l e l i s m :   2   C o m p l e t i o n s :   8   S t a r t   T i m e :   W e d ,   0 6   S e p   2 0 2 2   1 6 : 4 2 : 0 2   + 0 0 0 0   P o d s   S t a t u s e s :   0   R u n n i n g   /   8   S u c c e e d e d   /   0   F a i l e d   P o d   T e m p l a t e :   L a b e l s :   c o n t r o l l e r - u i d = 4 1 d 7 5 7 0 5 - 9 2 d f - 1 1 e 7 - b 8 5 e - f a 1 6 3 e e 3 c 1 1 f   j o b - n a m e = j o b - w q - 1   C o n t a i n e r s :   c :   I m a g e :   c o n t a i n e r - r e g i s t r y . e x a m p l e / c a u s a l - j i g s a w - 6 3 7 / j o b - w q - 1   P o r t :   E n v i r o n m e n t :   B R O K E R _ U R L :   a m q p : / / g u e s t : g u e s t @ r a b b i t m q - s e r v i c e : 5 6 7 2   Q U E U E :   j o b 1   M o u n t s :   < n o n e >   V o l u m e s :   < n o n e >   E v e n t s :   F i r s t S e e n   L a s t S e e n   C o u n t   F r o m   S u b o b j e c t P a t h   T y p e   R e a s