Question: What is Note:?

Answer: k u b e c t l   d e l e t e   s e r v i c e   n g i n x   s e r v i c e   " n g i n x "   d e l e t e d   R e c r e a t e   t h e   S t a t e f u l S e t   a n d   h e a d l e s s   S e r v i c e   o n e   m o r e   t i m e :   k u b e c t l   a p p l y   - f   h t t p s : / / k 8 s . i o / e x a m p l e s / a p p l i c a t i o n / w e b / w e b . y a m l   s e r v i c e / n g i n x   c r e a t e d   s t a t e f u l s e t . a p p s / w e b   c r e a t e d   W h e n   a l l   o f   t h e   S t a t e f u l S e t ' s   P o d s   t r a n s i t i o n   t o   R u n n i n g   a n d   R e a d y ,   r e t r i e v e   t h e   c o n t e n t s   o f   t h e i r   i n d e x . h t m l   f i l e s :   f o r   i   i n   0   1 ;   d o   k u b e c t l   e x e c   - i   - t   " w e b - $ i "   - -   c u r l   h t t p : / / l o c a l h o s t / ;   d o n e   w e b - 0   w e b - 1   E v e n   t h o u g h   y o u   c o m p l e t e l y   d e l e t e d   t h e   S t a t e f u l S e t ,   a n d   a l l   o f   i t s   P o d s ,   t h e   P o d s   a r e   r e c r e a t e d   w i t h   t h e i r   P e r s i s t e n t V o l u m e s   m o u n t e d ,   a n d   w e b - 0   a n d   w e b - 1   c o n t i n u e   t o   s e r v e   t h e i r   h o s t n a m e s .   F i n a l l y ,   d e l e t e   t h e   n g i n x   S e r v i c e . . .   k u b e c t l   d e l e t e   s e r v i c e   n g i n x   s e r v i c e   " n g i n x "   d e l e t e d   . . . a n d   t h e   w e b   S t a t e f u l S e t :   k u b e c t l   d e l e t e   s t a t e f u l s e t   w e b   s t a t e f u l s e t   " w e b "   d e l e t e d


Question: What is Pod management policy?

Answer: F o r   s o m e   d i s t r i b u t e d   s y s t e m s ,   t h e   S t a t e f u l S e t   o r d e r i n g   g u a r a n t e e s   a r e   u n n e c e s s a r y   a n d / o r   u n d e s i r a b l e .   T h e s e   s y s t e m s   r e q u i r e   o n l y   u n i q u e n e s s   a n d   i d e n t i t y .   Y o u   c a n   s p e c i f y   a   P o d   m a n a g e m e n t   p o l i c y   t o   a v o i d   t h i s   s t r i c t   o r d e r i n g ;   e i t h e r   O r d e r e d R e a d y   ( t h e   d e f a u l t ) ,   o r   P a r a l l e l .


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   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   r e s p e c t   t h e   o r d e r i n g   g u a r a n t e e s   d e m o n s t r a t e d   a b o v e .   U s e   t h i s   w h e n   y o u r   a p p l i c a t i o n   r e q u i r e s   o r   e x p e c t s   t h a t   c h a n g e s ,   s u c h   a s   r o l l i n g   o u t   a   n e w   v e r s i o n   o f   y o u r   a p p l i c a t i o n ,   h a p p e n   i n   t h e   s t r i c t   o r d e r   o f   t h e   o r d i n a l   ( p o d   n u m b e r )   t h a t   t h e   S t a t e f u l S e t   p r o v i d e s .   I n   o t h e r   w o r d s ,   i f   y o u   h a v e   P o d s   a p p - 0 ,   a p p - 1   a n d   a p p - 2 ,   K u b e r n e t e s   w i l l   u p d a t e   a p p - 0   f i r s t   a n d   c h e c k   i t .   O n c e   t h e   c h e c k s   a r e   g o o d ,   K u b e r n e t e s   u p d a t e s   a p p - 1   a n d   f i n a l l y   a p p - 2 .   I f   y o u   a d d e d   t w o   m o r e   P o d s ,   K u b e r n e t e s   w o u l d   s e t   u p   a p p - 3   a n d   w a i t   f o r   t h a t   t o   b e c o m e   h e a l t h y   b e f o r e   d e p l o y i n g   a p p - 4 .   B e c a u s e   t h i s   i s   t h e   d e f a u l t   s e t t i n g ,   y o u ' v e   a l r e a d y   p r a c t i s e d   u s i n g   i t .


Question: What is Parallel Pod management?

Answer: T h e   a l t e r n a t i v e ,   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   n o t   t o   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 e   P a r a l l e l   p o d   m a n a g e m e n t   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 ;   K u b e r n e t e s   s t i l l   r o l l s   o u t   c h a n g e s   i n   o r d e r .   F o r   t h i s   t u t o r i a l ,   t h e   a p p l i c a t i o n   i s   v e r y   s i m p l e :   a   w e b s e r v e r   t h a t   t e l l s   y o u   i t s   h o s t n a m e   ( b e c a u s e   t h i s   i s   a   S t a t e f u l S e t ,   t h e   h o s t n a m e   f o r   e a c h   P o d   i s   d i f f e r e n t   a n d   p r e d i c t a b l e ) .   a p i V e r s i o n :   v 1   k i n d :   S e r v i c e   m e t a d a t a :   n a m e :   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 r v i c e N a m e :   " n g i n x "   p o d M a n a g e m e n t P o l i c y :   " P a r a l l e l "   r e p l i c a s :   2   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   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   s p e c :   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


Question: What is Cleaning up?

Answer: Y o u   s h o u l d   h a v e   t w o   t e r m i n a l s   o p e n ,   r e a d y   f o r   y o u   t o   r u n   k u b e c t l   c o m m a n d s   a s   p a r t   o f   c l e a n u p .   k u b e c t l   d e l e t e   s t s   w e b   #   s t s   i s   a n   a b b r e v i a t i o n   f o r   s t a t e f u l s e t   Y o u   c a n   w a t c h   k u b e c t l   g e t   t o   s e e   t h o s e   P o d s   b e i n g   d e l e t e d .   #   e n d   t h e   w a t c h   w h e n   y o u ' v e   s e e n   w h a t   y o u   n e e d   t o   k u b e c t l   g e t   p o d   - l   a p p = n g i n x   - - w a t c h   w e b - 3   1 / 1   T e r m i n a t i n g   0   9 m   w e b - 2   1 / 1   T e r m i n a t i n g   0   9 m   w e b - 3   1 / 1   T e r m i n a t i n g   0   9 m   w e b - 2   1 / 1   T e r m i n a t i n g   0   9 m   w e b - 1   1 / 1   T e r m i n a t i n g   0   4 4 m   w e b - 0   1 / 1   T e r m i n a t i n g   0   4 4 m   w e b - 0   0 / 1   T e r m i n a t i n g   0   4 4 m   w e b - 3   0 / 1   T e r m i n a t i n g   0   9 m   w e b - 2   0 / 1   T e r m i n a t i n g   0   9 m   w e b - 1   0 / 1   T e r m i n a t i n g   0   4 4 m   w e b - 0   0 / 1   T e r m i n a t i n g   0   4 4 m   w e b - 2   0 / 1   T e r m i n a t i n g   0   9 m   w e b - 2   0 / 1   T e r m i n a t i n g   0   9 m   w e b - 2   0 / 1   T e r m i n a t i n g   0   9 m   w e b - 1   0 / 1   T e r m i n a t i n g   0   4 4 m   w e b - 1   0 / 1   T e r m i n a t i n g   0   4 4 m   w e b - 1   0 / 1   T e r m i n a t i n g   0   4 4 m   w e b - 0   0 / 1   T e r m i n a t i n g   0   4 4 m   w e b - 0   0 / 1   T e r m i n a t i n g   0   4 4 m   w e b - 0   0 / 1   T e r m i n a t i n g   0   4 4 m   w e b - 3   0 / 1   T e r m i n a t i n g   0   9 m   w e b - 3   0 / 1   T e r m i n a t i n g   0   9 m   w e b - 3   0 / 1   T e r m i n a t i n g   0   9 m   D u r i n g   d e l e t i o n ,   a   S t a t e f u l S e t   r e m o v e s   a l l   P o d s   c o n c u r r e n t l y ;   i t


Question: What is 2 - Example: Deploying WordPress and MySQL with Persistent Volumes?

Answer: T h i s   t u t o r i a l   s h o w s   y o u   h o w   t o   d e p l o y   a   W o r d P r e s s   s i t e   a n d   a   M y S Q L   d a t a b a s e   u s i n g   M i n i k u b e .   B o t h   a p p l i c a t i o n s   u s e   P e r s i s t e n t V o l u m e s   a n d   P e r s i s t e n t V o l u m e C l a i m s   t o   s t o r e   d a t a .   A   P e r s i s t e n t V o l u m e   ( P V )   i s   a   p i e c e   o f   s t o r a g e   i n   t h e   c l u s t e r   t h a t   h a s   b e e n   m a n u a l l y   p r o v i s i o n e d   b y   a n   a d m i n i s t r a t o r ,   o r   d y n a m i c a l l y   p r o v i s i o n e d   b y   K u b e r n e t e s   u s i n g   a   S t o r a g e C l a s s .   A   P e r s i s t e n t V o l u m e C l a i m   ( P V C )   i s   a   r e q u e s t   f o r   s t o r a g e   b y   a   u s e r   t h a t   c a n   b e   f u l f i l l e d   b y   a   P V .   P e r s i s t e n t V o l u m e s   a n d   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   i n d e p e n d e n t   f r o m   P o d   l i f e c y c l e s   a n d   p r e s e r v e   d a t a   t h r o u g h   r e s t a r t i n g ,   r e s c h e d u l i n g ,   a n d   e v e n   d e l e t i n g   P o d s .


Question: What is Objectives?

Answer: C r e a t e   P e r s i s t e n t V o l u m e C l a i m s   a n d   P e r s i s t e n t V o l u m e s C r e a t e   a   k u s t o m i z a t i o n . y a m l   w i t h a   S e c r e t   g e n e r a t o r M y S Q L   r e s o u r c e   c o n f i g s W o r d P r e s s   r e s o u r c e   c o n f i g s A p p l y   t h e   k u s t o m i z a t i o n   d i r e c t o r y   b y   k u b e c t l   a p p l y   - k   . / C l e a n   u p   a   S e c r e t   g e n e r a t o r M y S Q L   r e s o u r c e   c o n f i g s W o r d P r e s s   r e s o u r c e   c o n f i g s


Question: What is Before you begin?

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


Question: What is Create PersistentVolumeClaims and PersistentVolumes?

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


Question: What is Add a Secret generator?

