Question: What is wait?

Answer: W a i t   f o r   t h e   p o d   " b u s y b o x 1 "   t o   c o n t a i n   t h e   s t a t u s   c o n d i t i o n   o f   t y p e   " R e a d y "   k u b e c t l   w a i t   - - f o r = c o n d i t i o n = R e a d y   p o d / b u s y b o x 1   T h e   d e f a u l t   v a l u e   o f   s t a t u s   c o n d i t i o n   i s   t r u e ;   y o u   c a n   s e t   i t   t o   f a l s e   k u b e c t l   w a i t   - - f o r = c o n d i t i o n = R e a d y = f a l s e   p o d / b u s y b o x 1   W a i t   f o r   t h e   p o d   " b u s y b o x 1 "   t o   b e   d e l e t e d ,   w i t h   a   t i m e o u t   o f   6 0 s ,   a f t e r   h a v i n g   i s s u e d   t h e   " d e l e t e "   c o m m a n d   k u b e c t l   d e l e t e   p o d / b u s y b o x 1   k u b e c t l   w a i t   - - f o r = d e l e t e   p o d / b u s y b o x 1   - - t i m e o u t = 6 0 s   E x p e r i m e n t a l :   W a i t   f o r   a   s p e c i f i c   c o n d i t i o n   o n   o n e   o r   m a n y   r e s o u r c e s .   T h e   c o m m a n d   t a k e s   m u l t i p l e   r e s o u r c e s   a n d   w a i t s   u n t i l   t h e   s p e c i f i e d   c o n d i t i o n   i s   s e e n   i n   t h e   S t a t u s   f i e l d   o f   e v e r y   g i v e n   r e s o u r c e .   A l t e r n a t i v e l y ,   t h e   c o m m a n d   c a n   w a i t   f o r   t h e   g i v e n   s e t   o f   r e s o u r c e s   t o   b e   d e l e t e d   b y   p r o v i d i n g   t h e   " d e l e t e "   k e y w o r d   a s   t h e   v a l u e   t o   t h e   - - f o r   f l a g .   A   s u c c e s s f u l   m e s s a g e   w i l l   b e   p r i n t e d   t o   s t d o u t   i n d i c a t i n g   w h e n   t h e   s p e c i f i e d   c o n d i t i o n   h a s   b e e n   m e t .   Y o u   c a n   u s e   - o   o p t i o n   t o   c h a n g e   t o   o u t p u t   d e s t i n a t i o n .


Question: What is Usage?

Answer: $   k u b e c t l   w a i t   ( [ - f   F I L E N A M E ]   |   r e s o u r c e . g r o u p / r e s o u r c e . n a m e   |   r e s o u r c e . g r o u p   [ ( - l   l a b e l   |   - - a l l ) ] )   [ - - f o r = d e l e t e | - - f o r   c o n d i t i o n = a v a i l a b l e ]


Question: What is WORKING WITH APPS?

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


Question: What is attach?

Answer: G e t   o u t p u t   f r o m   r u n n i n g   p o d   m y p o d ;   u s e   t h e   ' k u b e c t l . k u b e r n e t e s . i o / d e f a u l t - c o n t a i n e r '   a n n o t a t i o n   #   f o r   s e l e c t i n g   t h e   c o n t a i n e r   t o   b e   a t t a c h e d   o r   t h e   f i r s t   c o n t a i n e r   i n   t h e   p o d   w i l l   b e   c h o s e n   k u b e c t l   a t t a c h   m y p o d   G e t   o u t p u t   f r o m   r u b y - c o n t a i n e r   f r o m   p o d   m y p o d   k u b e c t l   a t t a c h   m y p o d   - c   r u b y - c o n t a i n e r   S w i t c h   t o   r a w   t e r m i n a l   m o d e ;   s e n d s   s t d i n   t o   ' b a s h '   i n   r u b y - c o n t a i n e r   f r o m   p o d   m y p o d   #   a n d   s e n d s   s t d o u t / s t d e r r   f r o m   ' b a s h '   b a c k   t o   t h e   c l i e n t   k u b e c t l   a t t a c h   m y p o d   - c   r u b y - c o n t a i n e r   - i   - t   G e t   o u t p u t   f r o m   t h e   f i r s t   p o d   o f   a   r e p l i c a   s e t   n a m e d   n g i n x   k u b e c t l   a t t a c h   r s / n g i n x   A t t a c h   t o   a   p r o c e s s   t h a t   i s   a l r e a d y   r u n n i n g   i n s i d e   a n   e x i s t i n g   c o n t a i n e r .


Question: What is Usage?

Answer: $   k u b e c t l   a t t a c h   ( P O D   |   T Y P E / N A M E )   - c   C O N T A I N E R


Question: What is auth?

Answer: I n s p e c t   a u t h o r i z a t i o n


Question: What is Usage?

Answer: $   k u b e c t l   a u t h


Question: What is can-i?

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


Question: What is Usage?

Answer: $   k u b e c t l   a u t h   c a n - i   V E R B   [ T Y P E   |   T Y P E / N A M E   |   N O N R E S O U R C E U R L ]


Question: What is reconcile?

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


Question: What is Usage?

Answer: $   k u b e c t l   a u t h   r e c o n c i l e   - f   F I L E N A M E


Question: What is cp?

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


Question: What is Usage?

Answer: $   k u b e c t l   c p   < f i l e - s p e c - s r c >   < f i l e - s p e c - d e s t >


Question: What is describe?