Answer: A   S e c r e t   i s   a n   o b j e c t   t h a t   s t o r e s   a   p i e c e   o f   s e n s i t i v e   d a t a   l i k e   a   p a s s w o r d   o r   k e y .   S i n c e   1 . 1 4 ,   k u b e c t l   s u p p o r t s   t h e   m a n a g e m e n t   o f   K u b e r n e t e s   o b j e c t s   u s i n g   a   k u s t o m i z a t i o n   f i l e .   Y o u   c a n   c r e a t e   a   S e c r e t   b y   g e n e r a t o r s   i n   k u s t o m i z a t i o n . y a m l .   A d d   a   S e c r e t   g e n e r a t o r   i n   k u s t o m i z a t i o n . y a m l   f r o m   t h e   f o l l o w i n g   c o m m a n d .   Y o u   w i l l   n e e d   t o   r e p l a c e   Y O U R _ P A S S W O R D   w i t h   t h e   p a s s w o r d   y o u   w a n t   t o   u s e .   c a t   < < E O F   > . / k u s t o m i z a t i o n . y a m l   s e c r e t G e n e r a t o r :   -   n a m e :   m y s q l - p a s s   l i t e r a l s :   -   p a s s w o r d = Y O U R _ P A S S W O R D   E O F


Question: What is Add resource configs for MySQL and WordPress?

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


Question: What is Apply and Verify?

Answer: T h e   k u s t o m i z a t i o n . y a m l   c o n t a i n s   a l l   t h e   r e s o u r c e s   f o r   d e p l o y i n g   a   W o r d P r e s s   s i t e   a n d   a   M y S Q L   d a t a b a s e .   Y o u   c a n   a p p l y   t h e   d i r e c t o r y   b y   k u b e c t l   a p p l y   - k   . /   N o w   y o u   c a n   v e r i f y   t h a t   a l l   o b j e c t s   e x i s t .   V e r i f y   t h a t   t h e   S e c r e t   e x i s t s   b y   r u n n i n g   t h e   f o l l o w i n g   c o m m a n d : k u b e c t l   g e t   s e c r e t s   T h e   r e s p o n s e   s h o u l d   b e   l i k e   t h i s : N A M E   T Y P E   D A T A   A G E   m y s q l - p a s s - c 5 7 b b 4 t 7 m f   O p a q u e   1   9 s   V e r i f y   t h a t   a   P e r s i s t e n t V o l u m e   g o t   d y n a m i c a l l y   p r o v i s i o n e d . k u b e c t l   g e t   p v c   N o t e : I t   c a n   t a k e   u p   t o   a   f e w   m i n u t e s   f o r   t h e   P V s   t o   b e   p r o v i s i o n e d   a n d   b o u n d . T h e   r e s p o n s e   s h o u l d   b e   l i k e   t h i s : N A M E   S T A T U S   V O L U M E   C A P A C I T Y   A C C E S S   M O D E S   S T O R A G E C L A S S   A G E   m y s q l - p v - c l a i m   B o u n d   p v c - 8 c b d 7 b 2 e - 4 0 4 4 - 1 1 e 9 - b 2 b b - 4 2 0 1 0 a 8 0 0 0 0 2   2 0 G i   R W O   s t a n d a r d   7 7 s   w p - p v - c l a i m   B o u n d   p v c - 8 c d 0 d f 5 4 - 4 0 4 4 - 1 1 e 9 - b 2 b b - 4 2 0 1 0 a 8 0 0 0 0 2   2 0 G i   R W O   s t a n d a r d   7 7 s   V e r i f y   t h a t   t h e   P o d   i s   r u n n i n g   b y   r u n n i n g   t h e   f o l l o w i n g   c o m m a n d : k u b e c t l   g e t   p o d s   N o t e : I t   c a n   t a k e   u p   t o   a   f e w   m i n u t e s   f o r   t h e   P o d ' s   S t a t u s   t o   b e   R U N N I N G . T h e   r e s p o n s e   s h o u l d   b e   l i k e   t h i s : N A M E   R E A D Y   S T A T U S   R E S T A R T S   A G E   w o r d p r e s s


Question: What is Note:?

Answer: T h e   r e s p o n s e   s h o u l d   b e   l i k e   t h i s :   N A M E   S T A T U S   V O L U M E   C A P A C I T Y   A C C E S S   M O D E S   S T O R A G E C L A S S   A G E   m y s q l - p v - c l a i m   B o u n d   p v c - 8 c b d 7 b 2 e - 4 0 4 4 - 1 1 e 9 - b 2 b b - 4 2 0 1 0 a 8 0 0 0 0 2   2 0 G i   R W O   s t a n d a r d   7 7 s   w p - p v - c l a i m   B o u n d   p v c - 8 c d 0 d f 5 4 - 4 0 4 4 - 1 1 e 9 - b 2 b b - 4 2 0 1 0 a 8 0 0 0 0 2   2 0 G i   R W O   s t a n d a r d   7 7 s   V e r i f y   t h a t   t h e   P o d   i s   r u n n i n g   b y   r u n n i n g   t h e   f o l l o w i n g   c o m m a n d :   k u b e c t l   g e t   p o d s


Question: What is Note:?

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


Question: What is Note:?

Answer: R u n   t h e   f o l l o w i n g   c o m m a n d   t o   g e t   t h e   I P   A d d r e s s   f o r   t h e   W o r d P r e s s   S e r v i c e :   m i n i k u b e   s e r v i c e   w o r d p r e s s   - - u r l   T h e   r e s p o n s e   s h o u l d   b e   l i k e   t h i s :   h t t p : / / 1 . 2 . 3 . 4 : 3 2 4 0 6   C o p y   t h e   I P   a d d r e s s ,   a n d   l o a d   t h e   p a g e   i n   y o u r   b r o w s e r   t o   v i e w   y o u r   s i t e .   Y o u   s h o u l d   s e e   t h e   W o r d P r e s s   s e t   u p   p a g e   s i m i l a r   t o   t h e   f o l l o w i n g   s c r e e n s h o t .


Question: What is Cleaning up?

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


Question: What is What's next?

Answer: L e a r n   m o r e   a b o u t   I n t r o s p e c t i o n   a n d   D e b u g g i n g L e a r n   m o r e   a b o u t   J o b s L e a r n   m o r e   a b o u t   P o r t   F o r w a r d i n g L e a r n   h o w   t o   G e t   a   S h e l l   t o   a   C o n t a i n e r


Question: What is 3 - Example: Deploying Cassandra with a StatefulSet?

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


Question: What is Note:?

Answer: C a s s a n d r a   a n d   K u b e r n e t e s   b o t h   u s e   t h e   t e r m   n o d e   t o   m e a n   a   m e m b e r   o f   a   c l u s t e r .   I n   t h i s   t u t o r i a l ,   t h e   P o d s   t h a t   b e l o n g   t o   t h e   S t a t e f u l S e t   a r e   C a s s a n d r a   n o d e s   a n d   a r e   m e m b e r s   o f   t h e   C a s s a n d r a   c l u s t e r   ( c a l l e d   a   r i n g ) .   W h e n   t h o s e   P o d s   r u n   i n   y o u r   K u b e r n e t e s   c l u s t e r ,   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   s c h e d u l e s   t h o s e   P o d s   o n t o   K u b e r n e t e s   N o d e s .   W h e n   a   C a s s a n d r a   n o d e   s t a r t s ,   i t   u s e s   a   s e e d   l i s t   t o   b o o t s t r a p   d i s c o v e r y   o f   o t h e r   n o d e s   i n   t h e   r i n g .   T h i s   t u t o r i a l   d e p l o y s   a   c u s t o m   C a s s a n d r a   s e e d   p r o v i d e r   t h a t   l e t s   t h e   d a t a b a s e   d i s c o v e r   n e w   C a s s a n d r a   P o d s   a s   t h e y   a p p e a r   i n s i d e   y o u r   K u b e r n e t e s   c l u s t e r .


Question: What is Objectives?

Answer: C r e a t e   a n d   v a l i d a t e   a   C a s s a n d r a   h e a d l e s s   S e r v i c e . U s e   a   S t a t e f u l S e t   t o   c r e a t e   a   C a s s a n d r a   r i n g . V a l i d a t e   t h e   S t a t e f u l S e t . M o d i f y   t h e   S t a t e f u l S e t . D e l e t e   t h e   S t a t e f u l S e t   a n d   i t s   P o d s .


Question: What is Before you begin?

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


Question: What is Caution:?

Answer: M i n i k u b e   d e f a u l t s   t o   2 0 4 8 M B   o f   m e m o r y   a n d   2   C P U .   R u n n i n g   M i n i k u b e   w i t h   t h e   d e f a u l t   r e s o u r c e   c o n f i g u r a t i o n   r e s u l t s   i n   i n s u f f i c i e n t   r e s o u r c e   e r r o r s   d u r i n g   t h i s   t u t o r i a l .   T o   a v o i d   t h e s e   e r r o r s ,   s t a r t   M i n i k u b e   w i t h   t h e   f o l l o w i n g   s e t t i n g s :   m i n i k u b e   s t a r t   - - m e m o r y   5 1 2 0   - - c p u s = 4


Question: What is Creating a headless Service for Cassandra?

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


Question: What is Validating (optional)?

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


Question: What is Using a StatefulSet to create a Cassandra ring?

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


Question: What is Note:?

Answer: 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 :   c a s s a n d r a   l a b e l s :   a p p :   c a s s a n d r a   s p e c :   s e r v i c e N a m e :   c a s s a n d r a   r e p l i c a s :   3   s e l e c t o r :   m a t c h L a b e l s :   a p p :   c a s s a n d r a   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 :   c a s s a n d r a   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 :   5 0 0   c o n t a i n e r s :   -   n a m e :   c a s s a n d r a   i m a g e :   g c r . i o / g o o g l e - s a m p l e s / c a s s a n d r a : v 1 3   i m a g e P u l l P o l i c y :   A l w a y s   p o r t s :   -   c o n t a i n e r P o r t :   7 0 0 0   n a m e :   i n t r a - n o d e   -   c o n t a i n e r P o r t :   7 0 0 1   n a m e :   t l s - i n t r a - n o d e   -   c o n t a i n e r P o r t :   7 1 9 9   n a m e :   j m x   -   c o n t a i n e r P o r t :   9 0 4 2   n a m e :   c q l   r e s o u r c e s :   l i m i t s :   c p u :   " 5 0 0 m "   m e m o r y :   1 G i   r e q u e s t s :   c p u :   " 5 0 0 m "   m e m o r y :   1 G i   s e c u r i t y C o n t e x t :   c a p a b i l i t i e s :   a d d :   -   I P C _ L O C K   l i f e c y c l e :   p r e S t o p :   e x e c :   c o m m a n d :   -   / b i n / s h   -   - c   -   n o d e t o o l   d r a i n   e n v :   -   n a m e :   M A X _ H E A P _ S I Z E   v a l u e :   5 1 2 M   -   n a m e :   H E A P _ N E W S I Z E   v a l u e :   1 0 0 M   -   n a m e :   C A S S A N D R A _ S E E D S   v a l u e :   " c a s s a n d r a - 0 . c a s s a n d r a . d e f a u l t . s v c . c l u s t e r . l o c a l "   -   n a m e :   C A S S A N D R A _ C L U S T E R _ N A M E   v a l u e :   " K 8 D e m o "   -   n a m e :   C A S S A N D R A _ D C   v a l u e :   " D C 1 - K 8 D e m o "   -   n a m e :   C A S S A N D R A _ R A C K   v a l u e :   " R a c k 1 - K 8 D e m o "   -   n a m e :   P O D _ I P   v a l u e F r o


Question: What is Validating the Cassandra StatefulSet?

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


Question: What is Modifying the Cassandra StatefulSet?

Answer: U s e   k u b e c t l   e d i t   t o   m o d i f y   t h e   s i z e   o f   a   C a s s a n d r a   S t a t e f u l S e t .   R u n   t h e   f o l l o w i n g   c o m m a n d : k u b e c t l   e d i t   s t a t e f u l s e t   c a s s a n d r a   T h i s   c o m m a n d   o p e n s   a n   e d i t o r   i n   y o u r   t e r m i n a l .   T h e   l i n e   y o u   n e e d   t o   c h a n g e   i s   t h e   r e p l i c a s   f i e l d .   T h e   f o l l o w i n g   s a m p l e   i s   a n   e x c e r p t   o f   t h e   S t a t e f u l S e t   f i l e : #   P l e a s e   e d i t   t h e   o b j e c t   b e l o w .   L i n e s   b e g i n n i n g   w i t h   a   ' # '   w i l l   b e   i g n o r e d ,   #   a n d   a n   e m p t y   f i l e   w i l l   a b o r t   t h e   e d i t .   I f   a n   e r r o r   o c c u r s   w h i l e   s a v i n g   t h i s   f i l e   w i l l   b e   #   r e o p e n e d   w i t h   t h e   r e l e v a n t   f a i l u r e s .   #   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 :   c r e a t i o n T i m e s t a m p :   2 0 1 6 - 0 8 - 1 3 T 1 8 : 4 0 : 5 8 Z   g e n e r a t i o n :   1   l a b e l s :   a p p :   c a s s a n d r a   n a m e :   c a s s a n d r a   n a m e s p a c e :   d e f a u l t   r e s o u r c e V e r s i o n :   " 3 2 3 "   u i d :   7 a 2 1 9 4 8 3 - 6 1 8 5 - 1 1 e 6 - a 9 1 0 - 4 2 0 1 0 a 8 a 0 f c 0   s p e c :   r e p l i c a s :   3   C h a n g e   t h e   n u m b e r   o f   r e p l i c a s   t o   4 ,   a n d   t h e n   s a v e   t h e   m a n i f e s t . T h e   S t a t e f u l S e t   n o w   s c a l e s   t o   r u n   w i t h   4   P o d s . G e t   t h e   C a s s a n d r a   S t a t e f u l S e t   t o   v e r i f y   y o u r   c h a n g e : k u b e c t l   g e t   s t a t e f u l s e t   c a s s a n d r a   T h e   r e s p o n s e   s h o u l d   b e   s i m i l a r   t o : N A M E   D E S I R E D   C U R R E N T   A G E   c a s s a n d r a   4   4


Question: What is Cleaning up?

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


Question: What is Warning:?

Answer: R u n   t h e   f o l l o w i n g   c o m m a n d s   ( c h a i n e d   t o g e t h e r   i n t o   a   s i n g l e   c o m m a n d )   t o   d e l e t e   e v e r y t h i n g   i n   t h e   C a s s a n d r a   S t a t e f u l S e t : g r a c e = $ ( k u b e c t l   g e t   p o d   c a s s a n d r a - 0   - o = j s o n p a t h = ' { . 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 } ' )   \   & &   k u b e c t l   d e l e t e   s t a t e f u l s e t   - l   a p p = c a s s a n d r a   \   & &   e c h o   " S l e e p i n g   $ { g r a c e }   s e c o n d s "   1 > & 2   \   & &   s l e e p   $ g r a c e   \   & &   k u b e c t l   d e l e t e   p e r s i s t e n t v o l u m e c l a i m   - l   a p p = c a s s a n d r a   R u n   t h e   f o l l o w i n g   c o m m a n d   t o   d e l e t e   t h e   S e r v i c e   y o u   s e t   u p   f o r   C a s s a n d r a : k u b e c t l   d e l e t e   s e r v i c e   - l   a p p = c a s s a n d r a   R u n   t h e   f o l l o w i n g   c o m m a n d s   ( c h a i n e d   t o g e t h e r   i n t o   a   s i n g l e   c o m m a n d )   t o   d e l e t e   e v e r y t h i n g   i n   t h e   C a s s a n d r a   S t a t e f u l S e t :   g r a c e = $ ( k u b e c t l   g e t   p o d   c a s s a n d r a - 0   - o = j s o n p a t h = ' { . 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 } ' )   \   & &   k u b e c t l   d e l e t e   s t a t e f u l s e t   - l   a p p = c a s s a n d r a   \   & &   e c h o   " S l e e p i n g   $ { g r a c e }   s e c o n d s "   1 > & 2   \   & &   s l e e p   $ g r a c e   \   & &   k u b e c t l   d e l e t e   p e r s i s t e n t v o l u m e c l a i m   - l   a p p = c a s s a n d r a   R u n   t h e   f o l l o w i n g   c o m m a n d   t o   d e l e t e   t h e   S e r v i c e   y o u   s e t   u p   f o r   C a s s a n d r a :   k u b e c t l   d e l e t e   s e r v i c e   - l   a p p = c a s s a n d r a


Question: What is Cassandra container environment variables?

Answer: T h e   P o d s   i n   t h i s   t u t o r i a l   u s e   t h e   g c r . i o / g o o g l e - s a m p l e s / c a s s a n d r a : v 1 3   i m a g e   f r o m   G o o g l e ' s   c o n t a i n e r   r e g i s t r y .   T h e   D o c k e r   i m a g e   a b o v e   i s   b a s e d   o n   d e b i a n - b a s e   a n d   i n c l u d e s   O p e n J D K   8 .   T h i s   i m a g e   i n c l u d e s   a   s t a n d a r d   C a s s a n d r a   i n s t a l l a t i o n   f r o m   t h e   A p a c h e   D e b i a n   r e p o .   B y   u s i n g   e n v i r o n m e n t   v a r i a b l e s   y o u   c a n   c h a n g e   v a l u e s   t h a t   a r e   i n s e r t e d   i n t o   c a s s a n d r a . y a m l .


Question: What is What's next?

Answer: L e a r n   h o w   t o   S c a l e   a   S t a t e f u l S e t . L e a r n   m o r e   a b o u t   t h e   K u b e r n e t e s S e e d P r o v i d e r S e e   m o r e   c u s t o m   S e e d   P r o v i d e r   C o n f i g u r a t i o n s


Question: What is 4 - Running ZooKeeper, A Distributed System Coordinator?

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


Question: What is Before you begin?

Answer: B e f o r e   s t a r t i n g   t h i s   t u t o r i a l ,   y o u   s h o u l d   b e   f a m i l i a r   w i t h   t h e   f o l l o w i n g   K u b e r n e t e s   c o n c e p t s :   P o d s C l u s t e r   D N S H e a d l e s s   S e r v i c e s P e r s i s t e n t V o l u m e s 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 i n g S t a t e f u l S e t s P o d D i s r u p t i o n B u d g e t s P o d A n t i A f f i n i t y k u b e c t l   C L I   Y o u   m u s t   h a v e   a   c l u s t e r   w i t h   a t   l e a s t   f o u r   n o d e s ,   a n d   e a c h   n o d e   r e q u i r e s   a t   l e a s t   2   C P U s   a n d   4   G i B   o f   m e m o r y .   I n   t h i s   t u t o r i a l   y o u   w i l l   c o r d o n   a n d   d r a i n   t h e   c l u s t e r ' s   n o d e s .   T h i s   m e a n s   t h a t   t h e   c l u s t e r   w i l l   t e r m i n a t e   a n d   e v i c t   a l l   P o d s   o n   i t s   n o d e s ,   a n d   t h e   n o d e s   w i l l   t e m p o r a r i l y   b e c o m e   u n s c h e d u l a b l e .   Y o u   s h o u l d   u s e   a   d e d i c a t e d   c l u s t e r   f o r   t h i s   t u t o r i a l ,   o r   y o u   s h o u l d   e n s u r e   t h a t   t h e   d i s r u p t i o n   y o u   c a u s e   w i l l   n o t   i n t e r f e r e   w i t h   o t h e r   t e n a n t s .   T h i s   t u t o r i a l   a s s u m e s   t h a t   y o u   h a v e   c o n f i g u r e d   y o u r   c l u s t e r   t o   d y n a m i c a l l y   p r o v i s i o n   P e r s i s t e n t V o l u m e s .   I f   y o u r   c l u s t e r   i s   n o t   c o n f i g u r e d   t o   d o   s o ,   y o u   w i l l   h a v e   t o   m a n u a l l y   p r o v i s i o n   t h r e e   2 0   G i B   v o l u m e s   b e f o r e   s t a r t i n g   t h i s   t u t o r i a l .


Question: What is Objectives?

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


Question: What is ZooKeeper?

Answer: A p a c h e   Z o o K e e p e r   i s   a   d i s t r i b u t e d ,   o p e n - s o u r c e   c o o r d i n a t i o n   s e r v i c e   f o r   d i s t r i b u t e d   a p p l i c a t i o n s .   Z o o K e e p e r   a l l o w s   y o u   t o   r e a d ,   w r i t e ,   a n d   o b s e r v e   u p d a t e s   t o   d a t a .   D a t a   a r e   o r g a n i z e d   i n   a   f i l e   s y s t e m   l i k e   h i e r a r c h y   a n d   r e p l i c a t e d   t o   a l l   Z o o K e e p e r   s e r v e r s   i n   t h e   e n s e m b l e   ( a   s e t   o f   Z o o K e e p e r   s e r v e r s ) .   A l l   o p e r a t i o n s   o n   d a t a   a r e   a t o m i c   a n d   s e q u e n t i a l l y   c o n s i s t e n t .   Z o o K e e p e r   e n s u r e s   t h i s   b y   u s i n g   t h e   Z a b   c o n s e n s u s   p r o t o c o l   t o   r e p l i c a t e   a   s t a t e   m a c h i n e   a c r o s s   a l l   s e r v e r s   i n   t h e   e n s e m b l e .   T h e   e n s e m b l e   u s e s   t h e   Z a b   p r o t o c o l   t o   e l e c t   a   l e a d e r ,   a n d   t h e   e n s e m b l e   c a n n o t   w r i t e   d a t a   u n t i l   t h a t   e l e c t i o n   i s   c o m p l e t e .   O n c e   c o m p l e t e ,   t h e   e n s e m b l e   u s e s   Z a b   t o   e n s u r e   t h a t   i t   r e p l i c a t e s   a l l   w r i t e s   t o   a   q u o r u m   b e f o r e   i t   a c k n o w l e d g e s   a n d   m a k e s   t h e m   v i s i b l e   t o   c l i e n t s .   W i t h o u t   r e s p e c t   t o   w e i g h t e d   q u o r u m s ,   a   q u o r u m   i s   a   m a j o r i t y   c o m p o n e n t   o f   t h e   e n s e m b l e   c o n t a i n i n g   t h e   c u r r e n t   l e a d e r .   F o r   i n s t a n c e ,   i f   t h e   e n s e m b l e   h a s   t h r e e   s e r v e r s ,   a   c o m p o n e n t   t h a t   c o n t a i n s   t h e   l e a d e r   a n d   o n e   o t h e r   s e r v e r   c o n s t i t u t e s   a   q u o r u