Answer: D e s c r i b e   a   n o d e   k u b e c t l   d e s c r i b e   n o d e s   k u b e r n e t e s - n o d e - e m t 8 . c . m y p r o j e c t . i n t e r n a l   D e s c r i b e   a   p o d   k u b e c t l   d e s c r i b e   p o d s / n g i n x   D e s c r i b e   a   p o d   i d e n t i f i e d   b y   t y p e   a n d   n a m e   i n   " p o d . j s o n "   k u b e c t l   d e s c r i b e   - f   p o d . j s o n   D e s c r i b e   a l l   p o d s   k u b e c t l   d e s c r i b e   p o d s   D e s c r i b e   p o d s   b y   l a b e l   n a m e = m y L a b e l   k u b e c t l   d e s c r i b e   p o   - l   n a m e = m y L a b e l   D e s c r i b e   a l l   p o d s   m a n a g e d   b y   t h e   ' f r o n t e n d '   r e p l i c a t i o n   c o n t r o l l e r   ( r c - c r e a t e d   p o d s   #   g e t   t h e   n a m e   o f   t h e   r c   a s   a   p r e f i x   i n   t h e   p o d   t h e   n a m e )   k u b e c t l   d e s c r i b e   p o d s   f r o n t e n d   S h o w   d e t a i l s   o f   a   s p e c i f i c   r e s o u r c e   o r   g r o u p   o f   r e s o u r c e s .   P r i n t   a   d e t a i l e d   d e s c r i p t i o n   o f   t h e   s e l e c t e d   r e s o u r c e s ,   i n c l u d i n g   r e l a t e d   r e s o u r c e s   s u c h   a s   e v e n t s   o r   c o n t r o l l e r s .   Y o u   m a y   s e l e c t   a   s i n g l e   o b j e c t   b y   n a m e ,   a l l   o b j e c t s   o f   t h a t   t y p e ,   p r o v i d e   a   n a m e   p r e f i x ,   o r   l a b e l   s e l e c t o r .   F o r   e x a m p l e :   $   k u b e c t l   d e s c r i b e   T Y P E   N A M E _ P R E F I X   w i l l   f i r s t   c h e c k   f o r   a n   e x a c t   m a t c h   o n   T Y P E   a n d   N A M E _ P R E F I X .   I f   n o   s u c h   r e s o u r c e   e x i s t s ,   i t   w i l l   o u t p u t   d e t a i l s   f o r   e v e r y   r e s o u r c e   t h a t   h a s   a   n a m e   p r e f i x e d   w i t h   N A M E _ P R E F I X .


Question: What is Usage?

Answer: $   k u b e c t l   d e s c r i b e   ( - f   F I L E N A M E   |   T Y P E   [ N A M E _ P R E F I X   |   - l   l a b e l ]   |   T Y P E / N A M E )


Question: What is exec?

Answer: G e t   o u t p u t   f r o m   r u n n i n g   t h e   ' d a t e '   c o m m a n d   f r o m   p o d   m y p o d ,   u s i n g   t h e   f i r s t   c o n t a i n e r   b y   d e f a u l t   k u b e c t l   e x e c   m y p o d   - -   d a t e   G e t   o u t p u t   f r o m   r u n n i n g   t h e   ' d a t e '   c o m m a n d   i n   r u b y - c o n t a i n e r   f r o m   p o d   m y p o d   k u b e c t l   e x e c   m y p o d   - c   r u b y - c o n t a i n e r   - -   d a t e   S w i t c h   t o   r a w   t e r m i n a l   m o d e ;   s e n d s   s t d i n   t o   ' b a s h '   i n   r u b y - c o n t a i n e r   f r o m   p o d   m y p o d   #   a n d   s e n d s   s t d o u t / s t d e r r   f r o m   ' b a s h '   b a c k   t o   t h e   c l i e n t   k u b e c t l   e x e c   m y p o d   - c   r u b y - c o n t a i n e r   - i   - t   - -   b a s h   - i l   L i s t   c o n t e n t s   o f   / u s r   f r o m   t h e   f i r s t   c o n t a i n e r   o f   p o d   m y p o d   a n d   s o r t   b y   m o d i f i c a t i o n   t i m e   #   I f   t h e   c o m m a n d   y o u   w a n t   t o   e x e c u t e   i n   t h e   p o d   h a s   a n y   f l a g s   i n   c o m m o n   ( e . g .   - i ) ,   #   y o u   m u s t   u s e   t w o   d a s h e s   ( - - )   t o   s e p a r a t e   y o u r   c o m m a n d ' s   f l a g s / a r g u m e n t s   #   A l s o   n o t e ,   d o   n o t   s u r r o u n d   y o u r   c o m m a n d   a n d   i t s   f l a g s / a r g u m e n t s   w i t h   q u o t e s   #   u n l e s s   t h a t   i s   h o w   y o u   w o u l d   e x e c u t e   i t   n o r m a l l y   ( i . e . ,   d o   l s   - t   / u s r ,   n o t   " l s   - t   / u s r " )   k u b e c t l   e x e c   m y p o d   - i   - t   - -   l s   - t   / u s r   G e t   o u t p u t   f r o m   r u n n i n g   ' d a t e '   c o m m a n d   f r o m   t h e   f i r s t   p o d   o f   t h e   d e p l o y m e n t   m y d e p l o y m e n t ,   u s i n g   t h e   f i r s t


Question: What is Usage?

Answer: $   k u b e c t l   e x e c   ( P O D   |   T Y P E / N A M E )   [ - c   C O N T A I N E R ]   [ f l a g s ]   - -   C O M M A N D   [ a r g s . . . ]


Question: What is logs?

Answer: R e t u r n   s n a p s h o t   l o g s   f r o m   p o d   n g i n x   w i t h   o n l y   o n e   c o n t a i n e r   k u b e c t l   l o g s   n g i n x   R e t u r n   s n a p s h o t   l o g s   f r o m   p o d   n g i n x   w i t h   m u l t i   c o n t a i n e r s   k u b e c t l   l o g s   n g i n x   - - a l l - c o n t a i n e r s = t r u e   R e t u r n   s n a p s h o t   l o g s   f r o m   a l l   c o n t a i n e r s   i n   p o d s   d e f i n e d   b y   l a b e l   a p p = n g i n x   k u b e c t l   l o g s   - l   a p p = n g i n x   - - a l l - c o n t a i n e r s = t r u e   R e t u r n   s n a p s h o t   o f   p r e v i o u s   t e r m i n a t e d   r u b y   c o n t a i n e r   l o g s   f r o m   p o d   w e b - 1   k u b e c t l   l o g s   - p   - c   r u b y   w e b - 1   B e g i n   s t r e a m i n g   t h e   l o g s   o f   t h e   r u b y   c o n t a i n e r   i n   p o d   w e b - 1   k u b e c t l   l o g s   - f   - c   r u b y   w e b - 1   B e g i n   s t r e a m i n g   t h e   l o g s   f r o m   a l l   c o n t a i n e r s   i n   p o d s   d e f i n e d   b y   l a b e l   a p p = n g i n x   k u b e c t l   l o g s   - f   - l   a p p = n g i n x   - - a l l - c o n t a i n e r s = t r u e   D i s p l a y   o n l y   t h e   m o s t   r e c e n t   2 0   l i n e s   o f   o u t p u t   i n   p o d   n g i n x   k u b e c t l   l o g s   - - t a i l = 2 0   n g i n x   S h o w   a l l   l o g s   f r o m   p o d   n g i n x   w r i t t e n   i n   t h e   l a s t   h o u r   k u b e c t l   l o g s   - - s i n c e = 1 h   n g i n x   S h o w   l o g s   f r o m   a   k u b e l e t   w i t h   a n   e x p i r e d   s e r v i n g   c e r t i f i c a t e   k u b e c t l   l o g s   - - i n s e c u r e - s k i p - t l s - v e r i f y - b a c k e n d   n g i n x   R e t u r n   s n a p s h o t   l o g s   f r o m   f i r s t   c o n t a i n e r   o f   a   j o b   n a m e d   h e l l o   k u b e c t l   l o g s   j o b / h e l l


Question: What is Usage?

Answer: $   k u b e c t l   l o g s   [ - f ]   [ - p ]   ( P O D   |   T Y P E / N A M E )   [ - c   C O N T A I N E R ]


Question: What is port-forward?

Answer: L i s t e n   o n   p o r t s   5 0 0 0   a n d   6 0 0 0   l o c a l l y ,   f o r w a r d i n g   d a t a   t o / f r o m   p o r t s   5 0 0 0   a n d   6 0 0 0   i n   t h e   p o d   k u b e c t l   p o r t - f o r w a r d   p o d / m y p o d   5 0 0 0   6 0 0 0   L i s t e n   o n   p o r t s   5 0 0 0   a n d   6 0 0 0   l o c a l l y ,   f o r w a r d i n g   d a t a   t o / f r o m   p o r t s   5 0 0 0   a n d   6 0 0 0   i n   a   p o d   s e l e c t e d   b y   t h e   d e p l o y m e n t   k u b e c t l   p o r t - f o r w a r d   d e p l o y m e n t / m y d e p l o y m e n t   5 0 0 0   6 0 0 0   L i s t e n   o n   p o r t   8 4 4 3   l o c a l l y ,   f o r w a r d i n g   t o   t h e   t a r g e t P o r t   o f   t h e   s e r v i c e ' s   p o r t   n a m e d   " h t t p s "   i n   a   p o d   s e l e c t e d   b y   t h e   s e r v i c e   k u b e c t l   p o r t - f o r w a r d   s e r v i c e / m y s e r v i c e   8 4 4 3 : h t t p s   L i s t e n   o n   p o r t   8 8 8 8   l o c a l l y ,   f o r w a r d i n g   t o   5 0 0 0   i n   t h e   p o d   k u b e c t l   p o r t - f o r w a r d   p o d / m y p o d   8 8 8 8 : 5 0 0 0   L i s t e n   o n   p o r t   8 8 8 8   o n   a l l   a d d r e s s e s ,   f o r w a r d i n g   t o   5 0 0 0   i n   t h e   p o d   k u b e c t l   p o r t - f o r w a r d   - - a d d r e s s   0 . 0 . 0 . 0   p o d / m y p o d   8 8 8 8 : 5 0 0 0   L i s t e n   o n   p o r t   8 8 8 8   o n   l o c a l h o s t   a n d   s e l e c t e d   I P ,   f o r w a r d i n g   t o   5 0 0 0   i n   t h e   p o d   k u b e c t l   p o r t - f o r w a r d   - - a d d r e s s   l o c a l h o s t , 1 0 . 1 9 . 2 1 . 2 3   p o d / m y p o d   8 8 8 8 : 5 0 0 0   L i s t e n   o n   a   r a n d o m   p o r t   l o c a l l y ,   f o r w a r d i n g   t o   5 0 0 0   i n   t h e   p o d   k u b e c t l   p o r t - f o r w a r d   p o d / m y p o d   : 5 0 0 0   F o r w a r d   o n e   o r   m o r e   l o c a l   p o r t s   t o


Question: What is Usage?

Answer: $   k u b e c t l   p o r t - f o r w a r d   T Y P E / N A M E   [ o p t i o n s ]   [ L O C A L _ P O R T : ] R E M O T E _ P O R T   [ . . . [ L O C A L _ P O R T _ N : ] R E M O T E _ P O R T _ N ]


Question: What is proxy?

Answer: T o   p r o x y   a l l   o f   t h e   K u b e r n e t e s   A P I   a n d   n o t h i n g   e l s e   k u b e c t l   p r o x y   - - a p i - p r e f i x = /   T o   p r o x y   o n l y   p a r t   o f   t h e   K u b e r n e t e s   A P I   a n d   a l s o   s o m e   s t a t i c   f i l e s   #   Y o u   c a n   g e t   p o d s   i n f o   w i t h   ' c u r l   l o c a l h o s t : 8 0 0 1 / a p i / v 1 / p o d s '   k u b e c t l   p r o x y   - - w w w = / m y / f i l e s   - - w w w - p r e f i x = / s t a t i c /   - - a p i - p r e f i x = / a p i /   T o   p r o x y   t h e   e n t i r e   K u b e r n e t e s   A P I   a t   a   d i f f e r e n t   r o o t   #   Y o u   c a n   g e t   p o d s   i n f o   w i t h   ' c u r l   l o c a l h o s t : 8 0 0 1 / c u s t o m / a p i / v 1 / p o d s '   k u b e c t l   p r o x y   - - a p i - p r e f i x = / c u s t o m /   R u n   a   p r o x y   t o   t h e   K u b e r n e t e s   A P I   s e r v e r   o n   p o r t   8 0 1 1 ,   s e r v i n g   s t a t i c   c o n t e n t   f r o m   . / l o c a l / w w w /   k u b e c t l   p r o x y   - - p o r t = 8 0 1 1   - - w w w = . / l o c a l / w w w /   R u n   a   p r o x y   t o   t h e   K u b e r n e t e s   A P I   s e r v e r   o n   a n   a r b i t r a r y   l o c a l   p o r t   #   T h e   c h o s e n   p o r t   f o r   t h e   s e r v e r   w i l l   b e   o u t p u t   t o   s t d o u t   k u b e c t l   p r o x y   - - p o r t = 0   R u n   a   p r o x y   t o   t h e   K u b e r n e t e s   A P I   s e r v e r ,   c h a n g i n g   t h e   A P I   p r e f i x   t o   k 8 s - a p i   #   T h i s   m a k e s   e . g .   t h e   p o d s   A P I   a v a i l a b l e   a t   l o c a l h o s t : 8 0 0 1 / k 8 s - a p i / v 1 / p o d s /   k u b e c t l   p r o x y   - - a p i - p r e f i x = / k 8 s - a p i   C r e a t e s   a   p r o x y   s e r v e r   o r   a p p l i c a t i o n - l e v e l   g a t e w a y   b e t w e e n   l o c a l h o s t   a n d   t h e


Question: What is Usage?

Answer: $   k u b e c t l   p r o x y   [ - - p o r t = P O R T ]   [ - - w w w = s t a t i c - d i r ]   [ - - w w w - p r e f i x = p r e f i x ]   [ - - a p i - p r e f i x = p r e f i x ]


Question: What is top?

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


Question: What is Usage?

Answer: $   k u b e c t l   t o p


Question: What is node?

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


Question: What is Usage?

Answer: $   k u b e c t l   t o p   n o d e   [ N A M E   |   - l   l a b e l ]


Question: What is pod?

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


Question: What is Usage?

Answer: $   k u b e c t l   t o p   p o d   [ N A M E   |   - l   l a b e l ]


Question: What is api-versions?

Answer: P r i n t   t h e   s u p p o r t e d   A P I   v e r s i o n s   k u b e c t l   a p i - v e r s i o n s   P r i n t   t h e   s u p p o r t e d   A P I   v e r s i o n s   o n   t h e   s e r v e r ,   i n   t h e   f o r m   o f   " g r o u p / v e r s i o n " .


Question: What is Usage?

Answer: $   k u b e c t l   a p i - v e r s i o n s


Question: What is certificate?

Answer: M o d i f y   c e r t i f i c a t e   r e s o u r c e s .


Question: What is Usage?

Answer: $   k u b e c t l   c e r t i f i c a t e   S U B C O M M A N D


Question: What is approve?

Answer: A p p r o v e   C S R   ' c s r - s q g z p '   k u b e c t l   c e r t i f i c a t e   a p p r o v e   c s r - s q g z p   A p p r o v e   a   c e r t i f i c a t e   s i g n i n g   r e q u e s t .   k u b e c t l   c e r t i f i c a t e   a p p r o v e   a l l o w s   a   c l u s t e r   a d m i n   t o   a p p r o v e   a   c e r t i f i c a t e   s i g n i n g   r e q u e s t   ( C S R ) .   T h i s   a c t i o n   t e l l s   a   c e r t i f i c a t e   s i g n i n g   c o n t r o l l e r   t o   i s s u e   a   c e r t i f i c a t e   t o   t h e   r e q u e s t o r   w i t h   t h e   a t t r i b u t e s   r e q u e s t e d   i n   t h e   C S R .   S E C U R I T Y   N O T I C E :   D e p e n d i n g   o n   t h e   r e q u e s t e d   a t t r i b u t e s ,   t h e   i s s u e d   c e r t i f i c a t e   c a n   p o t e n t i a l l y   g r a n t   a   r e q u e s t e r   a c c e s s   t o   c l u s t e r   r e s o u r c e s   o r   t o   a u t h e n t i c a t e   a s   a   r e q u e s t e d   i d e n t i t y .   B e f o r e   a p p r o v i n g   a   C S R ,   e n s u r e   y o u   u n d e r s t a n d   w h a t   t h e   s i g n e d   c e r t i f i c a t e   c a n   d o .


Question: What is Usage?

Answer: $   k u b e c t l   c e r t i f i c a t e   a p p r o v e   ( - f   F I L E N A M E   |   N A M E )


Question: What is deny?

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


Question: What is Usage?

Answer: $   k u b e c t l   c e r t i f i c a t e   d e n y   ( - f   F I L E N A M E   |   N A M E )


Question: What is cluster-info?

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


Question: What is Usage?

Answer: $   k u b e c t l   c l u s t e r - i n f o


Question: What is dump?

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


Question: What is Usage?

Answer: $   k u b e c t l   c l u s t e r - i n f o   d u m p


Question: What is cordon?

Answer: M a r k   n o d e   " f o o "   a s   u n s c h e d u l a b l e   k u b e c t l   c o r d o n   f o o   M a r k   n o d e   a s   u n s c h e d u l a b l e .


Question: What is Usage?

Answer: $   k u b e c t l   c o r d o n   N O D E


Question: What is drain?

Answer: D r a i n   n o d e   " f o o " ,   e v e n   i f   t h e r e   a r e   p o d s   n o t   m a n a g e d   b y   a   r e p l i c a t i o n   c o n t r o l l e r ,   r e p l i c a   s e t ,   j o b ,   d a e m o n   s e t   o r   s t a t e f u l   s e t   o n   i t   k u b e c t l   d r a i n   f o o   - - f o r c e   A s   a b o v e ,   b u t   a b o r t   i f   t h e r e   a r e   p o d s   n o t   m a n a g e d   b y   a   r e p l i c a t i o n   c o n t r o l l e r ,   r e p l i c a   s e t ,   j o b ,   d a e m o n   s e t   o r   s t a t e f u l   s e t ,   a n d   u s e   a   g r a c e   p e r i o d   o f   1 5   m i n u t e s   k u b e c t l   d r a i n   f o o   - - g r a c e - p e r i o d = 9 0 0   D r a i n   n o d e   i n   p r e p a r a t i o n   f o r   m a i n t e n a n c e .   T h e   g i v e n   n o d e   w i l l   b e   m a r k e d   u n s c h e d u l a b l e   t o   p r e v e n t   n e w   p o d s   f r o m   a r r i v i n g .   ' d r a i n '   e v i c t s   t h e   p o d s   i f   t h e   A P I   s e r v e r   s u p p o r 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 / w o r k l o a d s / p o d s / d i s r u p t i o n s /   .   O t h e r w i s e ,   i t   w i l l   u s e   n o r m a l   D E L E T E   t o   d e l e t e   t h e   p o d s .   T h e   ' d r a i n '   e v i c t s   o r   d e l e t e s   a l l   p o d s   e x c e p t   m i r r o r   p o d s   ( w h i c h   c a n n o t   b e   d e l e t e d   t h r o u g h   t h e   A P I   s e r v e r ) .   I f   t h e r e   a r e   d a e m o n   s e t - m a n a g e d   p o d s ,   d r a i n   w i l l   n o t   p r o c e e d   w i t h o u t   - - i g n o r e - d a e m o n s e t s ,   a n d   r e g a r d l e s s   i t   w i l l   n o t   d e l e t e   a n y   d a e m o n   s e t - m a n a g e d   p o d s ,   b e c a u s e   t h o s e   p o d s   w o u l d   b e   i m m e d i a t e l y   r e p l a c e d   b y   t h e   d a e m o n   s e t   c o n t r o l l e r ,   w h i c h


Question: What is Usage?

Answer: $   k u b e c t l   d r a i n   N O D E


Question: What is taint?

Answer: U p d a t e   n o d e   ' f o o '   w i t h   a   t a i n t   w i t h   k e y   ' d e d i c a t e d '   a n d   v a l u e   ' s p e c i a l - u s e r '   a n d   e f f e c t   ' N o S c h e d u l e '   #   I f   a   t a i n t   w i t h   t h a t   k e y   a n d   e f f e c t   a l r e a d y   e x i s t s ,   i t s   v a l u e   i s   r e p l a c e d   a s   s p e c i f i e d   k u b e c t l   t a i n t   n o d e s   f o o   d e d i c a t e d = s p e c i a l - u s e r : N o S c h e d u l e   R e m o v e   f r o m   n o d e   ' f o o '   t h e   t a i n t   w i t h   k e y   ' d e d i c a t e d '   a n d   e f f e c t   ' N o S c h e d u l e '   i f   o n e   e x i s t s   k u b e c t l   t a i n t   n o d e s   f o o   d e d i c a t e d : N o S c h e d u l e -   R e m o v e   f r o m   n o d e   ' f o o '   a l l   t h e   t a i n t s   w i t h   k e y   ' d e d i c a t e d '   k u b e c t l   t a i n t   n o d e s   f o o   d e d i c a t e d -   A d d   a   t a i n t   w i t h   k e y   ' d e d i c a t e d '   o n   n o d e s   h a v i n g   l a b e l   m y l a b e l = X   k u b e c t l   t a i n t   n o d e   - l   m y L a b e l = X   d e d i c a t e d = f o o : P r e f e r N o S c h e d u l e   A d d   t o   n o d e   ' f o o '   a   t a i n t   w i t h   k e y   ' b a r '   a n d   n o   v a l u e   k u b e c t l   t a i n t   n o d e s   f o o   b a r : N o S c h e d u l e   U p d a t e   t h e   t a i n t s   o n   o n e   o r   m o r e   n o d e s .   A   t a i n t   c o n s i s t s   o f   a   k e y ,   v a l u e ,   a n d   e f f e c t .   A s   a n   a r g u m e n t   h e r e ,   i t   i s   e x p r e s s e d   a s   k e y = v a l u e : e f f e c t .   T h e   k e y   m u s t   b e g i n   w i t h   a   l e t t e r   o r   n u m b e r ,   a n d   m a y   c o n t a i n   l e t t e r s ,   n u m b e r s ,   h y p h e n s ,   d o t s ,   a n d   u n d e r s c o r e s ,   u p   t o   2 5 3   c h a r a c t e r s .   O p t i o n a l l y ,   t h e   k e y   c a n


Question: What is Usage?

Answer: $   k u b e c t l   t a i n t   N O D E   N A M E   K E Y _ 1 = V A L _ 1 : T A I N T _ E F F E C T _ 1   . . .   K E Y _ N = V A L _ N : T A I N T _ E F F E C T _ N


Question: What is uncordon?

Answer: M a r k   n o d e   " f o o "   a s   s c h e d u l a b l e   k u b e c t l   u n c o r d o n   f o o   M a r k   n o d e   a s   s c h e d u l a b l e .


Question: What is Usage?

Answer: $   k u b e c t l   u n c o r d o n   N O D E


Question: What is alpha?

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


Question: What is Usage?

Answer: $   k u b e c t l   a l p h a


Question: What is api-resources?

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


Question: What is Usage?

Answer: $   k u b e c t l   a p i - r e s o u r c e s


Question: What is completion?

Answer: I n s t a l l i n g   b a s h   c o m p l e t i o n   o n   m a c O S   u s i n g   h o m e b r e w   # #   I f   r u n n i n g   B a s h   3 . 2   i n c l u d e d   w i t h   m a c O S   b r e w   i n s t a l l   b a s h - c o m p l e t i o n   o r ,   i f   r u n n i n g   B a s h   4 . 1 +   b r e w   i n s t a l l   b a s h - c o m p l e t i o n @ 2   I f   k u b e c t l   i s   i n s t a l l e d   v i a   h o m e b r e w ,   t h i s   s h o u l d   s t a r t   w o r k i n g   i m m e d i a t e l y   # #   I f   y o u ' v e   i n s t a l l e d   v i a   o t h e r   m e a n s ,   y o u   m a y   n e e d   a d d   t h e   c o m p l e t i o n   t o   y o u r   c o m p l e t i o n   d i r e c t o r y   k u b e c t l   c o m p l e t i o n   b a s h   >   $ ( b r e w   - - p r e f i x ) / e t c / b a s h _ c o m p l e t i o n . d / k u b e c t l   I n s t a l l i n g   b a s h   c o m p l e t i o n   o n   L i n u x   # #   I f   b a s h - c o m p l e t i o n   i s   n o t   i n s t a l l e d   o n   L i n u x ,   i n s t a l l   t h e   ' b a s h - c o m p l e t i o n '   p a c k a g e   # #   v i a   y o u r   d i s t r i b u t i o n ' s   p a c k a g e   m a n a g e r .   # #   L o a d   t h e   k u b e c t l   c o m p l e t i o n   c o d e   f o r   b a s h   i n t o   t h e   c u r r e n t   s h e l l   s o u r c e   < ( k u b e c t l   c o m p l e t i o n   b a s h )   W r i t e   b a s h   c o m p l e t i o n   c o d e   t o   a   f i l e   a n d   s o u r c e   i t   f r o m   . b a s h _ p r o f i l e   k u b e c t l   c o m p l e t i o n   b a s h   >   ~ / . k u b e / c o m p l e t i o n . b a s h . i n c   p r i n t f   "   K u b e c t l   s h e l l   c o m p l e t i o n   s o u r c e   ' $ H O M E / . k u b e / c o m p l e t i o n . b a s h . i n c '   "   > >   $ H O M E / . b a s h _ p r o f i l e   s o u r c e   $ H O M E / . b a s h _ p r o f i l e   L o a d   t h e   k u b e c t l   c o m p l e t i o n   c o d e   f o r   z s h [ 1 ]   i n t o   t h


Question: What is Usage?

Answer: $   k u b e c t l   c o m p l e t i o n   S H E L L


Question: What is config?

Answer: M o d i f y   k u b e c o n f i g   f i l e s   u s i n g   s u b c o m m a n d s   l i k e   " k u b e c t l   c o n f i g   s e t   c u r r e n t - c o n t e x t   m y - c o n t e x t "   T h e   l o a d i n g   o r d e r   f o l l o w s   t h e s e   r u l e s :   I f   t h e   - - k u b e c o n f i g   f l a g   i s   s e t ,   t h e n   o n l y   t h a t   f i l e   i s   l o a d e d .   T h e   f l a g   m a y   o n l y   b e   s e t   o n c e   a n d   n o   m e r g i n g   t a k e s   p l a c e .   I f   $ K U B E C O N F I G   e n v i r o n m e n t   v a r i a b l e   i s   s e t ,   t h e n   i t   i s   u s e d   a s   a   l i s t   o f   p a t h s   ( n o r m a l   p a t h   d e l i m i t i n g   r u l e s   f o r   y o u r   s y s t e m ) .   T h e s e   p a t h s   a r e   m e r g e d .   W h e n   a   v a l u e   i s   m o d i f i e d ,   i t   i s   m o d i f i e d   i n   t h e   f i l e   t h a t   d e f i n e s   t h e   s t a n z a .   W h e n   a   v a l u e   i s   c r e a t e d ,   i t   i s   c r e a t e d   i n   t h e   f i r s t   f i l e   t h a t   e x i s t s .   I f   n o   f i l e s   i n   t h e   c h a i n   e x i s t ,   t h e n   i t   c r e a t e s   t h e   l a s t   f i l e   i n   t h e   l i s t .   O t h e r w i s e ,   $ { H O M E } / . k u b e / c o n f i g   i s   u s e d   a n d   n o   m e r g i n g   t a k e s   p l a c e .


Question: What is Usage?

Answer: $   k u b e c t l   c o n f i g   S U B C O M M A N D


Question: What is current-context?

Answer: D i s p l a y   t h e   c u r r e n t - c o n t e x t   k u b e c t l   c o n f i g   c u r r e n t - c o n t e x t   D i s p l a y   t h e   c u r r e n t - c o n t e x t .


Question: What is Usage?

Answer: $   k u b e c t l   c o n f i g   c u r r e n t - c o n t e x t


Question: What is delete-cluster?

Answer: D e l e t e   t h e   m i n i k u b e   c l u s t e r   k u b e c t l   c o n f i g   d e l e t e - c l u s t e r   m i n i k u b e   D e l e t e   t h e   s p e c i f i e d   c l u s t e r   f r o m   t h e   k u b e c o n f i g .


Question: What is Usage?

Answer: $   k u b e c t l   c o n f i g   d e l e t e - c l u s t e r   N A M E


Question: What is delete-context?

Answer: D e l e t e   t h e   c o n t e x t   f o r   t h e   m i n i k u b e   c l u s t e r   k u b e c t l   c o n f i g   d e l e t e - c o n t e x t   m i n i k u b e   D e l e t e   t h e   s p e c i f i e d   c o n t e x t   f r o m   t h e   k u b e c o n f i g .


Question: What is Usage?

Answer: $   k u b e c t l   c o n f i g   d e l e t e - c o n t e x t   N A M E


Question: What is delete-user?

Answer: D e l e t e   t h e   m i n i k u b e   u s e r   k u b e c t l   c o n f i g   d e l e t e - u s e r   m i n i k u b e   D e l e t e   t h e   s p e c i f i e d   u s e r   f r o m   t h e   k u b e c o n f i g .


Question: What is Usage?

Answer: $   k u b e c t l   c o n f i g   d e l e t e - u s e r   N A M E


Question: What is get-clusters?

Answer: L i s t   t h e   c l u s t e r s   t h a t   k u b e c t l   k n o w s   a b o u t   k u b e c t l   c o n f i g   g e t - c l u s t e r s   D i s p l a y   c l u s t e r s   d e f i n e d   i n   t h e   k u b e c o n f i g .


Question: What is Usage?

Answer: $   k u b e c t l   c o n f i g   g e t - c l u s t e r s


Question: What is get-contexts?

Answer: L i s t   a l l   t h e   c o n t e x t s   i n   y o u r   k u b e c o n f i g   f i l e   k u b e c t l   c o n f i g   g e t - c o n t e x t s   D e s c r i b e   o n e   c o n t e x t   i n   y o u r   k u b e c o n f i g   f i l e   k u b e c t l   c o n f i g   g e t - c o n t e x t s   m y - c o n t e x t   D i s p l a y   o n e   o r   m a n y   c o n t e x t s   f r o m   t h e   k u b e c o n f i g   f i l e .


Question: What is Usage?

Answer: $   k u b e c t l   c o n f i g   g e t - c o n t e x t s   [ ( - o | - - o u t p u t = ) n a m e ) ]