Question: What is Creating a ZooKeeper ensemble?

Answer: T h e   m a n i f e s t   b e l o w   c o n t a i n s   a   H e a d l e s s   S e r v i c e ,   a   S e r v i c e ,   a   P o d D i s r u p t i o n B u d g e t ,   a n d   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 :   z k - h s   l a b e l s :   a p p :   z k   s p e c :   p o r t s :   -   p o r t :   2 8 8 8   n a m e :   s e r v e r   -   p o r t :   3 8 8 8   n a m e :   l e a d e r - e l e c t i o n   c l u s t e r I P :   N o n e   s e l e c t o r :   a p p :   z k   - - -   a p i V e r s i o n :   v 1   k i n d :   S e r v i c e   m e t a d a t a :   n a m e :   z k - c s   l a b e l s :   a p p :   z k   s p e c :   p o r t s :   -   p o r t :   2 1 8 1   n a m e :   c l i e n t   s e l e c t o r :   a p p :   z k   - - -   a p i V e r s i o n :   p o l i c y / v 1   k i n d :   P o d D i s r u p t i o n B u d g e t   m e t a d a t a :   n a m e :   z k - p d 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 :   z k   m a x U n a v a i l a b l e :   1   - - -   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 :   z k   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 :   z k   s e r v i c e N a m e :   z k - h s   r e p l i c a s :   3   u p d a t e S t r a t e g y :   t y p e :   R o l l i n g U p d a t e   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   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 :   z k   s p e c :   a f f i n i t y :   p o d A n t i A f f i n i t y :   r e q u i r e d D u r i n g S c h e d u l i n g I g n o r e d D u r i n g E x e c u t i o n :   -   l a b e l S e l e c t o r :   m a t c h E x p r e s s i o n s :   -   k e y :   " a p p "   o p e r a t o r :   I n   v a l u e s :   -   z k   t o p o l o g y K e y :   " k u b e r n e t e s . i o / h o s t n a m e "   c o n t a i n e r s :   -   n a m e :   k u b e r n e t e s - z o o k e e p


Question: What is Facilitating leader election?

Answer: B e c a u s e   t h e r e   i s   n o   t e r m i n a t i n g   a l g o r i t h m   f o r   e l e c t i n g   a   l e a d e r   i n   a n   a n o n y m o u s   n e t w o r k ,   Z a b   r e q u i r e s   e x p l i c i t   m e m b e r s h i p   c o n f i g u r a t i o n   t o   p e r f o r m   l e a d e r   e l e c t i o n .   E a c h   s e r v e r   i n   t h e   e n s e m b l e   n e e d s   t o   h a v e   a   u n i q u e   i d e n t i f i e r ,   a l l   s e r v e r s   n e e d   t o   k n o w   t h e   g l o b a l   s e t   o f   i d e n t i f i e r s ,   a n d   e a c h   i d e n t i f i e r   n e e d s   t o   b e   a s s o c i a t e d   w i t h   a   n e t w o r k   a d d r e s s .   U s e   k u b e c t l   e x e c   t o   g e t   t h e   h o s t n a m e s   o f   t h e   P o d s   i n   t h e   z k   S t a t e f u l S e t .   f o r   i   i n   0   1   2 ;   d o   k u b e c t l   e x e c   z k - $ i   - -   h o s t n a m e ;   d o n 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 o v i d e s   e a c h   P o d   w i t h   a   u n i q u e   h o s t n a m e   b a s e d   o n   i t s   o r d i n a l   i n d e x .   T h e   h o s t n a m e s   t a k e   t h e   f o r m   o f   < s t a t e f u l s e t   n a m e > - < o r d i n a l   i n d e x > .   B e c a u s e   t h e   r e p l i c a s   f i e l d   o f   t h e   z k   S t a t e f u l S e t   i s   s e t   t o   3 ,   t h e   S e t ' s   c o n t r o l l e r   c r e a t e s   t h r e e   P o d s   w i t h   t h e i r   h o s t n a m e s   s e t   t o   z k - 0 ,   z k - 1 ,   a n d   z k - 2 .   z k - 0   z k - 1   z k - 2   T h e   s e r v e r s   i n   a   Z o o K e e p e r   e n s e m b l e   u s e   n a t u r a l   n u m b e r s   a s   u n i q u e   i d e n t i f i e r s ,   a n d   s t o r e   e a c h   s e r v e r ' s   i d e n t i f i e r   i n   a   f i l e   c a l l e d   m y i d   i n   t h e   s e r v e r ' s   d a t a   d i r e c t o r y .   T o   e x a m i n e   t h e   c o n t e n t s


Question: What is Achieving consensus?

Answer: C o n s e n s u s   p r o t o c o l s   r e q u i r e   t h a t   t h e   i d e n t i f i e r s   o f   e a c h   p a r t i c i p a n t   b e   u n i q u e .   N o   t w o   p a r t i c i p a n t s   i n   t h e   Z a b   p r o t o c o l   s h o u l d   c l a i m   t h e   s a m e   u n i q u e   i d e n t i f i e r .   T h i s   i s   n e c e s s a r y   t o   a l l o w   t h e   p r o c e s s e s   i n   t h e   s y s t e m   t o   a g r e e   o n   w h i c h   p r o c e s s e s   h a v e   c o m m i t t e d   w h i c h   d a t a .   I f   t w o   P o d s   a r e   l a u n c h e d   w i t h   t h e   s a m e   o r d i n a l ,   t w o   Z o o K e e p e r   s e r v e r s   w o u l d   b o t h   i d e n t i f y   t h e m s e l v e s   a s   t h e   s a m e   s e r v e r .   k u b e c t l   g e t   p o d s   - w   - l   a p p = z k   N A M E   R E A D Y   S T A T U S   R E S T A R T S   A G E   z k - 0   0 / 1   P e n d i n g   0   0 s   z k - 0   0 / 1   P e n d i n g   0   0 s   z k - 0   0 / 1   C o n t a i n e r C r e a t i n g   0   0 s   z k - 0   0 / 1   R u n n i n g   0   1 9 s   z k - 0   1 / 1   R u n n i n g   0   4 0 s   z k - 1   0 / 1   P e n d i n g   0   0 s   z k - 1   0 / 1   P e n d i n g   0   0 s   z k - 1   0 / 1   C o n t a i n e r C r e a t i n g   0   0 s   z k - 1   0 / 1   R u n n i n g   0   1 8 s   z k - 1   1 / 1   R u n n i n g   0   4 0 s   z k - 2   0 / 1   P e n d i n g   0   0 s   z k - 2   0 / 1   P e n d i n g   0   0 s   z k - 2   0 / 1   C o n t a i n e r C r e a t i n g   0   0 s   z k - 2   0 / 1   R u n n i n g   0   1 9 s   z k - 2   1 / 1   R u n n i n g   0   4 0 s   T h e   A   r e c o r d s   f o r   e a c h   P o d   a r e   e n t e r e d   w h e n   t h e   P o d   b e c o m e s   R e a d y .   T h e r e f o r e ,   t h e   F Q D N s   o f   t h e   Z o o K e e p e r   s e r v e r s   w i l l   r e s o l v e   t o   a   s i n g l e   e n d p o i n t ,   a n d   t h a t   e n d p o i n t   w i l l   b e   t h e   u n i


Question: What is Sanity testing the ensemble?

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


Question: What is Providing durable storage?

Answer: A s   m e n t i o n e d   i n   t h e   Z o o K e e p e r   B a s i c s   s e c t i o n ,   Z o o K e e p e r   c o m m i t s   a l l   e n t r i e s   t o   a   d u r a b l e   W A L ,   a n d   p e r i o d i c a l l y   w r i t e s   s n a p s h o t s   i n   m e m o r y   s t a t e ,   t o   s t o r a g e   m e d i a .   U s i n g   W A L s   t o   p r o v i d e   d u r a b i l i t y   i s   a   c o m m o n   t e c h n i q u e   f o r   a p p l i c a t i o n s   t h a t   u s e   c o n s e n s u s   p r o t o c o l s   t o   a c h i e v e   a   r e p l i c a t e d   s t a t e   m a c h i n e .   U s e   t h e   k u b e c t l   d e l e t e   c o m m a n d   t o   d e l e t e   t h e   z k   S t a t e f u l S e t .   k u b e c t l   d e l e t e   s t a t e f u l s e t   z k   s t a t e f u l s e t . a p p s   " z k "   d e l e t e d   W a t c h   t h e   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 .   k u b e c t l   g e t   p o d s   - w   - l   a p p = z k   W h e n   z k - 0   i f   f u l l y   t e r m i n a t e d ,   u s e   C T R L - C   t o   t e r m i n a t e   k u b e c t l .   z k - 2   1 / 1   T e r m i n a t i n g   0   9 m   z k - 0   1 / 1   T e r m i n a t i n g   0   1 1 m   z k - 1   1 / 1   T e r m i n a t i n g   0   1 0 m   z k - 2   0 / 1   T e r m i n a t i n g   0   9 m   z k - 2   0 / 1   T e r m i n a t i n g   0   9 m   z k - 2   0 / 1   T e r m i n a t i n g   0   9 m   z k - 1   0 / 1   T e r m i n a t i n g   0   1 0 m   z k - 1   0 / 1   T e r m i n a t i n g   0   1 0 m   z k - 1   0 / 1   T e r m i n a t i n g   0   1 0 m   z k - 0   0 / 1   T e r m i n a t i n g   0   1 1 m   z k - 0   0 / 1   T e r m i n a t i n g   0   1 1 m   z k - 0   0 / 1   T e r m i n a t i n g   0   1 1 m   R e a p p l y   t h e   m a n i f e s t   i n   z o o k e e p e r . y a m l .   k u b e c t l   a p p l y   - f   h t t p s : / / k 8 s . i o / e x a m p l e s / a p p l i c a t i o n / z o o k e e p e r / z o o k e


Question: What is Ensuring consistent configuration?