Question: What is get-users?

Answer: L i s t   t h e   u s e r s   t h a t   k u b e c t l   k n o w s   a b o u t   k u b e c t l   c o n f i g   g e t - u s e r s   D i s p l a y   u s e r s   d e f i n e d   i n   t h e   k u b e c o n f i g .


Question: What is Usage?

Answer: $   k u b e c t l   c o n f i g   g e t - u s e r s


Question: What is rename-context?

Answer: R e n a m e   t h e   c o n t e x t   ' o l d - n a m e '   t o   ' n e w - n a m e '   i n   y o u r   k u b e c o n f i g   f i l e   k u b e c t l   c o n f i g   r e n a m e - c o n t e x t   o l d - n a m e   n e w - n a m e   R e n a m e s   a   c o n t e x t   f r o m   t h e   k u b e c o n f i g   f i l e .   C O N T E X T _ N A M E   i s   t h e   c o n t e x t   n a m e   t h a t   y o u   w a n t   t o   c h a n g e .   N E W _ N A M E   i s   t h e   n e w   n a m e   y o u   w a n t   t o   s e t .   N o t e :   I f   t h e   c o n t e x t   b e i n g   r e n a m e d   i s   t h e   ' c u r r e n t - c o n t e x t ' ,   t h i s   f i e l d   w i l l   a l s o   b e   u p d a t e d .