Answer: A s   n o t e d   i n   t h e   F a c i l i t a t i n g   L e a d e r   E l e c t i o n   a n d   A c h i e v i n g   C o n s e n s u s   s e c t i o n s ,   t h e   s e r v e r s   i n   a   Z o o K e e p e r   e n s e m b l e   r e q u i r e   c o n s i s t e n t   c o n f i g u r a t i o n   t o   e l e c t   a   l e a d e r   a n d   f o r m   a   q u o r u m .   T h e y   a l s o   r e q u i r e   c o n s i s t e n t   c o n f i g u r a t i o n   o f   t h e   Z a b   p r o t o c o l   i n   o r d e r   f o r   t h e   p r o t o c o l   t o   w o r k   c o r r e c t l y   o v e r   a   n e t w o r k .   I n   o u r   e x a m p l e   w e   a c h i e v e   c o n s i s t e n t   c o n f i g u r a t i o n   b y   e m b e d d i n g   t h e   c o n f i g u r a t i o n   d i r e c t l y   i n t o   t h e   m a n i f e s t .   G e t   t h e   z k   S t a t e f u l S e t .   k u b e c t l   g e t   s t s   z k   - o   y a m l   …   c o m m a n d :   -   s h   -   - c   -   " s t a r t - z o o k e e p e r   \   - - s e r v e r s = 3   \   - - d a t a _ d i r = / v a r / l i b / z o o k e e p e r / d a t a   \   - - d a t a _ l o g _ d i r = / v a r / l i b / z o o k e e p e r / d a t a / l o g   \   - - c o n f _ d i r = / o p t / z o o k e e p e r / c o n f   \   - - c l i e n t _ p o r t = 2 1 8 1   \   - - e l e c t i o n _ p o r t = 3 8 8 8   \   - - s e r v e r _ p o r t = 2 8 8 8   \   - - t i c k _ t i m e = 2 0 0 0   \   - - i n i t _ l i m i t = 1 0   \   - - s y n c _ l i m i t = 5   \   - - h e a p = 5 1 2 M   \   - - m a x _ c l i e n t _ c n x n s = 6 0   \   - - s n a p _ r e t a i n _ c o u n t = 3   \   - - p u r g e _ i n t e r v a l = 1 2   \   - - m a x _ s e s s i o n _ t i m e o u t = 4 0 0 0 0   \   - - m i n _ s e s s i o n _ t i m e o u t = 4 0 0 0   \   - - l o g _ l e v e l = I N F O "   …   T h e   c o m m a n d   u s e d   t o   s t a r t   t h e   Z o o K e e p e r   s e r v e r s   p a s s e d   t h e   c o n f i g u r a t i o n   a s   c o


Question: What is Configuring logging?

Answer: O n e   o f   t h e   f i l e s   g e n e r a t e d   b y   t h e   z k G e n C o n f i g . s h   s c r i p t   c o n t r o l s   Z o o K e e p e r ' s   l o g g i n g .   Z o o K e e p e r   u s e s   L o g 4 j ,   a n d ,   b y   d e f a u l t ,   i t   u s e s   a   t i m e   a n d   s i z e   b a s e d   r o l l i n g   f i l e   a p p e n d e r   f o r   i t s   l o g g i n g   c o n f i g u r a t i o n .   U s e   t h e   c o m m a n d   b e l o w   t o   g e t   t h e   l o g g i n g   c o n f i g u r a t i o n   f r o m   o n e   o f   P o d s   i n   t h e   z k   S t a t e f u l S e t .   k u b e c t l   e x e c   z k - 0   c a t   / u s r / e t c / z o o k e e p e r / l o g 4 j . p r o p e r t i e s   T h e   l o g g i n g   c o n f i g u r a t i o n   b e l o w   w i l l   c a u s e   t h e   Z o o K e e p e r   p r o c e s s   t o   w r i t e   a l l   o f   i t s   l o g s   t o   t h e   s t a n d a r d   o u t p u t   f i l e   s t r e a m .   z o o k e e p e r . r o o t . l o g g e r = C O N S O L E   z o o k e e p e r . c o n s o l e . t h r e s h o l d = I N F O   l o g 4 j . r o o t L o g g e r = $ { z o o k e e p e r . r o o t . l o g g e r }   l o g 4 j . a p p e n d e r . C O N S O L E = o r g . a p a c h e . l o g 4 j . C o n s o l e A p p e n d e r   l o g 4 j . a p p e n d e r . C O N S O L E . T h r e s h o l d = $ { z o o k e e p e r . c o n s o l e . t h r e s h o l d }   l o g 4 j . a p p e n d e r . C O N S O L E . l a y o u t = o r g . a p a c h e . l o g 4 j . P a t t e r n L a y o u t   l o g 4 j . a p p e n d e r . C O N S O L E . l a y o u t . C o n v e r s i o n P a t t e r n = % d { I S O 8 6 0 1 }   [ m y i d : % X { m y i d } ]   -   % - 5 p   [ % t : % C { 1 } @ % L ]   -   % m % n   T h i s   i s   t h e   s i m p l e s t   p o s s i b l e   w a y   t o   s a f e l y   l o g   i n s i d e   t h e   c o n t a i n e r .   B e c a u s e   t h e   a p p l i c a t i o n s   w r i t e   l o g s   t o   s t a n d a r d   o u t ,


Question: What is Configuring a non-privileged user?

Answer: T h e   b e s t   p r a c t i c e s   t o   a l l o w   a n   a p p l i c a t i o n   t o   r u n   a s   a   p r i v i l e g e d   u s e r   i n s i d e   o f   a   c o n t a i n e r   a r e   a   m a t t e r   o f   d e b a t e .   I f   y o u r   o r g a n i z a t i o n   r e q u i r e s   t h a t   a p p l i c a t i o n s   r u n   a s   a   n o n - p r i v i l e g e d   u s e r   y o u   c a n   u s e   a   S e c u r i t y C o n t e x t   t o   c o n t r o l   t h e   u s e r   t h a t   t h e   e n t r y   p o i n t   r u n s   a s .   T h e   z k   S t a t e f u l S e t ' s   P o d   t e m p l a t e   c o n t a i n s   a   S e c u r i t y C o n t e x t .   s e c u r i t y C o n t e x t :   r u n A s U s e r :   1 0 0 0   f s G r o u p :   1 0 0 0   I n   t h e   P o d s '   c o n t a i n e r s ,   U I D   1 0 0 0   c o r r e s p o n d s   t o   t h e   z o o k e e p e r   u s e r   a n d   G I D   1 0 0 0   c o r r e s p o n d s   t o   t h e   z o o k e e p e r   g r o u p .   G e t   t h e   Z o o K e e p e r   p r o c e s s   i n f o r m a t i o n   f r o m   t h e   z k - 0   P o d .   k u b e c t l   e x e c   z k - 0   - -   p s   - e l f   A s   t h e   r u n A s U s e r   f i e l d   o f   t h e   s e c u r i t y C o n t e x t   o b j e c t   i s   s e t   t o   1 0 0 0 ,   i n s t e a d   o f   r u n n i n g   a s   r o o t ,   t h e   Z o o K e e p e r   p r o c e s s   r u n s   a s   t h e   z o o k e e p e r   u s e r .   F   S   U I D   P I D   P P I D   C   P R I   N I   A D D R   S Z   W C H A N   S T I M E   T T Y   T I M E   C M D   4   S   z o o k e e p +   1   0   0   8 0   0   -   1 1 2 7   -   2 0 : 4 6   ?   0 0 : 0 0 : 0 0   s h   - c   z k G e n C o n f i g . s h   & &   z k S e r v e r . s h   s t a r t - f o r e g r o u n d   0   S   z o o k e e p +   2 7   1   0   8 0   0   -   1 1 5 5 5 5 6   -   2 0 : 4 6   ?   0 0 : 0 0 : 1 9   / u s r / l i b / j v m / j a v a - 8 - o p e n j d k - a m d 6 4 / b i n / j a v a   - D z o o k e e


Question: What is Managing the ZooKeeper process?

Answer: T h e   Z o o K e e p e r   d o c u m e n t a t i o n   m e n t i o n s   t h a t   " Y o u   w i l l   w a n t   t o   h a v e   a   s u p e r v i s o r y   p r o c e s s   t h a t   m a n a g e s   e a c h   o f   y o u r   Z o o K e e p e r   s e r v e r   p r o c e s s e s   ( J V M ) . "   U t i l i z i n g   a   w a t c h d o g   ( s u p e r v i s o r y   p r o c e s s )   t o   r e s t a r t   f a i l e d   p r o c e s s e s   i n   a   d i s t r i b u t e d   s y s t e m   i s   a   c o m m o n   p a t t e r n .   W h e n   d e p l o y i n g   a n   a p p l i c a t i o n   i n   K u b e r n e t e s ,   r a t h e r   t h a n   u s i n g   a n   e x t e r n a l   u t i l i t y   a s   a   s u p e r v i s o r y   p r o c e s s ,   y o u   s h o u l d   u s e   K u b e r n e t e s   a s   t h e   w a t c h d o g   f o r   y o u r   a p p l i c a t i o n .


Question: What is Updating the ensemble?

Answer: T h e   z k   S t a t e f u l S e t   i s   c o n f i g u r e d   t o   u s e   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 .   Y o u   c a n   u s e   k u b e c t l   p a t c h   t o   u p d a t e   t h e   n u m b e r   o f   c p u s   a l l o c a t e d   t o   t h e   s e r v e r s .   k u b e c t l   p a t c h   s t s   z k   - - t y p e = ' j s o n '   - p = ' [ { " o p " :   " r e p l a c e " ,   " p a t h " :   " / s p e c / t e m p l a t e / s p e c / c o n t a i n e r s / 0 / r e s o u r c e s / r e q u e s t s / c p u " ,   " v a l u e " : " 0 . 3 " } ] '   s t a t e f u l s e t . a p p s / z k   p a t c h e d   U s e   k u b e c t l   r o l l o u t   s t a t u s   t o   w a t c h   t h e   s t a t u s   o f   t h e   u p d a t e .   k u b e c t l   r o l l o u t   s t a t u s   s t s / z k   w a i t i n g   f o r   s t a t e f u l s e t   r o l l i n g   u p d a t e   t o   c o m p l e t e   0   p o d s   a t   r e v i s i o n   z k - 5 d b 4 4 9 9 6 6 4 . . .   W a i t i n g   f o r   1   p o d s   t o   b e   r e a d y . . .   W a i t i n g   f o r   1   p o d s   t o   b e   r e a d y . . .   w a i t i n g   f o r   s t a t e f u l s e t   r o l l i n g   u p d a t e   t o   c o m p l e t e   1   p o d s   a t   r e v i s i o n   z k - 5 d b 4 4 9 9 6 6 4 . . .   W a i t i n g   f o r   1   p o d s   t o   b e   r e a d y . . .   W a i t i n g   f o r   1   p o d s   t o   b e   r e a d y . . .   w a i t i n g   f o r   s t a t e f u l s e t   r o l l i n g   u p d a t e   t o   c o m p l e t e   2   p o d s   a t   r e v i s i o n   z k - 5 d b 4 4 9 9 6 6 4 . . .   W a i t i n g   f o r   1   p o d s   t o   b e   r e a d y . . .   W a i t i n g   f o r   1   p o d s   t o   b e   r e a d y . . .   s t a t e f u l s e t   r o l l i n g   u p d a t e   c o m p l e t e   3   p o d s   a t   r e v i s i o n   z k - 5 d b 4 4 9 9 6 6 4 . . .   T h i s   t e r m i n a t e s   t h e   P o d s ,   o n e   a t   a   t i m e ,   i n   r


Question: What is Handling process failure?