Question: What is Usage?

Answer: $   k u b e c t l   c o n f i g   r e n a m e - c o n t e x t   C O N T E X T _ N A M E   N E W _ N A M E


Question: What is set?

Answer: S e t   t h e   s e r v e r   f i e l d   o n   t h e   m y - c l u s t e r   c l u s t e r   t o   h t t p s : / / 1 . 2 . 3 . 4   k u b e c t l   c o n f i g   s e t   c l u s t e r s . m y - c l u s t e r . s e r v e r   h t t p s : / / 1 . 2 . 3 . 4   S e t   t h e   c e r t i f i c a t e - a u t h o r i t y - d a t a   f i e l d   o n   t h e   m y - c l u s t e r   c l u s t e r   k u b e c t l   c o n f i g   s e t   c l u s t e r s . m y - c l u s t e r . c e r t i f i c a t e - a u t h o r i t y - d a t a   $ ( e c h o   " c e r t _ d a t a _ h e r e "   |   b a s e 6 4   - i   - )   S e t   t h e   c l u s t e r   f i e l d   i n   t h e   m y - c o n t e x t   c o n t e x t   t o   m y - c l u s t e r   k u b e c t l   c o n f i g   s e t   c o n t e x t s . m y - c o n t e x t . c l u s t e r   m y - c l u s t e r   S e t   t h e   c l i e n t - k e y - d a t a   f i e l d   i n   t h e   c l u s t e r - a d m i n   u s e r   u s i n g   - - s e t - r a w - b y t e s   o p t i o n   k u b e c t l   c o n f i g   s e t   u s e r s . c l u s t e r - a d m i n . c l i e n t - k e y - d a t a   c e r t _ d a t a _ h e r e   - - s e t - r a w - b y t e s = t r u e   S e t   a n   i n d i v i d u a l   v a l u e   i n   a   k u b e c o n f i g   f i l e .   P R O P E R T Y _ N A M E   i s   a   d o t   d e l i m i t e d   n a m e   w h e r e   e a c h   t o k e n   r e p r e s e n t s   e i t h e r   a n   a t t r i b u t e   n a m e   o r   a   m a p   k e y .   M a p   k e y s   m a y   n o t   c o n t a i n   d o t s .   P R O P E R T Y _ V A L U E   i s   t h e   n e w   v a l u e   y o u   w a n t   t o   s e t .   B i n a r y   f i e l d s   s u c h   a s   ' c e r t i f i c a t e - a u t h o r i t y - d a t a '   e x p e c t   a   b a s e 6 4   e n c o d e d   s t r i n g   u n l e s s   t h e   - - s e t - r a w - b y t e s   f l a g   i s   u s e d .   S p e c i f y i n g   a n   a t t r i b u t e   n a m e   t h a t   a l r e a d y   e x i s t s   w


Question: What is Usage?

Answer: $   k u b e c t l   c o n f i g   s e t   P R O P E R T Y _ N A M E   P R O P E R T Y _ V A L U E


Question: What is set-cluster?

Answer: S e t   o n l y   t h e   s e r v e r   f i e l d   o n   t h e   e 2 e   c l u s t e r   e n t r y   w i t h o u t   t o u c h i n g   o t h e r   v a l u e s   k u b e c t l   c o n f i g   s e t - c l u s t e r   e 2 e   - - s e r v e r = h t t p s : / / 1 . 2 . 3 . 4   E m b e d   c e r t i f i c a t e   a u t h o r i t y   d a t a   f o r   t h e   e 2 e   c l u s t e r   e n t r y   k u b e c t l   c o n f i g   s e t - c l u s t e r   e 2 e   - - e m b e d - c e r t s   - - c e r t i f i c a t e - a u t h o r i t y = ~ / . k u b e / e 2 e / k u b e r n e t e s . c a . c r t   D i s a b l e   c e r t   c h e c k i n g   f o r   t h e   d e v   c l u s t e r   e n t r y   k u b e c t l   c o n f i g   s e t - c l u s t e r   e 2 e   - - i n s e c u r e - s k i p - t l s - v e r i f y = t r u e   S e t   c u s t o m   T L S   s e r v e r   n a m e   t o   u s e   f o r   v a l i d a t i o n   f o r   t h e   e 2 e   c l u s t e r   e n t r y   k u b e c t l   c o n f i g   s e t - c l u s t e r   e 2 e   - - t l s - s e r v e r - n a m e = m y - c l u s t e r - n a m e   S e t   a   c l u s t e r   e n t r y   i n   k u b e c o n f i g .   S p e c i f y i n g   a   n a m e   t h a t   a l r e a d y   e x i s t s   w i l l   m e r g e   n e w   f i e l d s   o n   t o p   o f   e x i s t i n g   v a l u e s   f o r   t h o s e   f i e l d s .


Question: What is Usage?

Answer: $   k u b e c t l   c o n f i g   s e t - c l u s t e r   N A M E   [ - - s e r v e r = s e r v e r ]   [ - - c e r t i f i c a t e - a u t h o r i t y = p a t h / t o / c e r t i f i c a t e / a u t h o r i t y ]   [ - - i n s e c u r e - s k i p - t l s - v e r i f y = t r u e ]   [ - - t l s - s e r v e r - n a m e = e x a m p l e . c o m ]


Question: What is set-context?

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


Question: What is Usage?

Answer: $   k u b e c t l   c o n f i g   s e t - c o n t e x t   [ N A M E   |   - - c u r r e n t ]   [ - - c l u s t e r = c l u s t e r _ n i c k n a m e ]   [ - - u s e r = u s e r _ n i c k n a m e ]   [ - - n a m e s p a c e = n a m e s p a c e ]


Question: What is set-credentials?

Answer: S e t   o n l y   t h e   " c l i e n t - k e y "   f i e l d   o n   t h e   " c l u s t e r - a d m i n "   #   e n t r y ,   w i t h o u t   t o u c h i n g   o t h e r   v a l u e s   k u b e c t l   c o n f i g   s e t - c r e d e n t i a l s   c l u s t e r - a d m i n   - - c l i e n t - k e y = ~ / . k u b e / a d m i n . k e y   S e t   b a s i c   a u t h   f o r   t h e   " c l u s t e r - a d m i n "   e n t r y   k u b e c t l   c o n f i g   s e t - c r e d e n t i a l s   c l u s t e r - a d m i n   - - u s e r n a m e = a d m i n   - - p a s s w o r d = u X F G w e U 9 l 3 5 q c i f   E m b e d   c l i e n t   c e r t i f i c a t e   d a t a   i n   t h e   " c l u s t e r - a d m i n "   e n t r y   k u b e c t l   c o n f i g   s e t - c r e d e n t i a l s   c l u s t e r - a d m i n   - - c l i e n t - c e r t i f i c a t e = ~ / . k u b e / a d m i n . c r t   - - e m b e d - c e r t s = t r u e   E n a b l e   t h e   G o o g l e   C o m p u t e   P l a t f o r m   a u t h   p r o v i d e r   f o r   t h e   " c l u s t e r - a d m i n "   e n t r y   k u b e c t l   c o n f i g   s e t - c r e d e n t i a l s   c l u s t e r - a d m i n   - - a u t h - p r o v i d e r = g c p   E n a b l e   t h e   O p e n I D   C o n n e c t   a u t h   p r o v i d e r   f o r   t h e   " c l u s t e r - a d m i n "   e n t r y   w i t h   a d d i t i o n a l   a r g s   k u b e c t l   c o n f i g   s e t - c r e d e n t i a l s   c l u s t e r - a d m i n   - - a u t h - p r o v i d e r = o i d c   - - a u t h - p r o v i d e r - a r g = c l i e n t - i d = f o o   - - a u t h - p r o v i d e r - a r g = c l i e n t - s e c r e t = b a r   R e m o v e   t h e   " c l i e n t - s e c r e t "   c o n f i g   v a l u e   f o r   t h e   O p e n I D   C o n n e c t   a u t h   p r o v i d e r   f o r   t h e   " c l u s t e r - a d m i n "   e n t r y   k u b e c t l   c o n f i g   s e t - c r e d e n t i a l s   c l u s t e r - a d m i n   - - a u t h - p r


Question: What is Usage?

Answer: $   k u b e c t l   c o n f i g   s e t - c r e d e n t i a l s   N A M E   [ - - c l i e n t - c e r t i f i c a t e = p a t h / t o / c e r t f i l e ]   [ - - c l i e n t - k e y = p a t h / t o / k e y f i l e ]   [ - - t o k e n = b e a r e r _ t o k e n ]   [ - - u s e r n a m e = b a s i c _ u s e r ]   [ - - p a s s w o r d = b a s i c _ p a s s w o r d ]   [ - - a u t h - p r o v i d e r = p r o v i d e r _ n a m e ]   [ - - a u t h - p r o v i d e r - a r g = k e y = v a l u e ]   [ - - e x e c - c o m m a n d = e x e c _ c o m m a n d ]   [ - - e x e c - a p i - v e r s i o n = e x e c _ a p i _ v e r s i o n ]   [ - - e x e c - a r g = a r g ]   [ - - e x e c - e n v = k e y = v a l u e ]


Question: What is unset?

Answer: U n s e t   t h e   c u r r e n t - c o n t e x t   k u b e c t l   c o n f i g   u n s e t   c u r r e n t - c o n t e x t   U n s e t   n a m e s p a c e   i n   f o o   c o n t e x t   k u b e c t l   c o n f i g   u n s e t   c o n t e x t s . f o o . n a m e s p a c e   U n s e t   a n   i n d i v i d u a l   v a l u e   i n   a   k u b e c o n f i g   f i l e .   P R O P E R T Y _ N A M E   i s   a   d o t   d e l i m i t e d   n a m e   w h e r e   e a c h   t o k e n   r e p r e s e n t s   e i t h e r   a n   a t t r i b u t e   n a m e   o r   a   m a p   k e y .   M a p   k e y s   m a y   n o t   c o n t a i n   d o t s .


Question: What is Usage?

Answer: $   k u b e c t l   c o n f i g   u n s e t   P R O P E R T Y _ N A M E


Question: What is use-context?

Answer: U s e   t h e   c o n t e x t   f o r   t h e   m i n i k u b e   c l u s t e r   k u b e c t l   c o n f i g   u s e - c o n t e x t   m i n i k u b e   S e t   t h e   c u r r e n t - c o n t e x t   i n   a   k u b e c o n f i g   f i l e .


Question: What is Usage?

Answer: $   k u b e c t l   c o n f i g   u s e - c o n t e x t   C O N T E X T _ N A M E


Question: What is view?

Answer: S h o w   m e r g e d   k u b e c o n f i g   s e t t i n g s   k u b e c t l   c o n f i g   v i e w   S h o w   m e r g e d   k u b e c o n f i g   s e t t i n g s   a n d   r a w   c e r t i f i c a t e   d a t a   k u b e c t l   c o n f i g   v i e w   - - r a w   G e t   t h e   p a s s w o r d   f o r   t h e   e 2 e   u s e r   k u b e c t l   c o n f i g   v i e w   - o   j s o n p a t h = ' { . u s e r s [ ? ( @ . n a m e   = =   " e 2 e " ) ] . u s e r . p a s s w o r d } '   D i s p l a y   m e r g e d   k u b e c o n f i g   s e t t i n g s   o r   a   s p e c i f i e d   k u b e c o n f i g   f i l e .   Y o u   c a n   u s e   - - o u t p u t   j s o n p a t h = { . . . }   t o   e x t r a c t   s p e c i f i c   v a l u e s   u s i n g   a   j s o n p a t h   e x p r e s s i o n .


Question: What is Usage?

Answer: $   k u b e c t l   c o n f i g   v i e w


Question: What is explain?

Answer: G e t   t h e   d o c u m e n t a t i o n   o f   t h e   r e s o u r c e   a n d   i t s   f i e l d s   k u b e c t l   e x p l a i n   p o d s   G e t   t h e   d o c u m e n t a t i o n   o f   a   s p e c i f i c   f i e l d   o f   a   r e s o u r c e   k u b e c t l   e x p l a i n   p o d s . s p e c . c o n t a i n e r s   L i s t   t h e   f i e l d s   f o r   s u p p o r t e d   r e s o u r c e s .   T h i s   c o m m a n d   d e s c r i b e s   t h e   f i e l d s   a s s o c i a t e d   w i t h   e a c h   s u p p o r t e d   A P I   r e s o u r c e .   F i e l d s   a r e   i d e n t i f i e d   v i a   a   s i m p l e   J S O N P a t h   i d e n t i f i e r :   < t y p e > . < f i e l d N a m e > [ . < f i e l d N a m e > ]   A d d   t h e   - - r e c u r s i v e   f l a g   t o   d i s p l a y   a l l   o f   t h e   f i e l d s   a t   o n c e   w i t h o u t   d e s c r i p t i o n s .   I n f o r m a t i o n   a b o u t   e a c h   f i e l d   i s   r e t r i e v e d   f r o m   t h e   s e r v e r   i n   O p e n A P I   f o r m a t .   U s e   " k u b e c t l   a p i - r e s o u r c e s "   f o r   a   c o m p l e t e   l i s t   o f   s u p p o r t e d   r e s o u r c e s .


Question: What is Usage?