Answer: R e s t a r t   P o l i c i e s   c o n t r o l   h o w   K u b e r n e t e s   h a n d l e s   p r o c e s s   f a i l u r e s   f o r   t h e   e n t r y   p o i n t   o f   t h e   c o n t a i n e r   i n   a   P o d .   F o r   P o d s   i n   a   S t a t e f u l S e t ,   t h e   o n l y   a p p r o p r i a t e   R e s t a r t P o l i c y   i s   A l w a y s ,   a n d   t h i s   i s   t h e   d e f a u l t   v a l u e .   F o r   s t a t e f u l   a p p l i c a t i o n s   y o u   s h o u l d   n e v e r   o v e r r i d e   t h e   d e f a u l t   p o l i c y .   U s e   t h e   f o l l o w i n g   c o m m a n d   t o   e x a m i n e   t h e   p r o c e s s   t r e e   f o r   t h e   Z o o K e e p e r   s e r v e r   r u n n i n g   i n   t h e   z k - 0   P o d .   k u b e c t l   e x e c   z k - 0   - -   p s   - e f   T h e   c o m m a n d   u s e d   a s   t h e   c o n t a i n e r ' s   e n t r y   p o i n t   h a s   P I D   1 ,   a n d   t h e   Z o o K e e p e r   p r o c e s s ,   a   c h i l d   o f   t h e   e n t r y   p o i n t ,   h a s   P I D   2 7 .   U I D   P I D   P P I D   C   S T I M E   T T Y   T I M E   C M D   z o o k e e p +   1   0   0   1 5 : 0 3   ?   0 0 : 0 0 : 0 0   s h   - c   z k G e n C o n f i g . s h   & &   z k S e r v e r . s h   s t a r t - f o r e g r o u n d   z o o k e e p +   2 7   1   0   1 5 : 0 3   ?   0 0 : 0 0 : 0 3   / u s r / l i b / j v m / j a v a - 8 - o p e n j d k - a m d 6 4 / b i n / j a v a   - D z o o k e e p e r . l o g . d i r = / v a r / l o g / z o o k e e p e r   - D z o o k e e p e r . r o o t . l o g g e r = I N F O , C O N S O L E   - c p   / u s r / b i n / . . / b u i l d / c l a s s e s : / u s r / b i n / . . / b u i l d / l i b / * . j a r : / u s r / b i n / . . / s h a r e / z o o k e e p e r / z o o k e e p e r - 3 . 4 . 9 . j a r : / u s r / b i n / . . / s h a r e / z o o k e e p e r / s l f 4 j - l o g 4 j 1 2 - 1 . 6 . 1 . j a r : / u s r / b i n / . . / s h a r e / z o o k e e p


Question: What is Testing for liveness?

Answer: C o n f i g u r i n g   y o u r   a p p l i c a t i o n   t o   r e s t a r t   f a i l e d   p r o c e s s e s   i s   n o t   e n o u g h   t o   k e e p   a   d i s t r i b u t e d   s y s t e m   h e a l t h y .   T h e r e   a r e   s c e n a r i o s   w h e r e   a   s y s t e m ' s   p r o c e s s e s   c a n   b e   b o t h   a l i v e   a n d   u n r e s p o n s i v e ,   o r   o t h e r w i s e   u n h e a l t h y .   Y o u   s h o u l d   u s e   l i v e n e s s   p r o b e s   t o   n o t i f y   K u b e r n e t e s   t h a t   y o u r   a p p l i c a t i o n ' s   p r o c e s s e s   a r e   u n h e a l t h y   a n d   i t   s h o u l d   r e s t a r t   t h e m .   T h e   P o d   t e m p l a t e   f o r   t h e   z k   S t a t e f u l S e t   s p e c i f i e s   a   l i v e n e s s   p r o b e .   l i v e n e s s P r o b e :   e x e c :   c o m m a n d :   -   s h   -   - c   -   " z o o k e e p e r - r e a d y   2 1 8 1 "   i n i t i a l D e l a y S e c o n d s :   1 5   t i m e o u t S e c o n d s :   5   T h e   p r o b e   c a l l s   a   b a s h   s c r i p t   t h a t   u s e s   t h e   Z o o K e e p e r   r u o k   f o u r   l e t t e r   w o r d   t o   t e s t   t h e   s e r v e r ' s   h e a l t h .   O K = $ ( e c h o   r u o k   |   n c   1 2 7 . 0 . 0 . 1   $ 1 )   i f   [   " $ O K "   = =   " i m o k "   ] ;   t h e n   e x i t   0   e l s e   e x i t   1   f i   I n   o n e   t e r m i n a l   w i n d o w ,   u s e   t h e   f o l l o w i n g   c o m m a n d   t o   w a t c h   t h e   P o d s   i n   t h e   z k   S t a t e f u l S e t .   k u b e c t l   g e t   p o d   - w   - l   a p p = z k   I n   a n o t h e r   w i n d o w ,   u s i n g   t h e   f o l l o w i n g   c o m m a n d   t o   d e l e t e   t h e   z o o k e e p e r - r e a d y   s c r i p t   f r o m   t h e   f i l e   s y s t e m   o f   P o d   z k - 0 .   k u b e c t l   e x e c   z k - 0   - -   r m   / o p t / z o o k e e p e r / b i n / z o o k e e p e r -


Question: What is Testing for readiness?

Answer: R e a d i n e s s   i s   n o t   t h e   s a m e   a s   l i v e n e s s .   I f   a   p r o c e s s   i s   a l i v e ,   i t   i s   s c h e d u l e d   a n d   h e a l t h y .   I f   a   p r o c e s s   i s   r e a d y ,   i t   i s   a b l e   t o   p r o c e s s   i n p u t .   L i v e n e s s   i s   a   n e c e s s a r y ,   b u t   n o t   s u f f i c i e n t ,   c o n d i t i o n   f o r   r e a d i n e s s .   T h e r e   a r e   c a s e s ,   p a r t i c u l a r l y   d u r i n g   i n i t i a l i z a t i o n   a n d   t e r m i n a t i o n ,   w h e n   a   p r o c e s s   c a n   b e   a l i v e   b u t   n o t   r e a d y .   I f   y o u   s p e c i f y   a   r e a d i n e s s   p r o b e ,   K u b e r n e t e s   w i l l   e n s u r e   t h a t   y o u r   a p p l i c a t i o n ' s   p r o c e s s e s   w i l l   n o t   r e c e i v e   n e t w o r k   t r a f f i c   u n t i l   t h e i r   r e a d i n e s s   c h e c k s   p a s s .   F o r   a   Z o o K e e p e r   s e r v e r ,   l i v e n e s s   i m p l i e s   r e a d i n e s s .   T h e r e f o r e ,   t h e   r e a d i n e s s   p r o b e   f r o m   t h e   z o o k e e p e r . y a m l   m a n i f e s t   i s   i d e n t i c a l   t o   t h e   l i v e n e s s   p r o b e .   r e a d i n e s s P r o b e :   e x e c :   c o m m a n d :   -   s h   -   - c   -   " z o o k e e p e r - r e a d y   2 1 8 1 "   i n i t i a l D e l a y S e c o n d s :   1 5   t i m e o u t S e c o n d s :   5   E v e n   t h o u g h   t h e   l i v e n e s s   a n d   r e a d i n e s s   p r o b e s   a r e   i d e n t i c a l ,   i t   i s   i m p o r t a n t   t o   s p e c i f y   b o t h .   T h i s   e n s u r e s   t h a t   o n l y   h e a l t h y   s e r v e r s   i n   t h e   Z o o K e e p e r   e n s e m b l e   r e c e i v e   n e t w o r k   t r a f f i c .


Question: What is Tolerating Node failure?

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


Question: What is Surviving maintenance?

Answer: I n   t h i s   s e c t i o n   y o u   w i l l   c o r d o n   a n d   d r a i n   n o d e s .   I f   y o u   a r e   u s i n g   t h i s   t u t o r i a l   o n   a   s h a r e d   c l u s t e r ,   b e   s u r e   t h a t   t h i s   w i l l   n o t   a d v e r s e l y   a f f e c t   o t h e r   t e n a n t s .   T h e   p r e v i o u s   s e c t i o n   s h o w e d   y o u   h o w   t o   s p r e a d   y o u r   P o d s   a c r o s s   n o d e s   t o   s u r v i v e   u n p l a n n e d   n o d e   f a i l u r e s ,   b u t   y o u   a l s o   n e e d   t o   p l a n   f o r   t e m p o r a r y   n o d e   f a i l u r e s   t h a t   o c c u r   d u e   t o   p l a n n e d   m a i n t e n a n c e .   U s e   t h i s   c o m m a n d   t o   g e t   t h e   n o d e s   i n   y o u r   c l u s t e r .   k u b e c t l   g e t   n o d e s   T h i s   t u t o r i a l   a s s u m e s   a   c l u s t e r   w i t h   a t   l e a s t   f o u r   n o d e s .   I f   t h e   c l u s t e r   h a s   m o r e   t h a n   f o u r ,   u s e   k u b e c t l   c o r d o n   t o   c o r d o n   a l l   b u t   f o u r   n o d e s .   C o n s t r a i n i n g   t o   f o u r   n o d e s   w i l l   e n s u r e   K u b e r n e t e s   e n c o u n t e r s   a f f i n i t y   a n d   P o d D i s r u p t i o n B u d g e t   c o n s t r a i n t s   w h e n   s c h e d u l i n g   z o o k e e p e r   P o d s   i n   t h e   f o l l o w i n g   m a i n t e n a n c e   s i m u l a t i o n .   k u b e c t l   c o r d o n   < n o d e - n a m e >   U s e   t h i s   c o m m a n d   t o   g e t   t h e   z k - p d b   P o d D i s r u p t i o n B u d g e t .   k u b e c t l   g e t   p d b   z k - p d b   T h e   m a x - u n a v a i l a b l e   f i e l d   i n d i c a t e s   t o   K u b e r n e t e s   t h a t   a t   m o s t   o n e   P o d   f r o m   z k   S t a t e f u l S e t   c a n   b e   u n a v a i l a b l e   a t   a n y   t i m e .   N A M E   M I N - A V A I L A B L E   M A X - U


Question: What is Cleaning up?

Answer: U s e   k u b e c t l   u n c o r d o n   t o   u n c o r d o n   a l l   t h e   n o d e s   i n   y o u r   c l u s t e r . Y o u   m u s t   d e l e t e   t h e   p e r s i s t e n t   s t o r a g e   m e d i a   f o r   t h e   P e r s i s t e n t V o l u m e s   u s e d   i n   t h i s   t u t o r i a l .   F o l l o w   t h e   n e c e s s a r y   s t e p s ,   b a s e d   o n   y o u r   e n v i r o n m e n t ,   s t o r a g e   c o n f i g u r a t i o n ,   a n d   p r o v i s i o n i n g   m e t h o d ,   t o   e n s u r e   t h a t   a l l   s t o r a g e   i s   r e c l a i m e d .   ©   2 0 2 5   T h e   K u b e r n e t e s   A u t h o r s   |   D o c u m e n t a t i o n   D i s t r i b u t e d   u n d e r   C C   B Y   4 . 0   ©   2 0 2 5   T h e   L i n u x   F o u n d a t i o n   ® .   A l l   r i g h t s   r e s e r v e d .   T h e   L i n u x   F o u n d a t i o n   h a s   r e g i s t e r e d   t r a d e m a r k s   a n d   u s e s   t r a d e m a r k s .   F o r   a   l i s t   o f   t r a d e m a r k s   o f   T h e   L i n u x   F o u n d a t i o n ,   p l e a s e   s e e   o u r   T r a d e m a r k   U s a g e   p a g e   I C P   l i c e n s e :   京 I C P 备 1 7 0 7 4 2 6 6 号 - 3