Answer: $   k u b e c t l   e x p l a i n   R E S O U R C E


Question: What is options?

Answer: P r i n t   f l a g s   i n h e r i t e d   b y   a l l   c o m m a n d s   k u b e c t l   o p t i o n s   P r i n t   t h e   l i s t   o f   f l a g s   i n h e r i t e d   b y   a l l   c o m m a n d s


Question: What is Usage?

Answer: $   k u b e c t l   o p t i o n s


Question: What is plugin?

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


Question: What is Usage?

Answer: $   k u b e c t l   p l u g i n   [ f l a g s ]


Question: What is list?

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


Question: What is Usage?

Answer: $   k u b e c t l   p l u g i n   l i s t


Question: What is version?

Answer: P r i n t   t h e   c l i e n t   a n d   s e r v e r   v e r s i o n s   f o r   t h e   c u r r e n t   c o n t e x t   k u b e c t l   v e r s i o n   P r i n t   t h e   c l i e n t   a n d   s e r v e r   v e r s i o n   i n f o r m a t i o n   f o r   t h e   c u r r e n t   c o n t e x t .


Question: What is Usage?

Answer: $   k u b e c t l   v e r s i o n


Question: What is StatefulSets?

Answer: StatefulSetsA StatefulSet runs a group of Pods, and maintains a sticky identity for each of those Pods. This is useful for managing applications that need persistent storage or a stable, unique network identity.StatefulSet is the workload API object used to manage stateful applications.Manages the deployment and scaling of a set of Pods, and provides guarantees about the ordering and uniqueness of these Pods.Like a Deployment, a StatefulSet manages Pods that are based on an identical container spec. Unlike a Deployment, a StatefulSet maintains a sticky identity for each of its Pods. These pods are created from the same spec, but are not interchangeable: each has a persistent identifier that it maintains across any rescheduling.If you want to use storage volumes to provide persistence for your workload, you can use a StatefulSet as part of the solution. Although individual Pods in a StatefulSet are susceptible to failure, the persistent Pod identifiers make it easier to match existing volumes to the new Pods that replace any that have failed.Using StatefulSetsStatefulSets are valuable for applications that require one or more of the following.Stable, unique network identifiers.Stable, persistent storage.Ordered, graceful deployment and scaling.Ordered, automated rolling updates.In the above, stable is synonymous with persistence across Pod (re)scheduling. If an application doesn't require any stable identifiers or ordered deployment, deletion, or scaling, you should deploy your application using a workload object that provides a set of stateless replicas. Deployment or ReplicaSet may be better suited to your stateless needs.LimitationsThe storage for a given Pod must either be provisioned by a PersistentVolume Provisioner (examples here) based on the requested storage class, or pre-provisioned by an admin.Deleting and/or scaling a StatefulSet down will not delete the volumes associated with the StatefulSet. This is done to ensure data safety, which is generally more valuable than an automatic purge of all related StatefulSet resources.StatefulSets currently require a Headless Service to be responsible for the network identity of the Pods. You are responsible for creating this Service.StatefulSets do not provide any guarantees on the termination of pods when a StatefulSet is deleted. To achieve ordered and graceful termination of the pods in the StatefulSet, it is possible to scale the StatefulSet down to 0 prior to deletion.When using Rolling Updates with the default Pod Management Policy (OrderedReady), it's possible to get into a broken state that requires manual intervention to repair.ComponentsThe example below demonstrates the components of a StatefulSet.apiVersion: v1 kind: Service metadata: name: nginx labels: app: nginx spec: ports: - port: 80 name: web clusterIP: None selector: app: nginx --- apiVersion: apps/v1 kind: StatefulSet metadata: name: web spec: selector: matchLabels: app: nginx # has to match .spec.template.metadata.labels serv


Question: How does StatefulSets work?

Answer: StatefulSetsA StatefulSet runs a group of Pods, and maintains a sticky identity for each of those Pods. This is useful for managing applications that need persistent storage or a stable, unique network identity.StatefulSet is the workload API object used to manage stateful applications.Manages the deployment and scaling of a set of Pods, and provides guarantees about the ordering and uniqueness of these Pods.Like a Deployment, a StatefulSet manages Pods that are based on an identical container spec. Unlike a Deployment, a StatefulSet maintains a sticky identity for each of its Pods. These pods are created from the same spec, but are not interchangeable: each has a persistent identifier that it maintains across any rescheduling.If you want to use storage volumes to provide persistence for your workload, you can use a StatefulSet as part of the solution. Although individual Pods in a StatefulSet are susceptible to failure, the persistent Pod identifiers make it easier to match existing volumes to the new Pods that replace any that have failed.Using StatefulSetsStatefulSets are valuable for applications that require one or more of the following.Stable, unique network identifiers.Stable, persistent storage.Ordered, graceful deployment and scaling.Ordered, automated rolling updates.In the above, stable is synonymous with persistence across Pod (re)scheduling. If an application doesn't require any stable identifiers or ordered deployment, deletion, or scaling, you should deploy your application using a workload object that provides a set of stateless replicas. Deployment or ReplicaSet may be better suited to your stateless needs.LimitationsThe storage for a given Pod must either be provisioned by a PersistentVolume Provisioner (examples here) based on the requested storage class, or pre-provisioned by an admin.Deleting and/or scaling a StatefulSet down will not delete the volumes associated with the StatefulSet. This is done to ensure data safety, which is generally more valuable than an automatic purge of all related StatefulSet resources.StatefulSets currently require a Headless Service to be responsible for the network identity of the Pods. You are responsible for creating this Service.StatefulSets do not provide any guarantees on the termination of pods when a StatefulSet is deleted. To achieve ordered and graceful termination of the pods in the StatefulSet, it is possible to scale the StatefulSet down to 0 prior to deletion.When using Rolling Updates with the default Pod Management Policy (OrderedReady), it's possible to get into a broken state that requires manual intervention to repair.ComponentsThe example below demonstrates the components of a StatefulSet.apiVersion: v1 kind: Service metadata: name: nginx labels: app: nginx spec: ports: - port: 80 name: web clusterIP: None selector: app: nginx --- apiVersion: apps/v1 kind: StatefulSet metadata: name: web spec: selector: matchLabels: app: nginx # has to match .spec.template.metadata.labels serv


Question: When would you use StatefulSets?

Answer: StatefulSetsA StatefulSet runs a group of Pods, and maintains a sticky identity for each of those Pods. This is useful for managing applications that need persistent storage or a stable, unique network identity.StatefulSet is the workload API object used to manage stateful applications.Manages the deployment and scaling of a set of Pods, and provides guarantees about the ordering and uniqueness of these Pods.Like a Deployment, a StatefulSet manages Pods that are based on an identical container spec. Unlike a Deployment, a StatefulSet maintains a sticky identity for each of its Pods. These pods are created from the same spec, but are not interchangeable: each has a persistent identifier that it maintains across any rescheduling.If you want to use storage volumes to provide persistence for your workload, you can use a StatefulSet as part of the solution. Although individual Pods in a StatefulSet are susceptible to failure, the persistent Pod identifiers make it easier to match existing volumes to the new Pods that replace any that have failed.Using StatefulSetsStatefulSets are valuable for applications that require one or more of the following.Stable, unique network identifiers.Stable, persistent storage.Ordered, graceful deployment and scaling.Ordered, automated rolling updates.In the above, stable is synonymous with persistence across Pod (re)scheduling. If an application doesn't require any stable identifiers or ordered deployment, deletion, or scaling, you should deploy your application using a workload object that provides a set of stateless replicas. Deployment or ReplicaSet may be better suited to your stateless needs.LimitationsThe storage for a given Pod must either be provisioned by a PersistentVolume Provisioner (examples here) based on the requested storage class, or pre-provisioned by an admin.Deleting and/or scaling a StatefulSet down will not delete the volumes associated with the StatefulSet. This is done to ensure data safety, which is generally more valuable than an automatic purge of all related StatefulSet resources.StatefulSets currently require a Headless Service to be responsible for the network identity of the Pods. You are responsible for creating this Service.StatefulSets do not provide any guarantees on the termination of pods when a StatefulSet is deleted. To achieve ordered and graceful termination of the pods in the StatefulSet, it is possible to scale the StatefulSet down to 0 prior to deletion.When using Rolling Updates with the default Pod Management Policy (OrderedReady), it's possible to get into a broken state that requires manual intervention to repair.ComponentsThe example below demonstrates the components of a StatefulSet.apiVersion: v1 kind: Service metadata: name: nginx labels: app: nginx spec: ports: - port: 80 name: web clusterIP: None selector: app: nginx --- apiVersion: apps/v1 kind: StatefulSet metadata: name: web spec: selector: matchLabels: app: nginx # has to match .spec.template.metadata.labels serv


Question: What are the benefits of StatefulSets?

Answer: StatefulSetsA StatefulSet runs a group of Pods, and maintains a sticky identity for each of those Pods. This is useful for managing applications that need persistent storage or a stable, unique network identity.StatefulSet is the workload API object used to manage stateful applications.Manages the deployment and scaling of a set of Pods, and provides guarantees about the ordering and uniqueness of these Pods.Like a Deployment, a StatefulSet manages Pods that are based on an identical container spec. Unlike a Deployment, a StatefulSet maintains a sticky identity for each of its Pods. These pods are created from the same spec, but are not interchangeable: each has a persistent identifier that it maintains across any rescheduling.If you want to use storage volumes to provide persistence for your workload, you can use a StatefulSet as part of the solution. Although individual Pods in a StatefulSet are susceptible to failure, the persistent Pod identifiers make it easier to match existing volumes to the new Pods that replace any that have failed.Using StatefulSetsStatefulSets are valuable for applications that require one or more of the following.Stable, unique network identifiers.Stable, persistent storage.Ordered, graceful deployment and scaling.Ordered, automated rolling updates.In the above, stable is synonymous with persistence across Pod (re)scheduling. If an application doesn't require any stable identifiers or ordered deployment, deletion, or scaling, you should deploy your application using a workload object that provides a set of stateless replicas. Deployment or ReplicaSet may be better suited to your stateless needs.LimitationsThe storage for a given Pod must either be provisioned by a PersistentVolume Provisioner (examples here) based on the requested storage class, or pre-provisioned by an admin.Deleting and/or scaling a StatefulSet down will not delete the volumes associated with the StatefulSet. This is done to ensure data safety, which is generally more valuable than an automatic purge of all related StatefulSet resources.StatefulSets currently require a Headless Service to be responsible for the network identity of the Pods. You are responsible for creating this Service.StatefulSets do not provide any guarantees on the termination of pods when a StatefulSet is deleted. To achieve ordered and graceful termination of the pods in the StatefulSet, it is possible to scale the StatefulSet down to 0 prior to deletion.When using Rolling Updates with the default Pod Management Policy (OrderedReady), it's possible to get into a broken state that requires manual intervention to repair.ComponentsThe example below demonstrates the components of a StatefulSet.apiVersion: v1 kind: Service metadata: name: nginx labels: app: nginx spec: ports: - port: 80 name: web clusterIP: None selector: app: nginx --- apiVersion: apps/v1 kind: StatefulSet metadata: name: web spec: selector: matchLabels: app: nginx # has to match .spec.template.metadata.labels serv


Question: What is StatefulSets?

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


Question: What is Using StatefulSets?

Answer: S t a t e f u l S e t s   a r e   v a l u a b l e   f o r   a p p l i c a t i o n s   t h a t   r e q u i r e   o n e   o r   m o r e   o f   t h e   f o l l o w i n g .   S t a b l e ,   u n i q u e   n e t w o r k   i d e n t i f i e r s . S t a b l e ,   p e r s i s t e n t   s t o r a g e . O r d e r e d ,   g r a c e f u l   d e p l o y m e n t   a n d   s c a l i n g . O r d e r e d ,   a u t o m a t e d   r o l l i n g   u p d a t e s .   I n   t h e   a b o v e ,   s t a b l e   i s   s y n o n y m o u s   w i t h   p e r s i s t e n c e   a c r o s s   P o d   ( r e ) s c h e d u l i n g .   I f   a n   a p p l i c a t i o n   d o e s n ' t   r e q u i r e   a n y   s t a b l e   i d e n t i f i e r s   o r   o r d e r e d   d e p l o y m e n t ,   d e l e t i o n ,   o r   s c a l i n g ,   y o u   s h o u l d   d e p l o y   y o u r   a p p l i c a t i o n   u s i n g   a   w o r k l o a d   o b j e c t   t h a t   p r o v i d e s   a   s e t   o f   s t a t e l e s s   r e p l i c a s .   D e p l o y m e n t   o r   R e p l i c a S e t   m a y   b e   b e t t e r   s u i t e d   t o   y o u r   s t a t e l e s s   n e e d s .


Question: What is Limitations?

Answer: T h e   s t o r a g e   f o r   a   g i v e n   P o d   m u s t   e i t h e r   b e   p r o v i s i o n e d   b y   a   P e r s i s t e n t V o l u m e   P r o v i s i o n e r   ( e x a m p l e s   h e r e )   b a s e d   o n   t h e   r e q u e s t e d   s t o r a g e   c l a s s ,   o r   p r e - p r o v i s i o n e d   b y   a n   a d m i n . D e l e t i n g   a n d / o r   s c a l i n g   a   S t a t e f u l S e t   d o w n   w i l l   n o t   d e l e t e   t h e   v o l u m e s   a s s o c i a t e d   w i t h   t h e   S t a t e f u l S e t .   T h i s   i s   d o n e   t o   e n s u r e   d a t a   s a f e t y ,   w h i c h   i s   g e n e r a l l y   m o r e   v a l u a b l e   t h a n   a n   a u t o m a t i c   p u r g e   o f   a l l   r e l a t e d   S t a t e f u l S e t   r e s o u r c e s . S t a t e f u l S e t s   c u r r e n t l y   r e q u i r e   a   H e a d l e s s   S e r v i c e   t o   b e   r e s p o n s i b l e   f o r   t h e   n e t w o r k   i d e n t i t y   o f   t h e   P o d s .   Y o u   a r e   r e s p o n s i b l e   f o r   c r e a t i n g   t h i s   S e r v i c e . S t a t e f u l S e t s   d o   n o t   p r o v i d e   a n y   g u a r a n t e e s   o n   t h e   t e r m i n a t i o n   o f   p o d s   w h e n   a   S t a t e f u l S e t   i s   d e l e t e d .   T o   a c h i e v e   o r d e r e d   a n d   g r a c e f u l   t e r m i n a t i o n   o f   t h e   p o d s   i n   t h e   S t a t e f u l S e t ,   i t   i s   p o s s i b l e   t o   s c a l e   t h e   S t a t e f u l S e t   d o w n   t o   0   p r i o r   t o   d e l e t i o n . W h e n   u s i n g   R o l l i n g   U p d a t e s   w i t h   t h e   d e f a u l t   P o d   M a n a g e m e n t   P o l i c y   ( O r d e r e d R e a d y ) ,   i t ' s   p o s s i b l e   t o   g e t   i n t o   a   b r o k e n   s t a t e   t h a t   r e q u i r e s   m a n u a l   i n t e r v e n t i o n   t o   r e p a i r .


Question: What is Components?

Answer: T h e   e x a m p l e   b e l o w   d e m o n s t r a t e s   t h e   c o m p o n e n t s   o f   a   S t a t e f u l S e t .   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 :   n g i n x   l a b e l s :   a p p :   n g i n x   s p e c :   p o r t s :   -   p o r t :   8 0   n a m e :   w e b   c l u s t e r I P :   N o n e   s e l e c t o r :   a p p :   n g i n x   - - -   a p i V e r s i o n :   a p p s / v 1   k i n d :   S t a t e f u l S e t   m e t a d a t a :   n a m e :   w e b   s p e c :   s e l e c t o r :   m a t c h L a b e l s :   a p p :   n g i n x   #   h a s   t o   m a t c h   . s p e c . t e m p l a t e . m e t a d a t a . l a b e l s   s e r v i c e N a m e :   " n g i n x "   r e p l i c a s :   3   #   b y   d e f a u l t   i s   1   m i n R e a d y S e c o n d s :   1 0   #   b y   d e f a u l t   i s   0   t e m p l a t e :   m e t a d a t a :   l a b e l s :   a p p :   n g i n x   #   h a s   t o   m a t c h   . s p e c . s e l e c t o r . m a t c h L a b e l s   s p e c :   t e r m i n a t i o n G r a c e P e r i o d S e c o n d s :   1 0   c o n t a i n e r s :   -   n a m e :   n g i n x   i m a g e :   r e g i s t r y . k 8 s . i o / n g i n x - s l i m : 0 . 2 4   p o r t s :   -   c o n t a i n e r P o r t :   8 0   n a m e :   w e b   v o l u m e M o u n t s :   -   n a m e :   w w w   m o u n t P a t h :   / u s r / s h a r e / n g i n x / h t m l   v o l u m e C l a i m T e m p l a t e s :   -   m e t a d a t a :   n a m e :   w w w   s p e c :   a c c e s s M o d e s :   [   " R e a d W r i t e O n c e "   ]   s t o r a g e C l a s s N a m e :   " m y - s t o r a g e - c l a s s "   r e s o u r c e s :   r e q u e s t s :   s t o r a g e :   1 G i


Question: What is Note:?

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


Question: What is Pod Selector?

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


Question: What is Volume Claim Templates?

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


Question: What is Minimum ready seconds?

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


Question: What is Pod Identity?

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


Question: What is Ordinal Index?

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


Question: What is Start ordinal?

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


Question: What is Stable Network ID?

Answer: E a c h   P o d   i n   a   S t a t e f u l S e t   d e r i v e s   i t s   h o s t n a m e   f r o m   t h e   n a m e   o f   t h e   S t a t e f u l S e t   a n d   t h e   o r d i n a l   o f   t h e   P o d .   T h e   p a t t e r n   f o r   t h e   c o n s t r u c t e d   h o s t n a m e   i s   $ ( s t a t e f u l s e t   n a m e ) - $ ( o r d i n a l ) .   T h e   e x a m p l e   a b o v e   w i l l   c r e a t e   t h r e e   P o d s   n a m e d   w e b - 0 , w e b - 1 , w e b - 2 .   A   S t a t e f u l S e t   c a n   u s e   a   H e a d l e s s   S e r v i c e   t o   c o n t r o l   t h e   d o m a i n   o f   i t s   P o d s .   T h e   d o m a i n   m a n a g e d   b y   t h i s   S e r v i c e   t a k e s   t h e   f o r m :   $ ( s e r v i c e   n a m e ) . $ ( n a m e s p a c e ) . s v c . c l u s t e r . l o c a l ,   w h e r e   " c l u s t e r . l o c a l "   i s   t h e   c l u s t e r   d o m a i n .   A s   e a c h   P o d   i s   c r e a t e d ,   i t   g e t s   a   m a t c h i n g   D N S   s u b d o m a i n ,   t a k i n g   t h e   f o r m :   $ ( p o d n a m e ) . $ ( g o v e r n i n g   s e r v i c e   d o m a i n ) ,   w h e r e   t h e   g o v e r n i n g   s e r v i c e   i s   d e f i n e d   b y   t h e   s e r v i c e N a m e   f i e l d   o n   t h e   S t a t e f u l S e t .   D e p e n d i n g   o n   h o w   D N S   i s   c o n f i g u r e d   i n   y o u r   c l u s t e r ,   y o u   m a y   n o t   b e   a b l e   t o   l o o k   u p   t h e   D N S   n a m e   f o r   a   n e w l y - r u n   P o d   i m m e d i a t e l y .   T h i s   b e h a v i o r   c a n   o c c u r   w h e n   o t h e r   c l i e n t s   i n   t h e   c l u s t e r   h a v e   a l r e a d y   s e n t   q u e r i e s   f o r   t h e   h o s t n a m e   o f   t h e   P o d   b e f o r e   i t   w a s   c r e a t e d .   N e g a t i v e   c a c h i n g   ( n o r m a l   i n   D N S )   m e a n s   t h a t   t h e   r e s u l t s   o f   p r e v i o u s


Question: What is Stable Storage?