Question: What is Manage Kubernetes Objects?

Answer: This is the multi-page printable view of this section. Click here to print.Return to the regular view of this page.Manage Kubernetes ObjectsDeclarative and imperative paradigms for interacting with the Kubernetes API.1: Declarative Management of Kubernetes Objects Using Configuration Files2: Declarative Management of Kubernetes Objects Using Kustomize3: Managing Kubernetes Objects Using Imperative Commands4: Imperative Management of Kubernetes Objects Using Configuration Files5: Update API Objects in Place Using kubectl patch6: Migrate Kubernetes Objects Using Storage Version Migration1 - Declarative Management of Kubernetes Objects Using Configuration FilesKubernetes objects can be created, updated, and deleted by storing multiple object configuration files in a directory and using kubectl apply to recursively create and update those objects as needed. This method retains writes made to live objects without merging the changes back into the object configuration files. kubectl diff also gives you a preview of what changes apply will make.Before you beginInstall kubectl.You need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster. It is recommended to run this tutorial on a cluster with at least two nodes that are not acting as control plane hosts. If you do not already have a cluster, you can create one by using minikube or you can use one of these Kubernetes playgrounds:iximiuz LabsKillercodaKodeKloudPlay with KubernetesTo check the version, enter kubectl version.Trade-offsThe kubectl tool supports three kinds of object management:Imperative commandsImperative object configurationDeclarative object configurationSee Kubernetes Object Management for a discussion of the advantages and disadvantage of each kind of object management.OverviewDeclarative object configuration requires a firm understanding of the Kubernetes object definitions and configuration. Read and complete the following documents if you have not already:Managing Kubernetes Objects Using Imperative CommandsImperative Management of Kubernetes Objects Using Configuration FilesFollowing are definitions for terms used in this document:object configuration file / configuration file: A file that defines the configuration for a Kubernetes object. This topic shows how to pass configuration files to kubectl apply. Configuration files are typically stored in source control, such as Git.live object configuration / live configuration: The live configuration values of an object, as observed by the Kubernetes cluster. These are kept in the Kubernetes cluster storage, typically etcd.declarative configuration writer / declarative writer: A person or software component that makes updates to a live object. The live writers referred to in this topic make changes to object configuration files and run kubectl apply to write the changes.How to create objectsUse kubectl apply to create all objects, except those that already exist, defined by


Question: How does Manage Kubernetes Objects work?

Answer: This is the multi-page printable view of this section. Click here to print.Return to the regular view of this page.Manage Kubernetes ObjectsDeclarative and imperative paradigms for interacting with the Kubernetes API.1: Declarative Management of Kubernetes Objects Using Configuration Files2: Declarative Management of Kubernetes Objects Using Kustomize3: Managing Kubernetes Objects Using Imperative Commands4: Imperative Management of Kubernetes Objects Using Configuration Files5: Update API Objects in Place Using kubectl patch6: Migrate Kubernetes Objects Using Storage Version Migration1 - Declarative Management of Kubernetes Objects Using Configuration FilesKubernetes objects can be created, updated, and deleted by storing multiple object configuration files in a directory and using kubectl apply to recursively create and update those objects as needed. This method retains writes made to live objects without merging the changes back into the object configuration files. kubectl diff also gives you a preview of what changes apply will make.Before you beginInstall kubectl.You need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster. It is recommended to run this tutorial on a cluster with at least two nodes that are not acting as control plane hosts. If you do not already have a cluster, you can create one by using minikube or you can use one of these Kubernetes playgrounds:iximiuz LabsKillercodaKodeKloudPlay with KubernetesTo check the version, enter kubectl version.Trade-offsThe kubectl tool supports three kinds of object management:Imperative commandsImperative object configurationDeclarative object configurationSee Kubernetes Object Management for a discussion of the advantages and disadvantage of each kind of object management.OverviewDeclarative object configuration requires a firm understanding of the Kubernetes object definitions and configuration. Read and complete the following documents if you have not already:Managing Kubernetes Objects Using Imperative CommandsImperative Management of Kubernetes Objects Using Configuration FilesFollowing are definitions for terms used in this document:object configuration file / configuration file: A file that defines the configuration for a Kubernetes object. This topic shows how to pass configuration files to kubectl apply. Configuration files are typically stored in source control, such as Git.live object configuration / live configuration: The live configuration values of an object, as observed by the Kubernetes cluster. These are kept in the Kubernetes cluster storage, typically etcd.declarative configuration writer / declarative writer: A person or software component that makes updates to a live object. The live writers referred to in this topic make changes to object configuration files and run kubectl apply to write the changes.How to create objectsUse kubectl apply to create all objects, except those that already exist, defined by


Question: When would you use Manage Kubernetes Objects?

Answer: This is the multi-page printable view of this section. Click here to print.Return to the regular view of this page.Manage Kubernetes ObjectsDeclarative and imperative paradigms for interacting with the Kubernetes API.1: Declarative Management of Kubernetes Objects Using Configuration Files2: Declarative Management of Kubernetes Objects Using Kustomize3: Managing Kubernetes Objects Using Imperative Commands4: Imperative Management of Kubernetes Objects Using Configuration Files5: Update API Objects in Place Using kubectl patch6: Migrate Kubernetes Objects Using Storage Version Migration1 - Declarative Management of Kubernetes Objects Using Configuration FilesKubernetes objects can be created, updated, and deleted by storing multiple object configuration files in a directory and using kubectl apply to recursively create and update those objects as needed. This method retains writes made to live objects without merging the changes back into the object configuration files. kubectl diff also gives you a preview of what changes apply will make.Before you beginInstall kubectl.You need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster. It is recommended to run this tutorial on a cluster with at least two nodes that are not acting as control plane hosts. If you do not already have a cluster, you can create one by using minikube or you can use one of these Kubernetes playgrounds:iximiuz LabsKillercodaKodeKloudPlay with KubernetesTo check the version, enter kubectl version.Trade-offsThe kubectl tool supports three kinds of object management:Imperative commandsImperative object configurationDeclarative object configurationSee Kubernetes Object Management for a discussion of the advantages and disadvantage of each kind of object management.OverviewDeclarative object configuration requires a firm understanding of the Kubernetes object definitions and configuration. Read and complete the following documents if you have not already:Managing Kubernetes Objects Using Imperative CommandsImperative Management of Kubernetes Objects Using Configuration FilesFollowing are definitions for terms used in this document:object configuration file / configuration file: A file that defines the configuration for a Kubernetes object. This topic shows how to pass configuration files to kubectl apply. Configuration files are typically stored in source control, such as Git.live object configuration / live configuration: The live configuration values of an object, as observed by the Kubernetes cluster. These are kept in the Kubernetes cluster storage, typically etcd.declarative configuration writer / declarative writer: A person or software component that makes updates to a live object. The live writers referred to in this topic make changes to object configuration files and run kubectl apply to write the changes.How to create objectsUse kubectl apply to create all objects, except those that already exist, defined by


Question: What are the benefits of Manage Kubernetes Objects?

Answer: This is the multi-page printable view of this section. Click here to print.Return to the regular view of this page.Manage Kubernetes ObjectsDeclarative and imperative paradigms for interacting with the Kubernetes API.1: Declarative Management of Kubernetes Objects Using Configuration Files2: Declarative Management of Kubernetes Objects Using Kustomize3: Managing Kubernetes Objects Using Imperative Commands4: Imperative Management of Kubernetes Objects Using Configuration Files5: Update API Objects in Place Using kubectl patch6: Migrate Kubernetes Objects Using Storage Version Migration1 - Declarative Management of Kubernetes Objects Using Configuration FilesKubernetes objects can be created, updated, and deleted by storing multiple object configuration files in a directory and using kubectl apply to recursively create and update those objects as needed. This method retains writes made to live objects without merging the changes back into the object configuration files. kubectl diff also gives you a preview of what changes apply will make.Before you beginInstall kubectl.You need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster. It is recommended to run this tutorial on a cluster with at least two nodes that are not acting as control plane hosts. If you do not already have a cluster, you can create one by using minikube or you can use one of these Kubernetes playgrounds:iximiuz LabsKillercodaKodeKloudPlay with KubernetesTo check the version, enter kubectl version.Trade-offsThe kubectl tool supports three kinds of object management:Imperative commandsImperative object configurationDeclarative object configurationSee Kubernetes Object Management for a discussion of the advantages and disadvantage of each kind of object management.OverviewDeclarative object configuration requires a firm understanding of the Kubernetes object definitions and configuration. Read and complete the following documents if you have not already:Managing Kubernetes Objects Using Imperative CommandsImperative Management of Kubernetes Objects Using Configuration FilesFollowing are definitions for terms used in this document:object configuration file / configuration file: A file that defines the configuration for a Kubernetes object. This topic shows how to pass configuration files to kubectl apply. Configuration files are typically stored in source control, such as Git.live object configuration / live configuration: The live configuration values of an object, as observed by the Kubernetes cluster. These are kept in the Kubernetes cluster storage, typically etcd.declarative configuration writer / declarative writer: A person or software component that makes updates to a live object. The live writers referred to in this topic make changes to object configuration files and run kubectl apply to write the changes.How to create objectsUse kubectl apply to create all objects, except those that already exist, defined by


Question: What is Manage Kubernetes Objects?

Answer: 1 :   D e c l a r a t i v e   M a n a g e m e n t   o f   K u b e r n e t e s   O b j e c t s   U s i n g   C o n f i g u r a t i o n   F i l e s 2 :   D e c l a r a t i v e   M a n a g e m e n t   o f   K u b e r n e t e s   O b j e c t s   U s i n g   K u s t o m i z e 3 :   M a n a g i n g   K u b e r n e t e s   O b j e c t s   U s i n g   I m p e r a t i v e   C o m m a n d s 4 :   I m p e r a t i v e   M a n a g e m e n t   o f   K u b e r n e t e s   O b j e c t s   U s i n g   C o n f i g u r a t i o n   F i l e s 5 :   U p d a t e   A P I   O b j e c t s   i n   P l a c e   U s i n g   k u b e c t l   p a t c h 6 :   M i g r a t e   K u b e r n e t e s   O b j e c t s   U s i n g   S t o r a g e   V e r s i o n   M i g r a t i o n