Answer: F o r   e a c h   V o l u m e C l a i m T e m p l a t e   e n t r y   d e f i n e d   i n   a   S t a t e f u l S e t ,   e a c h   P o d   r e c e i v e s   o n e   P e r s i s t e n t V o l u m e C l a i m .   I n   t h e   n g i n x   e x a m p l e   a b o v e ,   e a c h   P o d   r e c e i v e s   a   s i n g l e   P e r s i s t e n t V o l u m e   w i t h   a   S t o r a g e C l a s s   o f   m y - s t o r a g e - c l a s s   a n d   1   G i B   o f   p r o v i s i o n e d   s t o r a g e .   I f   n o   S t o r a g e C l a s s   i s   s p e c i f i e d ,   t h e n   t h e   d e f a u l t   S t o r a g e C l a s s   w i l l   b e   u s e d .   W h e n   a   P o d   i s   ( r e ) s c h e d u l e d   o n t o   a   n o d e ,   i t s   v o l u m e M o u n t s   m o u n t   t h e   P e r s i s t e n t V o l u m e s   a s s o c i a t e d   w i t h   i t s   P e r s i s t e n t V o l u m e   C l a i m s .   N o t e   t h a t ,   t h e   P e r s i s t e n t V o l u m e s   a s s o c i a t e d   w i t h   t h e   P o d s '   P e r s i s t e n t V o l u m e   C l a i m s   a r e   n o t   d e l e t e d   w h e n   t h e   P o d s ,   o r   S t a t e f u l S e t   a r e   d e l e t e d .   T h i s   m u s t   b e   d o n e   m a n u a l l y .


Question: What is Pod Name Label?

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


Question: What is Pod index label?

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


Question: What is Deployment and Scaling Guarantees?

Answer: F o r   a   S t a t e f u l S e t   w i t h   N   r e p l i c a s ,   w h e n   P o d s   a r e   b e i n g   d e p l o y e d ,   t h e y   a r e   c r e a t e d   s e q u e n t i a l l y ,   i n   o r d e r   f r o m   { 0 . . N - 1 } . W h e n   P o d s   a r e   b e i n g   d e l e t e d ,   t h e y   a r e   t e r m i n a t e d   i n   r e v e r s e   o r d e r ,   f r o m   { N - 1 . . 0 } . B e f o r e   a   s c a l i n g   o p e r a t i o n   i s   a p p l i e d   t o   a   P o d ,   a l l   o f   i t s   p r e d e c e s s o r s   m u s t   b e   R u n n i n g   a n d   R e a d y . B e f o r e   a   P o d   i s   t e r m i n a t e d ,   a l l   o f   i t s   s u c c e s s o r s   m u s t   b e   c o m p l e t e l y   s h u t d o w n .   T h e   S t a t e f u l S e t   s h o u l d   n o t   s p e c i f y   a   p o d . S p e c . T e r m i n a t i o n G r a c e P e r i o d S e c o n d s   o f   0 .   T h i s   p r a c t i c e   i s   u n s a f e   a n d   s t r o n g l y   d i s c o u r a g e d .   F o r   f u r t h e r   e x p l a n a t i o n ,   p l e a s e   r e f e r   t o   f o r c e   d e l e t i n g   S t a t e f u l S e t   P o d s .   W h e n   t h e   n g i n x   e x a m p l e   a b o v e   i s   c r e a t e d ,   t h r e e   P o d s   w i l l   b e   d e p l o y e d   i n   t h e   o r d e r   w e b - 0 ,   w e b - 1 ,   w e b - 2 .   w e b - 1   w i l l   n o t   b e   d e p l o y e d   b e f o r e   w e b - 0   i s   R u n n i n g   a n d   R e a d y ,   a n d   w e b - 2   w i l l   n o t   b e   d e p l o y e d   u n t i l   w e b - 1   i s   R u n n i n g   a n d   R e a d y .   I f   w e b - 0   s h o u l d   f a i l ,   a f t e r   w e b - 1   i s   R u n n i n g   a n d   R e a d y ,   b u t   b e f o r e   w e b - 2   i s   l a u n c h e d ,   w e b - 2   w i l l   n o t   b e   l a u n c h e d   u n t i l   w e b - 0   i s   s u c c e s s f u l l y   r e l a u n c h e d   a n d   b e c o m e s   R u n n i n g   a n d   R e a d y .   I f   a


Question: What is Pod Management Policies?

Answer: S t a t e f u l S e t   a l l o w s   y o u   t o   r e l a x   i t s   o r d e r i n g   g u a r a n t e e s   w h i l e   p r e s e r v i n g   i t s   u n i q u e n e s s   a n d   i d e n t i t y   g u a r a n t e e s   v i a   i t s   . s p e c . p o d M a n a g e m e n t P o l i c y   f i e l d .


Question: What is OrderedReady Pod Management?

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


Question: What is Parallel Pod Management?

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


Question: What is Update strategies?

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


Question: What is Rolling Updates?

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


Question: What is Partitioned rolling updates?

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


Question: What is Maximum unavailable Pods?

Answer: Y o u   c a n   c o n t r o l   t h e   m a x i m u m   n u m b e r   o f   P o d s   t h a t   c a n   b e   u n a v a i l a b l e   d u r i n g   a n   u p d a t e   b y   s p e c i f y i n g   t h e   . s p e c . u p d a t e S t r a t e g y . r o l l i n g U p d a t e . m a x U n a v a i l a b l e   f i e l d .   T h e   v a l u e   c a n   b e   a n   a b s o l u t e   n u m b e r   ( f o r   e x a m p l e ,   5 )   o r   a   p e r c e n t a g e   o f   d e s i r e d   P o d s   ( f o r   e x a m p l e ,   1 0 % ) .   A b s o l u t e   n u m b e r   i s   c a l c u l a t e d   f r o m   t h e   p e r c e n t a g e   v a l u e   b y   r o u n d i n g   i t   u p .   T h i s   f i e l d   c a n n o t   b e   0 .   T h e   d e f a u l t   s e t t i n g   i s   1 .   T h i s   f i e l d   a p p l i e s   t o   a l l   P o d s   i n   t h e   r a n g e   0   t o   r e p l i c a s   -   1 .   I f   t h e r e   i s   a n y   u n a v a i l a b l e   P o d   i n   t h e   r a n g e   0   t o   r e p l i c a s   -   1 ,   i t   w i l l   b e   c o u n t e d   t o w a r d s   m a x U n a v a i l a b l e .


Question: What is Forced rollback?

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


Question: What is Revision history?

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


Question: What is How StatefulSets track changes using ControllerRevisions?

Answer: W h e n   y o u   u p d a t e   a   S t a t e f u l S e t ' s   P o d   t e m p l a t e   ( s p e c . t e m p l a t e ) ,   t h e   S t a t e f u l S e t   c o n t r o l l e r :   P r e p a r e s   a   n e w   C o n t r o l l e r R e v i s i o n   o b j e c t S t o r e s   a   s n a p s h o t   o f   t h e   P o d   t e m p l a t e   a n d   m e t a d a t a A s s i g n s   a n   i n c r e m e n t a l   r e v i s i o n   n u m b e r


Question: What is Key Properties?

Answer: C o n t r o l l e r R e v i s i o n   k e y   p r o p e r t i e s   a n d   o t h e r   d e t a i l s   c a n   b e   c h e c k e d   h e r e


Question: What is Managing Revision History?

Answer: C o n t r o l   r e t a i n e d   r e v i s i o n s   w i t h   . s p e c . r e v i s i o n H i s t o r y L i m i t :   a p i V e r s i o n :   a p p s / v 1   k i n d :   S t a t e f u l S e t   m e t a d a t a :   n a m e :   w e b a p p   s p e c :   r e v i s i o n H i s t o r y L i m i t :   5   #   K e e p   l a s t   5   r e v i s i o n s   #   . . .   o t h e r   s p e c   f i e l d s   . . .   D e f a u l t :   1 0   r e v i s i o n s   r e t a i n e d   i f   u n s p e c i f i e d C l e a n u p :   O l d e s t   r e v i s i o n s   a r e   g a r b a g e - c o l l e c t e d   w h e n   e x c e e d i n g   t h e   l i m i t


Question: What is Performing Rollbacks?

Answer: Y o u   c a n   r e v e r t   t o   a   p r e v i o u s   c o n f i g u r a t i o n   u s i n g :   #   V i e w   r e v i s i o n   h i s t o r y   k u b e c t l   r o l l o u t   h i s t o r y   s t a t e f u l s e t / w e b a p p   #   R o l l b a c k   t o   a   s p e c i f i c   r e v i s i o n   k u b e c t l   r o l l o u t   u n d o   s t a t e f u l s e t / w e b a p p   - - t o - r e v i s i o n = 3   T h i s   w i l l :   A p p l y   t h e   P o d   t e m p l a t e   f r o m   r e v i s i o n   3 C r e a t e   a   n e w   C o n t r o l l e r R e v i s i o n   w i t h   a n   u p d a t e d   r e v i s i o n   n u m b e r


Question: What is Inspecting ControllerRevisions?

Answer: T o   v i e w   a s s o c i a t e d   C o n t r o l l e r R e v i s i o n s :   #   L i s t   a l l   r e v i s i o n s   f o r   t h e   S t a t e f u l S e t   k u b e c t l   g e t   c o n t r o l l e r r e v i s i o n s   - l   a p p . k u b e r n e t e s . i o / n a m e = w e b a p p   #   V i e w   d e t a i l e d   c o n f i g u r a t i o n   o f   a   s p e c i f i c   r e v i s i o n   k u b e c t l   g e t   c o n t r o l l e r r e v i s i o n / w e b a p p - 3   - o   y a m l


Question: What is Retention Policy?

Answer: S e t   r e v i s i o n H i s t o r y L i m i t   b e t w e e n   5 – 1 0   f o r   m o s t   w o r k l o a d s I n c r e a s e   o n l y   i f   d e e p   r o l l b a c k   h i s t o r y   i s   r e q u i r e d


Question: What is Monitoring?

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


Question: What is Avoid?

Answer: M a n u a l   e d i t s   t o   C o n t r o l l e r R e v i s i o n   o b j e c t s . U s i n g   r e v i s i o n s   a s   a   b a c k u p   m e c h a n i s m   ( u s e   a c t u a l   b a c k u p   t o o l s ) . S e t t i n g   r e v i s i o n H i s t o r y L i m i t :   0   ( d i s a b l e s   r o l l b a c k   c a p a b i l i t y ) .