Question: What is 1 - Declarative Management of Kubernetes Objects Using Configuration Files?

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


Question: What is Before you begin?

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


Question: What is Trade-offs?

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


Question: What is Overview?

Answer: D e c l a r a t i v e   o b j e c t   c o n f i g u r a t i o n   r e q u i r e s   a   f i r m   u n d e r s t a n d i n g   o f   t h e   K u b e r n e t e s   o b j e c t   d e f i n i t i o n s   a n d   c o n f i g u r a t i o n .   R e a d   a n d   c o m p l e t e   t h e   f o l l o w i n g   d o c u m e n t s   i f   y o u   h a v e   n o t   a l r e a d y :   M a n a g i n g   K u b e r n e t e s   O b j e c t s   U s i n g   I m p e r a t i v e   C o m m a n d s I m p e r a t i v e   M a n a g e m e n t   o f   K u b e r n e t e s   O b j e c t s   U s i n g   C o n f i g u r a t i o n   F i l e s   F o l l o w i n g   a r e   d e f i n i t i o n s   f o r   t e r m s   u s e d   i n   t h i s   d o c u m e n t :   o b j e c t   c o n f i g u r a t i o n   f i l e   /   c o n f i g u r a t i o n   f i l e :   A   f i l e   t h a t   d e f i n e s   t h e   c o n f i g u r a t i o n   f o r   a   K u b e r n e t e s   o b j e c t .   T h i s   t o p i c   s h o w s   h o w   t o   p a s s   c o n f i g u r a t i o n   f i l e s   t o   k u b e c t l   a p p l y .   C o n f i g u r a t i o n   f i l e s   a r e   t y p i c a l l y   s t o r e d   i n   s o u r c e   c o n t r o l ,   s u c h   a s   G i t . l i v e   o b j e c t   c o n f i g u r a t i o n   /   l i v e   c o n f i g u r a t i o n :   T h e   l i v e   c o n f i g u r a t i o n   v a l u e s   o f   a n   o b j e c t ,   a s   o b s e r v e d   b y   t h e   K u b e r n e t e s   c l u s t e r .   T h e s e   a r e   k e p t   i n   t h e   K u b e r n e t e s   c l u s t e r   s t o r a g e ,   t y p i c a l l y   e t c d . d e c l a r a t i v e   c o n f i g u r a t i o n   w r i t e r   /   d e c l a r a t i v e   w r i t e r :   A   p e r s o n   o r   s o f t w a r e   c o m p o n e n t   t h a t   m a k e s   u p d a t e s   t o   a   l i v e   o b j e c t .   T h e   l i v e   w r i t e r s   r e f e r r e d   t o   i n   t h i s   t o p i c   m a k e   c h a n g e s   t o   o b j e


Question: What is How to create objects?

Answer: U s e   k u b e c t l   a p p l y   t o   c r e a t e   a l l   o b j e c t s ,   e x c e p t   t h o s e   t h a t   a l r e a d y   e x i s t ,   d e f i n e d   b y   c o n f i g u r a t i o n   f i l e s   i n   a   s p e c i f i e d   d i r e c t o r y :   k u b e c t l   a p p l y   - f   < d i r e c t o r y >   T h i s   s e t s   t h e   k u b e c t l . k u b e r n e t e s . i o / l a s t - a p p l i e d - c o n f i g u r a t i o n :   ' { . . . } '   a n n o t a t i o n   o n   e a c h   o b j e c t .   T h e   a n n o t a t i o n   c o n t a i n s   t h e   c o n t e n t s   o f   t h e   o b j e c t   c o n f i g u r a t i o n   f i l e   t h a t   w a s   u s e d   t o   c r e a t e   t h e   o b j e c t .


Question: What is Note:?

Answer: H e r e ' s   a n   e x a m p l e   o f   a n   o b j e c t   c o n f i g u r a t i o n   f i l e :   a p i V e r s i o n :   a p p s / v 1   k i n d :   D e p l o y m e n t   m e t a d a t a :   n a m e :   n g i n x - d e p l o y m e n t   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   m i n R e a d y S e c o n d s :   5   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   s p e c :   c o n t a i n e r s :   -   n a m e :   n g i n x   i m a g e :   n g i n x : 1 . 1 4 . 2   p o r t s :   -   c o n t a i n e r P o r t :   8 0   R u n   k u b e c t l   d i f f   t o   p r i n t   t h e   o b j e c t   t h a t   w i l l   b e   c r e a t e d :   k u b e c t l   d i f f   - f   h t t p s : / / k 8 s . i o / e x a m p l e s / a p p l i c a t i o n / s i m p l e _ d e p l o y m e n t . y a m l


Question: What is Note:?

Answer: d i f f   u s e s   s e r v e r - s i d e   d r y - r u n ,   w h i c h   n e e d s   t o   b e   e n a b l e d   o n   k u b e - a p i s e r v e r .   S i n c e   d i f f   p e r f o r m s   a   s e r v e r - s i d e   a p p l y   r e q u e s t   i n   d r y - r u n   m o d e ,   i t   r e q u i r e s   g r a n t i n g   P A T C H ,   C R E A T E ,   a n d   U P D A T E   p e r m i s s i o n s .   S e e   D r y - R u n   A u t h o r i z a t i o n   f o r   d e t a i l s .   C r e a t e   t h e   o b j e c t   u s i n g   k u b e c t l   a p p l y :   k u b e c t l   a p p l y   - f   h t t p s : / / k 8 s . i o / e x a m p l e s / a p p l i c a t i o n / s i m p l e _ d e p l o y m e n t . y a m l   P r i n t   t h e   l i v e   c o n f i g u r a t i o n   u s i n g   k u b e c t l   g e t :   k u b e c t l   g e t   - f   h t t p s : / / k 8 s . i o / e x a m p l e s / a p p l i c a t i o n / s i m p l e _ d e p l o y m e n t . y a m l   - o   y a m l   T h e   o u t p u t   s h o w s   t h a t   t h e   k u b e c t l . k u b e r n e t e s . i o / l a s t - a p p l i e d - c o n f i g u r a t i o n   a n n o t a t i o n   w a s   w r i t t e n   t o   t h e   l i v e   c o n f i g u r a t i o n ,   a n d   i t   m a t c h e s   t h e   c o n f i g u r a t i o n   f i l e :   k i n d :   D e p l o y m e n t   m e t a d a t a :   a n n o t a t i o n s :   #   . . .   #   T h i s   i s   t h e   j s o n   r e p r e s e n t a t i o n   o f   s i m p l e _ d e p l o y m e n t . y a m l   #   I t   w a s   w r i t t e n   b y   k u b e c t l   a p p l y   w h e n   t h e   o b j e c t   w a s   c r e a t e d   k u b e c t l . k u b e r n e t e s . i o / l a s t - a p p l i e d - c o n f i g u r a t i o n :   |   { " a p i V e r s i o n " : " a p p s / v 1 " , " k i n d " : " D e p l o y m e n t " ,   " m e t a d a t a " : { " a n n o t a t i o n s " : { } , " n a m e " : " n g i n x - d e p l o y m e n t " , " n a m e s p a c e " : " d e f a u l t " } ,   " s p e c " :


Question: What is How to update objects?

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


Question: What is Note:?

Answer: H e r e ' s   a n   e x a m p l e   c o n f i g u r a t i o n   f i l e :   a p i V e r s i o n :   a p p s / v 1   k i n d :   D e p l o y m e n t   m e t a d a t a :   n a m e :   n g i n x - d e p l o y m e n t   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   m i n R e a d y S e c o n d s :   5   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   s p e c :   c o n t a i n e r s :   -   n a m e :   n g i n x   i m a g e :   n g i n x : 1 . 1 4 . 2   p o r t s :   -   c o n t a i n e r P o r t :   8 0   C r e a t e   t h e   o b j e c t   u s i n g   k u b e c t l   a p p l y :   k u b e c t l   a p p l y   - f   h t t p s : / / k 8 s . i o / e x a m p l e s / a p p l i c a t i o n / s i m p l e _ d e p l o y m e n t . y a m l


Question: What is Note:?

Answer: P r i n t   t h e   l i v e   c o n f i g u r a t i o n   u s i n g   k u b e c t l   g e t :   k u b e c t l   g e t   - f   h t t p s : / / k 8 s . i o / e x a m p l e s / a p p l i c a t i o n / s i m p l e _ d e p l o y m e n t . y a m l   - o   y a m l   T h e   o u t p u t   s h o w s   t h a t   t h e   k u b e c t l . k u b e r n e t e s . i o / l a s t - a p p l i e d - c o n f i g u r a t i o n   a n n o t a t i o n   w a s   w r i t t e n   t o   t h e   l i v e   c o n f i g u r a t i o n ,   a n d   i t   m a t c h e s   t h e   c o n f i g u r a t i o n   f i l e :   k i n d :   D e p l o y m e n t   m e t a d a t a :   a n n o t a t i o n s :   #   . . .   #   T h i s   i s   t h e   j s o n   r e p r e s e n t a t i o n   o f   s i m p l e _ d e p l o y m e n t . y a m l   #   I t   w a s   w r i t t e n   b y   k u b e c t l   a p p l y   w h e n   t h e   o b j e c t   w a s   c r e a t e d   k u b e c t l . k u b e r n e t e s . i o / l a s t - a p p l i e d - c o n f i g u r a t i o n :   |   { " a p i V e r s i o n " : " a p p s / v 1 " , " k i n d " : " D e p l o y m e n t " ,   " m e t a d a t a " : { " a n n o t a t i o n s " : { } , " n a m e " : " n g i n x - d e p l o y m e n t " , " n a m e s p a c e " : " d e f a u l t " } ,   " s p e c " : { " m i n R e a d y S e c o n d s " : 5 , " 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 } } , " 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 " } } ,   " s p e c " : { " c o n t a i n e r s " : [ { " i m a g e " : " n g i n x : 1 . 1 4 . 2 " , " n a m e " : " n g i n x " ,   " p o r t s " : [ { " c o n t a i n e r P o r t " : 8 0 } ] } ] } } } }   #   . . .   s p e c :   #   . . .   m i n R e a d y S e c o n d s :   5   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   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   s p e c :   c o n t a i n e r s :   -   i


Question: What is How to delete objects?

Answer: T h e r e   a r e   t w o   a p p r o a c h e s   t o   d e l e t e   o b j e c t s   m a n a g e d   b y   k u b e c t l   a p p l y .


Question: What is Recommended: kubectl delete -f <filename>?

Answer: M a n u a l l y   d e l e t i n g   o b j e c t s   u s i n g   t h e   i m p e r a t i v e   c o m m a n d   i s   t h e   r e c o m m e n d e d   a p p r o a c h ,   a s   i t   i s   m o r e   e x p l i c i t   a b o u t   w h a t   i s   b e i n g   d e l e t e d ,   a n d   l e s s   l i k e l y   t o   r e s u l t   i n   t h e   u s e r   d e l e t i n g   s o m e t h i n g   u n i n t e n t i o n a l l y :   k u b e c t l   d e l e t e   - f   < f i l e n a m e >