Question: What is Overview of Kubernetes Services?

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


Question: What is Services and Labels?

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


Question: What is Step 1: Creating a new Service?

Answer: L e t ’ s   v e r i f y   t h a t   o u r   a p p l i c a t i o n   i s   r u n n i n g .   W e ’ l l   u s e   t h e   k u b e c t l   g e t   c o m m a n d   a n d   l o o k   f o r   e x i s t i n g   P o d s :   k u b e c t l   g e t   p o d s   I f   n o   P o d s   a r e   r u n n i n g   t h e n   i t   m e a n s   t h e   o b j e c t s   f r o m   t h e   p r e v i o u s   t u t o r i a l s   w e r e   c l e a n e d   u p .   I n   t h i s   c a s e ,   g o   b a c k   a n d   r e c r e a t e   t h e   d e p l o y m e n t   f r o m   t h e   U s i n g   k u b e c t l   t o   c r e a t e   a   D e p l o y m e n t   t u t o r i a l .   P l e a s e   w a i t   a   c o u p l e   o f   s e c o n d s   a n d   l i s t   t h e   P o d s   a g a i n .   Y o u   c a n   c o n t i n u e   o n c e   y o u   s e e   t h e   o n e   P o d   r u n n i n g .   N e x t ,   l e t ’ s   l i s t   t h e   c u r r e n t   S e r v i c e s   f r o m   o u r   c l u s t e r :   k u b e c t l   g e t   s e r v i c e s   T o   e x p o s e   t h e   d e p l o y m e n t   t o   e x t e r n a l   t r a f f i c ,   w e ' l l   u s e   t h e   k u b e c t l   e x p o s e   c o m m a n d   w i t h   t h e   - - t y p e = N o d e P o r t   o p t i o n :   k u b e c t l   e x p o s e   d e p l o y m e n t / k u b e r n e t e s - b o o t c a m p   - - t y p e = " N o d e P o r t "   - - p o r t   8 0 8 0   W e   h a v e   n o w   a   r u n n i n g   S e r v i c e   c a l l e d   k u b e r n e t e s - b o o t c a m p .   H e r e   w e   s e e   t h a t   t h e   S e r v i c e   r e c e i v e d   a   u n i q u e   c l u s t e r - I P ,   a n   i n t e r n a l   p o r t   a n d   a n   e x t e r n a l - I P   ( t h e   I P   o f   t h e   N o d e ) .   T o   f i n d   o u t   w h a t   p o r t   w a s   o p e n e d   e x t e r n a l l y   ( f o r   t h e   t y p e :   N o d e P o r t   S e r v i c e )   w e ’ l l   r u n   t h e   d e s c r i b e   s e r v i c e   s u b c o m m a n d :   k u b


Question: What is Note:?

Answer: I f   y o u ' r e   r u n n i n g   m i n i k u b e   w i t h   D o c k e r   D e s k t o p   a s   t h e   c o n t a i n e r   d r i v e r ,   a   m i n i k u b e   t u n n e l   i s   n e e d e d .   T h i s   i s   b e c a u s e   c o n t a i n e r s   i n s i d e   D o c k e r   D e s k t o p   a r e   i s o l a t e d   f r o m   y o u r   h o s t   c o m p u t e r .   I n   a   s e p a r a t e   t e r m i n a l   w i n d o w ,   e x e c u t e :   m i n i k u b e   s e r v i c e   k u b e r n e t e s - b o o t c a m p   - - u r l   T h e   o u t p u t   l o o k s   l i k e   t h i s :   h t t p : / / 1 2 7 . 0 . 0 . 1 : 5 1 0 8 2   !   B e c a u s e   y o u   a r e   u s i n g   a   D o c k e r   d r i v e r   o n   d a r w i n ,   t h e   t e r m i n a l   n e e d s   t o   b e   o p e n   t o   r u n   i t .   T h e n   u s e   t h e   g i v e n   U R L   t o   a c c e s s   t h e   a p p :   c u r l   1 2 7 . 0 . 0 . 1 : 5 1 0 8 2   A n d   w e   g e t   a   r e s p o n s e   f r o m   t h e   s e r v e r .   T h e   S e r v i c e   i s   e x p o s e d .


Question: What is Step 2: Using labels?

Answer: T h e   D e p l o y m e n t   c r e a t e d   a u t o m a t i c a l l y   a   l a b e l   f o r   o u r   P o d .   W i t h   t h e   d e s c r i b e   d e p l o y m e n t   s u b c o m m a n d   y o u   c a n   s e e   t h e   n a m e   ( t h e   k e y )   o f   t h a t   l a b e l :   k u b e c t l   d e s c r i b e   d e p l o y m e n t   L e t ’ s   u s e   t h i s   l a b e l   t o   q u e r y   o u r   l i s t   o f   P o d s .   W e ’ l l   u s e   t h e   k u b e c t l   g e t   p o d s   c o m m a n d   w i t h   - l   a s   a   p a r a m e t e r ,   f o l l o w e d   b y   t h e   l a b e l   v a l u e s :   k u b e c t l   g e t   p o d s   - l   a p p = k u b e r n e t e s - b o o t c a m p   Y o u   c a n   d o   t h e   s a m e   t o   l i s t   t h e   e x i s t i n g   S e r v i c e s :   k u b e c t l   g e t   s e r v i c e s   - l   a p p = k u b e r n e t e s - b o o t c a m p   G e t   t h e   n a m e   o f   t h e   P o d   a n d   s t o r e   i t   i n   t h e   P O D _ N A M E   e n v i r o n m e n t   v a r i a b l e :   e x p o r t   P O D _ N A M E = " $ ( k u b e c t l   g e t   p o d s   - o   g o - t e m p l a t e   - - t e m p l a t e   ' { { r a n g e   . i t e m s } } { { . m e t a d a t a . n a m e } } { { " \ n " } } { { e n d } } ' ) "   e c h o   " N a m e   o f   t h e   P o d :   $ P O D _ N A M E "   T o   a p p l y   a   n e w   l a b e l   w e   u s e   t h e   l a b e l   s u b c o m m a n d   f o l l o w e d   b y   t h e   o b j e c t   t y p e ,   o b j e c t   n a m e   a n d   t h e   n e w   l a b e l :   k u b e c t l   l a b e l   p o d s   " $ P O D _ N A M E "   v e r s i o n = v 1   T h i s   w i l l   a p p l y   a   n e w   l a b e l   t o   o u r   P o d   ( w e   p i n n e d   t h e   a p p l i c a t i o n   v e r s i o n   t o   t h e   P o d ) ,   a n d   w e   c a n   c h e c k   i t   w i t h   t h e   d e s c r i b e   p o d   c o m m a n d :   k u b e c t l   d e s c r i b e   p o d s   " $ P O D _ N A


Question: What is Step 3: Deleting a service?

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


Question: What is What's next?

Answer: T u t o r i a l   R u n n i n g   M u l t i p l e   I n s t a n c e s   o f   Y o u r   A p p . L e a r n   m o r e   a b o u t   S e r v i c e .


Question: What is Objectives?

Answer: S c a l e   a n   e x i s t i n g   a p p   m a n u a l l y   u s i n g   k u b e c t l .


Question: What is Scaling an application?

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


Question: What is Note:?

Answer: I f   y o u   a r e   t r y i n g   t h i s   a f t e r   t h e   p r e v i o u s   s e c t i o n ,   t h e n   y o u   m a y   h a v e   d e l e t e d   t h e   s e r v i c e   y o u   c r e a t e d ,   o r   h a v e   c r e a t e d   a   S e r v i c e   o f   t y p e :   N o d e P o r t .   I n   t h i s   s e c t i o n ,   i t   i s   a s s u m e d   t h a t   a   s e r v i c e   w i t h   t y p e :   L o a d B a l a n c e r   i s   c r e a t e d   f o r   t h e   k u b e r n e t e s - b o o t c a m p   D e p l o y m e n t .   I f   y o u   h a v e   n o t   d e l e t e d   t h e   S e r v i c e   c r e a t e d   i n   t h e   p r e v i o u s   s e c t i o n ,   f i r s t   d e l e t e   t h a t   S e r v i c e   a n d   t h e n   r u n   t h e   f o l l o w i n g   c o m m a n d   t o   c r e a t e   a   n e w   S e r v i c e   w i t h   i t s   t y p e   s e t   t o   L o a d B a l a n c e r :   k u b e c t l   e x p o s e   d e p l o y m e n t / k u b e r n e t e s - b o o t c a m p   - - t y p e = " L o a d B a l a n c e r "   - - p o r t   8 0 8 0


Question: What is Scaling overview?

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


Question: What is Scaling a Deployment?

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


Question: What is Load Balancing?

Answer: L e t ' s   c h e c k   t h a t   t h e   S e r v i c e   i s   l o a d - b a l a n c i n g   t h e   t r a f f i c .   T o   f i n d   o u t   t h e   e x p o s e d   I P   a n d   P o r t   w e   c a n   u s e   d e s c r i b e   s e r v i c e   a s   w e   l e a r n e d   i n   t h e   p r e v i o u s   p a r t   o f   t h e   t u t o r i a l :   k u b e c t l   d e s c r i b e   s e r v i c e s / k u b e r n e t e s - b o o t c a m p   C r e a t e   a n   e n v i r o n m e n t   v a r i a b l e   c a l l e d   N O D E _ P O R T   t h a t   h a s   a   v a l u e   a s   t h e   N o d e   p o r t :   e x p o r t   N O D E _ P O R T = " $ ( k u b e c t l   g e t   s e r v i c e s / k u b e r n e t e s - b o o t c a m p   - o   g o - t e m p l a t e = ' { { ( i n d e x   . s p e c . p o r t s   0 ) . n o d e P o r t } } ' ) "   e c h o   N O D E _ P O R T = $ N O D E _ P O R T   N e x t ,   w e ’ l l   d o   a   c u r l   t o   t h e   e x p o s e d   I P   a d d r e s s   a n d   p o r t .   E x e c u t e   t h e   c o m m a n d   m u l t i p l e   t i m e s :   c u r l   h t t p : / / " $ ( m i n i k u b e   i p ) : $ N O D E _ P O R T "   W e   h i t   a   d i f f e r e n t   P o d   w i t h   e v e r y   r e q u e s t .   T h i s   d e m o n s t r a t e s   t h a t   t h e   l o a d - b a l a n c i n g   i s   w o r k i n g .   T h e   o u t p u t   s h o u l d   b e   s i m i l a r   t o :   H e l l o   K u b e r n e t e s   b o o t c a m p !   |   R u n n i n g   o n :   k u b e r n e t e s - b o o t c a m p - 6 4 4 c 5 6 8 7 f 4 - w p 6 7 j   |   v = 1   H e l l o   K u b e r n e t e s   b o o t c a m p !   |   R u n n i n g   o n :   k u b e r n e t e s - b o o t c a m p - 6 4 4 c 5 6 8 7 f 4 - h s 9 d j   |   v = 1   H e l l o   K u b e r n e t e s   b o o t c a m p !   |   R u n n i n g   o n :   k u b e r n e t e s - b o o t c a m p - 6 4 4 c 5 6 8 7 f 4 - 4 h j v f   |   v = 1   H e l l o   K u b e r n e t e s   b o o t c a m p !   |   R u n n i n g   o


Question: What is Note:?

Answer: I f   y o u ' r e   r u n n i n g   m i n i k u b e   w i t h   D o c k e r   D e s k t o p   a s   t h e   c o n t a i n e r   d r i v e r ,   a   m i n i k u b e   t u n n e l   i s   n e e d e d .   T h i s   i s   b e c a u s e   c o n t a i n e r s   i n s i d e   D o c k e r   D e s k t o p   a r e   i s o l a t e d   f r o m   y o u r   h o s t   c o m p u t e r .   I n   a   s e p a r a t e   t e r m i n a l   w i n d o w ,   e x e c u t e :   m i n i k u b e   s e r v i c e   k u b e r n e t e s - b o o t c a m p   - - u r l   T h e   o u t p u t   l o o k s   l i k e   t h i s :   h t t p : / / 1 2 7 . 0 . 0 . 1 : 5 1 0 8 2   !   B e c a u s e   y o u   a r e   u s i n g   a   D o c k e r   d r i v e r   o n   d a r w i n ,   t h e   t e r m i n a l   n e e d s   t o   b e   o p e n   t o   r u n   i t .   T h e n   u s e   t h e   g i v e n   U R L   t o   a c c e s s   t h e   a p p :   c u r l   1 2 7 . 0 . 0 . 1 : 5 1 0 8 2


Question: What is Scale Down?

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


Question: What is What's next?

Answer: T u t o r i a l   P e r f o r m i n g   a   R o l l i n g   U p d a t e . L e a r n   m o r e   a b o u t   R e p l i c a S e t . L e a r n   m o r e   a b o u t   A u t o s c a l i n g .


Question: What is Objectives?

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


Question: What is Updating an application?

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


Question: What is Rolling updates overview?

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


Question: What is Update the version of the app?

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


Question: What is Verify an update?

Answer: F i r s t ,   c h e c k   t h a t   t h e   s e r v i c e   i s   r u n n i n g ,   a s   y o u   m i g h t   h a v e   d e l e t e d   i t   i n   p r e v i o u s   t u t o r i a l   s t e p ,   r u n   d e s c r i b e   s e r v i c e s / k u b e r n e t e s - b o o t c a m p .   I f   i t ' s   m i s s i n g ,   y o u   c a n   c r e a t e   i t   a g a i n   w i t h :   k u b e c t l   e x p o s e   d e p l o y m e n t / k u b e r n e t e s - b o o t c a m p   - - t y p e = " N o d e P o r t "   - - p o r t   8 0 8 0   C r e a t e   a n   e n v i r o n m e n t   v a r i a b l e   c a l l e d   N O D E _ P O R T   t h a t   h a s   t h e   v a l u e   o f   t h e   N o d e   p o r t   a s s i g n e d :   e x p o r t   N O D E _ P O R T = " $ ( k u b e c t l   g e t   s e r v i c e s / k u b e r n e t e s - b o o t c a m p   - o   g o - t e m p l a t e = ' { { ( i n d e x   . s p e c . p o r t s   0 ) . n o d e P o r t } } ' ) "   e c h o   " N O D E _ P O R T = $ N O D E _ P O R T "   N e x t ,   d o   a   c u r l   t o   t h e   e x p o s e d   I P   a n d   p o r t :   c u r l   h t t p : / / " $ ( m i n i k u b e   i p ) : $ N O D E _ P O R T "   E v e r y   t i m e   y o u   r u n   t h e   c u r l   c o m m a n d ,   y o u   w i l l   h i t   a   d i f f e r e n t   P o d .   N o t i c e   t h a t   a l l   P o d s   a r e   n o w   r u n n i n g   t h e   l a t e s t   v e r s i o n   ( v 2 ) .   Y o u   c a n   a l s o   c o n f i r m   t h e   u p d a t e   b y   r u n n i n g   t h e   r o l l o u t   s t a t u s   s u b c o m m a n d :   k u b e c t l   r o l l o u t   s t a t u s   d e p l o y m e n t s / k u b e r n e t e s - b o o t c a m p   T o   v i e w   t h e   c u r r e n t   i m a g e   v e r s i o n   o f   t h e   a p p ,   r u n   t h e   d e s c r i b e   p o d s   s u b c o m m a n d :   k u b e c t l   d e s c r i b e   p o d s   I n   t h e   I m a g e   f i e l d   o f   t h e   o u t p u t ,   v e r i f y   t h a t   y o u   a r e   r


Question: What is Roll back an update?

Answer: L e t ’ s   p e r f o r m   a n o t h e r   u p d a t e ,   a n d   t r y   t o   d e p l o y   a n   i m a g e   t a g g e d   w i t h   v 1 0 :   k u b e c t l   s e t   i m a g e   d e p l o y m e n t s / k u b e r n e t e s - b o o t c a m p   k u b e r n e t e s - b o o t c a m p = g c r . i o / g o o g l e - s a m p l e s / k u b e r n e t e s - b o o t c a m p : v 1 0   U s e   g e t   d e p l o y m e n t s   t o   s e e   t h e   s t a t u s   o f   t h e   d e p l o y m e n t :   k u b e c t l   g e t   d e p l o y m e n t s   N o t i c e   t h a t   t h e   o u t p u t   d o e s n ' t   l i s t   t h e   d e s i r e d   n u m b e r   o f   a v a i l a b l e   P o d s .   R u n   t h e   g e t   p o d s   s u b c o m m a n d   t o   l i s t   a l l   P o d s :   k u b e c t l   g e t   p o d s   N o t i c e   t h a t   s o m e   o f   t h e   P o d s   h a v e   a   s t a t u s   o f   I m a g e P u l l B a c k O f f .   T o   g e t   m o r e   i n s i g h t   i n t o   t h e   p r o b l e m ,   r u n   t h e   d e s c r i b e   p o d s   s u b c o m m a n d :   k u b e c t l   d e s c r i b e   p o d s   I n   t h e   E v e n t s   s e c t i o n   o f   t h e   o u t p u t   f o r   t h e   a f f e c t e d   P o d s ,   n o t i c e   t h a t   t h e   v 1 0   i m a g e   v e r s i o n   d i d   n o t   e x i s t   i n   t h e   r e p o s i t o r y .   T o   r o l l   b a c k   t h e   d e p l o y m e n t   t o   y o u r   l a s t   w o r k i n g   v e r s i o n ,   u s e   t h e   r o l l o u t   u n d o   s u b c o m m a n d :   k u b e c t l   r o l l o u t   u n d o   d e p l o y m e n t s / k u b e r n e t e s - b o o t c a m p   T h e   r o l l o u t   u n d o   c o m m a n d   r e v e r t s   t h e   d e p l o y m e n t   t o   t h e   p r e v i o u s   k n o w n   s t a t e   ( v 2   o f   t h e   i m a g e ) .   U p d a t e s   a r e   v e r s i o n e d   a n d   y o u   c a n   r e v e r t   t o   a n y   p r e v i o u s l y   k n o w n   s t a t


Question: What is What's next?

Answer: L e a r n   m o r e   a b o u t   D e p l o y m e n t s .   ©   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 Tutorials?

Answer: This is the multi-page printable view of this section. Click here to print.Return to the regular view of this page.Tutorials1: Hello Minikube2: Learn Kubernetes Basics2.1: Create a Cluster2.1.1: Using Minikube to Create a Cluster2.2: Deploy an App2.2.1: Using kubectl to Create a Deployment2.3: Explore Your App2.3.1: Viewing Pods and Nodes2.4: Expose Your App Publicly2.4.1: Using a Service to Expose Your App2.5: Scale Your App2.5.1: Running Multiple Instances of Your App2.6: Update Your App2.6.1: Performing a Rolling Update3: Configuration3.1: Updating Configuration via a ConfigMap3.2: Configuring Redis using a ConfigMap3.3: Adopting Sidecar Containers4: Security4.1: Apply Pod Security Standards at the Cluster Level4.2: Apply Pod Security Standards at the Namespace Level4.3: Restrict a Container's Access to Resources with AppArmor4.4: Restrict a Container's Syscalls with seccomp5: Stateless Applications5.1: Exposing an External IP Address to Access an Application in a Cluster5.2: Example: Deploying PHP Guestbook application with Redis6: Stateful Applications6.1: StatefulSet Basics6.2: Example: Deploying WordPress and MySQL with Persistent Volumes6.3: Example: Deploying Cassandra with a StatefulSet6.4: Running ZooKeeper, A Distributed System Coordinator7: Cluster Management7.1: Running Kubelet in Standalone Mode7.2: Configuring swap memory on Kubernetes nodes7.3: Install Drivers and Allocate Devices with DRA7.4: Namespaces Walkthrough8: Services8.1: Connecting Applications with Services8.2: Using Source IP8.3: Explore Termination Behavior for Pods And Their EndpointsThis section of the Kubernetes documentation contains tutorials. A tutorial shows how to accomplish a goal that is larger than a single task. Typically a tutorial has several sections, each of which has a sequence of steps. Before walking through each tutorial, you may want to bookmark the Standardized Glossary page for later references.BasicsKubernetes Basics is an in-depth interactive tutorial that helps you understand the Kubernetes system and try out some basic Kubernetes features.Introduction to Kubernetes (edX)Hello MinikubeConfigurationConfiguring Redis Using a ConfigMapAuthoring PodsAdopting Sidecar ContainersStateless ApplicationsExposing an External IP Address to Access an Application in a ClusterExample: Deploying PHP Guestbook application with RedisStateful ApplicationsStatefulSet BasicsExample: WordPress and MySQL with Persistent VolumesExample: Deploying Cassandra with Stateful SetsRunning ZooKeeper, A CP Distributed SystemServicesConnecting Applications with ServicesUsing Source IPSecurityApply Pod Security Standards at Cluster levelApply Pod Security Standards at Namespace levelRestrict a Container's Access to Resources with AppArmorSeccompCluster ManagementConfiguring Swap Memory on Kubernetes NodesRunning Kubelet in Standalone ModeInstall Drivers and Allocate Devices with DRAWhat's


Question: How does Tutorials work?

Answer: This is the multi-page printable view of this section. Click here to print.Return to the regular view of this page.Tutorials1: Hello Minikube2: Learn Kubernetes Basics2.1: Create a Cluster2.1.1: Using Minikube to Create a Cluster2.2: Deploy an App2.2.1: Using kubectl to Create a Deployment2.3: Explore Your App2.3.1: Viewing Pods and Nodes2.4: Expose Your App Publicly2.4.1: Using a Service to Expose Your App2.5: Scale Your App2.5.1: Running Multiple Instances of Your App2.6: Update Your App2.6.1: Performing a Rolling Update3: Configuration3.1: Updating Configuration via a ConfigMap3.2: Configuring Redis using a ConfigMap3.3: Adopting Sidecar Containers4: Security4.1: Apply Pod Security Standards at the Cluster Level4.2: Apply Pod Security Standards at the Namespace Level4.3: Restrict a Container's Access to Resources with AppArmor4.4: Restrict a Container's Syscalls with seccomp5: Stateless Applications5.1: Exposing an External IP Address to Access an Application in a Cluster5.2: Example: Deploying PHP Guestbook application with Redis6: Stateful Applications6.1: StatefulSet Basics6.2: Example: Deploying WordPress and MySQL with Persistent Volumes6.3: Example: Deploying Cassandra with a StatefulSet6.4: Running ZooKeeper, A Distributed System Coordinator7: Cluster Management7.1: Running Kubelet in Standalone Mode7.2: Configuring swap memory on Kubernetes nodes7.3: Install Drivers and Allocate Devices with DRA7.4: Namespaces Walkthrough8: Services8.1: Connecting Applications with Services8.2: Using Source IP8.3: Explore Termination Behavior for Pods And Their EndpointsThis section of the Kubernetes documentation contains tutorials. A tutorial shows how to accomplish a goal that is larger than a single task. Typically a tutorial has several sections, each of which has a sequence of steps. Before walking through each tutorial, you may want to bookmark the Standardized Glossary page for later references.BasicsKubernetes Basics is an in-depth interactive tutorial that helps you understand the Kubernetes system and try out some basic Kubernetes features.Introduction to Kubernetes (edX)Hello MinikubeConfigurationConfiguring Redis Using a ConfigMapAuthoring PodsAdopting Sidecar ContainersStateless ApplicationsExposing an External IP Address to Access an Application in a ClusterExample: Deploying PHP Guestbook application with RedisStateful ApplicationsStatefulSet BasicsExample: WordPress and MySQL with Persistent VolumesExample: Deploying Cassandra with Stateful SetsRunning ZooKeeper, A CP Distributed SystemServicesConnecting Applications with ServicesUsing Source IPSecurityApply Pod Security Standards at Cluster levelApply Pod Security Standards at Namespace levelRestrict a Container's Access to Resources with AppArmorSeccompCluster ManagementConfiguring Swap Memory on Kubernetes NodesRunning Kubelet in Standalone ModeInstall Drivers and Allocate Devices with DRAWhat's


Question: When would you use Tutorials?

Answer: This is the multi-page printable view of this section. Click here to print.Return to the regular view of this page.Tutorials1: Hello Minikube2: Learn Kubernetes Basics2.1: Create a Cluster2.1.1: Using Minikube to Create a Cluster2.2: Deploy an App2.2.1: Using kubectl to Create a Deployment2.3: Explore Your App2.3.1: Viewing Pods and Nodes2.4: Expose Your App Publicly2.4.1: Using a Service to Expose Your App2.5: Scale Your App2.5.1: Running Multiple Instances of Your App2.6: Update Your App2.6.1: Performing a Rolling Update3: Configuration3.1: Updating Configuration via a ConfigMap3.2: Configuring Redis using a ConfigMap3.3: Adopting Sidecar Containers4: Security4.1: Apply Pod Security Standards at the Cluster Level4.2: Apply Pod Security Standards at the Namespace Level4.3: Restrict a Container's Access to Resources with AppArmor4.4: Restrict a Container's Syscalls with seccomp5: Stateless Applications5.1: Exposing an External IP Address to Access an Application in a Cluster5.2: Example: Deploying PHP Guestbook application with Redis6: Stateful Applications6.1: StatefulSet Basics6.2: Example: Deploying WordPress and MySQL with Persistent Volumes6.3: Example: Deploying Cassandra with a StatefulSet6.4: Running ZooKeeper, A Distributed System Coordinator7: Cluster Management7.1: Running Kubelet in Standalone Mode7.2: Configuring swap memory on Kubernetes nodes7.3: Install Drivers and Allocate Devices with DRA7.4: Namespaces Walkthrough8: Services8.1: Connecting Applications with Services8.2: Using Source IP8.3: Explore Termination Behavior for Pods And Their EndpointsThis section of the Kubernetes documentation contains tutorials. A tutorial shows how to accomplish a goal that is larger than a single task. Typically a tutorial has several sections, each of which has a sequence of steps. Before walking through each tutorial, you may want to bookmark the Standardized Glossary page for later references.BasicsKubernetes Basics is an in-depth interactive tutorial that helps you understand the Kubernetes system and try out some basic Kubernetes features.Introduction to Kubernetes (edX)Hello MinikubeConfigurationConfiguring Redis Using a ConfigMapAuthoring PodsAdopting Sidecar ContainersStateless ApplicationsExposing an External IP Address to Access an Application in a ClusterExample: Deploying PHP Guestbook application with RedisStateful ApplicationsStatefulSet BasicsExample: WordPress and MySQL with Persistent VolumesExample: Deploying Cassandra with Stateful SetsRunning ZooKeeper, A CP Distributed SystemServicesConnecting Applications with ServicesUsing Source IPSecurityApply Pod Security Standards at Cluster levelApply Pod Security Standards at Namespace levelRestrict a Container's Access to Resources with AppArmorSeccompCluster ManagementConfiguring Swap Memory on Kubernetes NodesRunning Kubelet in Standalone ModeInstall Drivers and Allocate Devices with DRAWhat's


Question: What are the benefits of Tutorials?

Answer: This is the multi-page printable view of this section. Click here to print.Return to the regular view of this page.Tutorials1: Hello Minikube2: Learn Kubernetes Basics2.1: Create a Cluster2.1.1: Using Minikube to Create a Cluster2.2: Deploy an App2.2.1: Using kubectl to Create a Deployment2.3: Explore Your App2.3.1: Viewing Pods and Nodes2.4: Expose Your App Publicly2.4.1: Using a Service to Expose Your App2.5: Scale Your App2.5.1: Running Multiple Instances of Your App2.6: Update Your App2.6.1: Performing a Rolling Update3: Configuration3.1: Updating Configuration via a ConfigMap3.2: Configuring Redis using a ConfigMap3.3: Adopting Sidecar Containers4: Security4.1: Apply Pod Security Standards at the Cluster Level4.2: Apply Pod Security Standards at the Namespace Level4.3: Restrict a Container's Access to Resources with AppArmor4.4: Restrict a Container's Syscalls with seccomp5: Stateless Applications5.1: Exposing an External IP Address to Access an Application in a Cluster5.2: Example: Deploying PHP Guestbook application with Redis6: Stateful Applications6.1: StatefulSet Basics6.2: Example: Deploying WordPress and MySQL with Persistent Volumes6.3: Example: Deploying Cassandra with a StatefulSet6.4: Running ZooKeeper, A Distributed System Coordinator7: Cluster Management7.1: Running Kubelet in Standalone Mode7.2: Configuring swap memory on Kubernetes nodes7.3: Install Drivers and Allocate Devices with DRA7.4: Namespaces Walkthrough8: Services8.1: Connecting Applications with Services8.2: Using Source IP8.3: Explore Termination Behavior for Pods And Their EndpointsThis section of the Kubernetes documentation contains tutorials. A tutorial shows how to accomplish a goal that is larger than a single task. Typically a tutorial has several sections, each of which has a sequence of steps. Before walking through each tutorial, you may want to bookmark the Standardized Glossary page for later references.BasicsKubernetes Basics is an in-depth interactive tutorial that helps you understand the Kubernetes system and try out some basic Kubernetes features.Introduction to Kubernetes (edX)Hello MinikubeConfigurationConfiguring Redis Using a ConfigMapAuthoring PodsAdopting Sidecar ContainersStateless ApplicationsExposing an External IP Address to Access an Application in a ClusterExample: Deploying PHP Guestbook application with RedisStateful ApplicationsStatefulSet BasicsExample: WordPress and MySQL with Persistent VolumesExample: Deploying Cassandra with Stateful SetsRunning ZooKeeper, A CP Distributed SystemServicesConnecting Applications with ServicesUsing Source IPSecurityApply Pod Security Standards at Cluster levelApply Pod Security Standards at Namespace levelRestrict a Container's Access to Resources with AppArmorSeccompCluster ManagementConfiguring Swap Memory on Kubernetes NodesRunning Kubelet in Standalone ModeInstall Drivers and Allocate Devices with DRAWhat's


Question: What is Tutorials?

Answer: 1 :   H e l l o   M i n i k u b e 2 :   L e a r n   K u b e r n e t e s   B a s i c s 2 . 1 :   C r e a t e   a   C l u s t e r 2 . 1 . 1 :   U s i n g   M i n i k u b e   t o   C r e a t e   a   C l u s t e r 2 . 2 :   D e p l o y   a n   A p p 2 . 2 . 1 :   U s i n g   k u b e c t l   t o   C r e a t e   a   D e p l o y m e n t 2 . 3 :   E x p l o r e   Y o u r   A p p 2 . 3 . 1 :   V i e w i n g   P o d s   a n d   N o d e s 2 . 4 :   E x p o s e   Y o u r   A p p   P u b l i c l y 2 . 4 . 1 :   U s i n g   a   S e r v i c e   t o   E x p o s e   Y o u r   A p p 2 . 5 :   S c a l e   Y o u r   A p p 2 . 5 . 1 :   R u n n i n g   M u l t i p l e   I n s t a n c e s   o f   Y o u r   A p p 2 . 6 :   U p d a t e   Y o u r   A p p 2 . 6 . 1 :   P e r f o r m i n g   a   R o l l i n g   U p d a t e 3 :   C o n f i g u r a t i o n 3 . 1 :   U p d a t i n g   C o n f i g u r a t i o n   v i a   a   C o n f i g M a p 3 . 2 :   C o n f i g u r i n g   R e d i s   u s i n g   a   C o n f i g M a p 3 . 3 :   A d o p t i n g   S i d e c a r   C o n t a i n e r s 4 :   S e c u r i t y 4 . 1 :   A p p l y   P o d   S e c u r i t y   S t a n d a r d s   a t   t h e   C l u s t e r   L e v e l 4 . 2 :   A p p l y   P o d   S e c u r i t y   S t a n d a r d s   a t   t h e   N a m e s p a c e   L e v e l 4 . 3 :   R e s t r i c t   a   C o n t a i n e r ' s   A c c e s s   t o   R e s o u r c e s   w i t h   A p p A r m o r 4 . 4 :   R e s t r i c t   a   C o n t a i n e r ' s   S y s c a l l s   w i t h   s e c c o m p 5 :   S t a t e l e s s   A p p l i c a t i o n s 5 . 1 :   E x p o s i n g   a n   E x t e r n a l   I P   A d d r e s s   t o   A c c e s s   a n   A p p l i c a t i o n   i n   a   C l u s t e r 5 . 2 :   E x a m p l e :   D e p l o y i n g   P H P   G u e s t b o o k   a p p l i c a t i o n   w i t h   R e d i s 6 :   S t a t e f u l   A p p l i c a t i o n s 6 . 1 :   S t a t e f u l S e t   B a s i c s 6 . 2 :   E x a m p l e :   D e p l o y i n g   W o r d


Question: What is Basics?

Answer: K u b e r n e t e s   B a s i c s   i s   a n   i n - d e p t h   i n t e r a c t i v e   t u t o r i a l   t h a t   h e l p s   y o u   u n d e r s t a n d   t h e   K u b e r n e t e s   s y s t e m   a n d   t r y   o u t   s o m e   b a s i c   K u b e r n e t e s   f e a t u r e s . I n t r o d u c t i o n   t o   K u b e r n e t e s   ( e d X ) H e l l o   M i n i k u b e


Question: What is Configuration?

Answer: C o n f i g u r i n g   R e d i s   U s i n g   a   C o n f i g M a p


Question: What is Authoring Pods?

Answer: A d o p t i n g   S i d e c a r   C o n t a i n e r s


Question: What is Stateless Applications?

Answer: E x p o s i n g   a n   E x t e r n a l   I P   A d d r e s s   t o   A c c e s s   a n   A p p l i c a t i o n   i n   a   C l u s t e r E x a m p l e :   D e p l o y i n g   P H P   G u e s t b o o k   a p p l i c a t i o n   w i t h   R e d i s


Question: What is Stateful Applications?

Answer: S t a t e f u l S e t   B a s i c s E x a m p l e :   W o r d P r e s s   a n d   M y S Q L   w i t h   P e r s i s t e n t   V o l u m e s E x a m p l e :   D e p l o y i n g   C a s s a n d r a   w i t h   S t a t e f u l   S e t s R u n n i n g   Z o o K e e p e r ,   A   C P   D i s t r i b u t e d   S y s t e m


Question: What is Services?

Answer: C o n n e c t i n g   A p p l i c a t i o n s   w i t h   S e r v i c e s U s i n g   S o u r c e   I P


Question: What is Security?

Answer: A p p l y   P o d   S e c u r i t y   S t a n d a r d s   a t   C l u s t e r   l e v e l A p p l y   P o d   S e c u r i t y   S t a n d a r d s   a t   N a m e s p a c e   l e v e l R e s t r i c t   a   C o n t a i n e r ' s   A c c e s s   t o   R e s o u r c e s   w i t h   A p p A r m o r S e c c o m p


Question: What is Cluster Management?

Answer: C o n f i g u r i n g   S w a p   M e m o r y   o n   K u b e r n e t e s   N o d e s R u n n i n g   K u b e l e t   i n   S t a n d a l o n e   M o d e I n s t a l l   D r i v e r s   a n d   A l l o c a t e   D e v i c e s   w i t h   D R A


Question: What is What's next?

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


Question: What is 1 - Hello Minikube?

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   s a m p l e   a p p   o n   K u b e r n e t e s   u s i n g   m i n i k u b e .   T h e   t u t o r i a l   p r o v i d e s   a   c o n t a i n e r   i m a g e   t h a t   u s e s   N G I N X   t o   e c h o   b a c k   a l l   t h e   r e q u e s t s .


Question: What is Objectives?

Answer: D e p l o y   a   s a m p l e   a p p l i c a t i o n   t o   m i n i k u b e . R u n   t h e   a p p . V i e w   a p p l i c a t i o n   l o g s .


Question: What is Before you begin?

Answer: 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   a l r e a d y   s e t   u p   m i n i k u b e .   S e e   S t e p   1   i n   m i n i k u b e   s t a r t   f o r   i n s t a l l a t i o n   i n s t r u c t i o n s . N o t e : O n l y   e x e c u t e   t h e   i n s t r u c t i o n s   i n   S t e p   1 ,   I n s t a l l a t i o n .   T h e   r e s t   i s   c o v e r e d   o n   t h i s   p a g e .


Question: What is Note:?

Answer: Y o u   a l s o   n e e d   t o   i n s t a l l   k u b e c t l .   S e e   I n s t a l l   t o o l s   f o r   i n s t a l l a t i o n   i n s t r u c t i o n s .


Question: What is Create a minikube cluster?

Answer: m i n i k u b e   s t a r t


Question: What is Open the Dashboard?

Answer: O p e n   t h e   K u b e r n e t e s   d a s h b o a r d .   Y o u   c a n   d o   t h i s   t w o   d i f f e r e n t   w a y s :   O p e n   a   n e w   t e r m i n a l ,   a n d   r u n : #   S t a r t   a   n e w   t e r m i n a l ,   a n d   l e a v e   t h i s   r u n n i n g .   m i n i k u b e   d a s h b o a r d   N o w ,   s w i t c h   b a c k   t o   t h e   t e r m i n a l   w h e r e   y o u   r a n   m i n i k u b e   s t a r t . N o t e : T h e   d a s h b o a r d   c o m m a n d   e n a b l e s   t h e   d a s h b o a r d   a d d - o n   a n d   o p e n s   t h e   p r o x y   i n   t h e   d e f a u l t   w e b   b r o w s e r .   Y o u   c a n   c r e a t e   K u b e r n e t e s   r e s o u r c e s   o n   t h e   d a s h b o a r d   s u c h   a s   D e p l o y m e n t   a n d   S e r v i c e . T o   f i n d   o u t   h o w   t o   a v o i d   d i r e c t l y   i n v o k i n g   t h e   b r o w s e r   f r o m   t h e   t e r m i n a l   a n d   g e t   a   U R L   f o r   t h e   w e b   d a s h b o a r d ,   s e e   t h e   " U R L   c o p y   a n d   p a s t e "   t a b . B y   d e f a u l t ,   t h e   d a s h b o a r d   i s   o n l y   a c c e s s i b l e   f r o m   w i t h i n   t h e   i n t e r n a l   K u b e r n e t e s   v i r t u a l   n e t w o r k .   T h e   d a s h b o a r d   c o m m a n d   c r e a t e s   a   t e m p o r a r y   p r o x y   t o   m a k e   t h e   d a s h b o a r d   a c c e s s i b l e   f r o m   o u t s i d e   t h e   K u b e r n e t e s   v i r t u a l   n e t w o r k . T o   s t o p   t h e   p r o x y ,   r u n   C t r l + C   t o   e x i t   t h e   p r o c e s s .   A f t e r   t h e   c o m m a n d   e x i t s ,   t h e   d a s h b o a r d   r e m a i n s   r u n n i n g   i n   t h e   K u b e r n e t e s   c l u s t e r .   Y o u   c a n   r u n   t h e   d a s h b o a r d   c o m m a n d   a g a i n   t o   c r e a t e   a n o t h e r   p r o x y   t o   a c c e s s   t h e   d a s h b o a r d .


Question: What is Note:?

Answer: T h e   d a s h b o a r d   c o m m a n d   e n a b l e s   t h e   d a s h b o a r d   a d d - o n   a n d   o p e n s   t h e   p r o x y   i n   t h e   d e f a u l t   w e b   b r o w s e r .   Y o u   c a n   c r e a t e   K u b e r n e t e s   r e s o u r c e s   o n   t h e   d a s h b o a r d   s u c h   a s   D e p l o y m e n t   a n d   S e r v i c e .   T o   f i n d   o u t   h o w   t o   a v o i d   d i r e c t l y   i n v o k i n g   t h e   b r o w s e r   f r o m   t h e   t e r m i n a l   a n d   g e t   a   U R L   f o r   t h e   w e b   d a s h b o a r d ,   s e e   t h e   " U R L   c o p y   a n d   p a s t e "   t a b .   B y   d e f a u l t ,   t h e   d a s h b o a r d   i s   o n l y   a c c e s s i b l e   f r o m   w i t h i n   t h e   i n t e r n a l   K u b e r n e t e s   v i r t u a l   n e t w o r k .   T h e   d a s h b o a r d   c o m m a n d   c r e a t e s   a   t e m p o r a r y   p r o x y   t o   m a k e   t h e   d a s h b o a r d   a c c e s s i b l e   f r o m   o u t s i d e   t h e   K u b e r n e t e s   v i r t u a l   n e t w o r k .   T o   s t o p   t h e   p r o x y ,   r u n   C t r l + C   t o   e x i t   t h e   p r o c e s s .   A f t e r   t h e   c o m m a n d   e x i t s ,   t h e   d a s h b o a r d   r e m a i n s   r u n n i n g   i n   t h e   K u b e r n e t e s   c l u s t e r .   Y o u   c a n   r u n   t h e   d a s h b o a r d   c o m m a n d   a g a i n   t o   c r e a t e   a n o t h e r   p r o x y   t o   a c c e s s   t h e   d a s h b o a r d .   I f   y o u   d o n ' t   w a n t   m i n i k u b e   t o   o p e n   a   w e b   b r o w s e r   f o r   y o u ,   r u n   t h e   d a s h b o a r d   s u b c o m m a n d   w i t h   t h e   - - u r l   f l a g .   m i n i k u b e   o u t p u t s   a   U R L   t h a t   y o u   c a n   o p e n   i n   t h e   b r o w s e r   y o u   p r e f e r . O p e n   a   n e w   t e r m i n a l ,   a n d   r u n : #   S t a r t   a   n e w   t e r m i n a l


Question: What is Create a Deployment?

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


Question: What is Note:?

Answer: k u b e c t l   l o g s   h e l l o - n o d e - 5 f 7 6 c f 6 c c f - b r 9 b 5   T h e   o u t p u t   i s   s i m i l a r   t o :   I 0 9 1 1   0 9 : 1 9 : 2 6 . 6 7 7 3 9 7   1   l o g . g o : 1 9 5 ]   S t a r t e d   H T T P   s e r v e r   o n   p o r t   8 0 8 0   I 0 9 1 1   0 9 : 1 9 : 2 6 . 6 7 7 5 8 6   1   l o g . g o : 1 9 5 ]   S t a r t e d   U D P   s e r v e r   o n   p o r t   8 0 8 1


Question: What is Create a Service?

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


Question: What is Warning:?

Answer: E x p o s e   t h e   P o d   t o   t h e   p u b l i c   i n t e r n e t   u s i n g   t h e   k u b e c t l   e x p o s e   c o m m a n d : k u b e c t l   e x p o s e   d e p l o y m e n t   h e l l o - n o d e   - - t y p e = L o a d B a l a n c e r   - - p o r t = 8 0 8 0   T h e   - - t y p e = L o a d B a l a n c e r   f l a g   i n d i c a t e s   t h a t   y o u   w a n t   t o   e x p o s e   y o u r   S e r v i c e   o u t s i d e   o f   t h e   c l u s t e r . T h e   a p p l i c a t i o n   c o d e   i n s i d e   t h e   t e s t   i m a g e   o n l y   l i s t e n s   o n   T C P   p o r t   8 0 8 0 .   I f   y o u   u s e d   k u b e c t l   e x p o s e   t o   e x p o s e   a   d i f f e r e n t   p o r t ,   c l i e n t s   c o u l d   n o t   c o n n e c t   t o   t h a t   o t h e r   p o r t . V i e w   t h e   S e r v i c e   y o u   c r e a t e d : k u b e c t l   g e t   s e r v i c e s   T h e   o u t p u t   i s   s i m i l a r   t o : 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   h e l l o - n o d e   L o a d B a l a n c e r   1 0 . 1 0 8 . 1 4 4 . 7 8   < p e n d i n g >   8 0 8 0 : 3 0 3 6 9 / T C P   2 1 s   k u b e r n e t e s   C l u s t e r I P   1 0 . 9 6 . 0 . 1   < n o n e >   4 4 3 / T C P   2 3 m   O n   c l o u d   p r o v i d e r s   t h a t   s u p p o r t   l o a d   b a l a n c e r s ,   a n   e x t e r n a l   I P   a d d r e s s   w o u l d   b e   p r o v i s i o n e d   t o   a c c e s s   t h e   S e r v i c e .   O n   m i n i k u b e ,   t h e   L o a d B a l a n c e r   t y p e   m a k e s   t h e   S e r v i c e   a c c e s s i b l e   t h r o u g h   t h e   m i n i k u b e   s e r v i c e   c o m m a n d . R u n   t h e   f o l l o w i n g   c o m m a n d : m i n i k u b e   s e r v i c e   h e l l o - n o d e   T h i s   o p e n s   u p   a   b r o w s e r   w i n d o w   t h a t   s e r v e s   y o u r   a p p   a n d   s h o w s   t h e   a p p ' s   r e s p o n s e


Question: What is Enable addons?

Answer: T h e   m i n i k u b e   t o o l   i n c l u d e s   a   s e t   o f   b u i l t - i n   a d d o n s   t h a t   c a n   b e   e n a b l e d ,   d i s a b l e d   a n d   o p e n e d   i n   t h e   l o c a l   K u b e r n e t e s   e n v i r o n m e n t .   L i s t   t h e   c u r r e n t l y   s u p p o r t e d   a d d o n s : m i n i k u b e   a d d o n s   l i s t   T h e   o u t p u t   i s   s i m i l a r   t o : a d d o n - m a n a g e r :   e n a b l e d   d a s h b o a r d :   e n a b l e d   d e f a u l t - s t o r a g e c l a s s :   e n a b l e d   e f k :   d i s a b l e d   f r e s h p o d :   d i s a b l e d   g v i s o r :   d i s a b l e d   h e l m - t i l l e r :   d i s a b l e d   i n g r e s s :   d i s a b l e d   i n g r e s s - d n s :   d i s a b l e d   l o g v i e w e r :   d i s a b l e d   m e t r i c s - s e r v e r :   d i s a b l e d   n v i d i a - d r i v e r - i n s t a l l e r :   d i s a b l e d   n v i d i a - g p u - d e v i c e - p l u g i n :   d i s a b l e d   r e g i s t r y :   d i s a b l e d   r e g i s t r y - c r e d s :   d i s a b l e d   s t o r a g e - p r o v i s i o n e r :   e n a b l e d   s t o r a g e - p r o v i s i o n e r - g l u s t e r :   d i s a b l e d   E n a b l e   a n   a d d o n ,   f o r   e x a m p l e ,   m e t r i c s - s e r v e r : m i n i k u b e   a d d o n s   e n a b l e   m e t r i c s - s e r v e r   T h e   o u t p u t   i s   s i m i l a r   t o : T h e   ' m e t r i c s - s e r v e r '   a d d o n   i s   e n a b l e d   V i e w   t h e   P o d   a n d   S e r v i c e   y o u   c r e a t e d   b y   i n s t a l l i n g   t h a t   a d d o n : k u b e c t l   g e t   p o d , s v c   - n   k u b e - s y s t e m   T h e   o u t p u t   i s   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   p o d / c o r e d n s - 5 6 4 4 d 7 b 6 d 9 - m h 9 l l   1 / 1   R u n n i n g   0   3 4 m   p o d / c o r e d n s - 5 6 4 4 d 7 b 6 d 9 - p q d 2 t   1 / 1


Question: What is Clean up?

Answer: N o w   y o u   c a n   c l e a n   u p   t h e   r e s o u r c e s   y o u   c r e a t e d   i n   y o u r   c l u s t e r :   k u b e c t l   d e l e t e   s e r v i c e   h e l l o - n o d e   k u b e c t l   d e l e t e   d e p l o y m e n t   h e l l o - n o d e   S t o p   t h e   M i n i k u b e   c l u s t e r   m i n i k u b e   s t o p   O p t i o n a l l y ,   d e l e t e   t h e   M i n i k u b e   V M :   #   O p t i o n a l   m i n i k u b e   d e l e t e   I f   y o u   w a n t   t o   u s e   m i n i k u b e   a g a i n   t o   l e a r n   m o r e   a b o u t   K u b e r n e t e s ,   y o u   d o n ' t   n e e d   t o   d e l e t e   i t .


Question: What is Conclusion?

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


Question: What is What's next?

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


Question: What is Objectives?

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


Question: What is What can Kubernetes do for you??

Answer: W i t h   m o d e r n   w e b   s e r v i c e s ,   u s e r s   e x p e c t   a p p l i c a t i o n s   t o   b e   a v a i l a b l e   2 4 / 7 ,   a n d   d e v e l o p e r s   e x p e c t   t o   d e p l o y   n e w   v e r s i o n s   o f   t h o s e   a p p l i c a t i o n s   s e v e r a l   t i m e s   a   d a y .   C o n t a i n e r i z a t i o n   h e l p s   p a c k a g e   s o f t w a r e   t o   s e r v e   t h e s e   g o a l s ,   e n a b l i n g   a p p l i c a t i o n s   t o   b e   r e l e a s e d   a n d   u p d a t e d   w i t h o u t   d o w n t i m e .   K u b e r n e t e s   h e l p s   y o u   m a k e   s u r e   t h o s e   c o n t a i n e r i z e d   a p p l i c a t i o n s   r u n   w h e r e   a n d   w h e n   y o u   w a n t ,   a n d   h e l p s   t h e m   f i n d   t h e   r e s o u r c e s   a n d   t o o l s   t h e y   n e e d   t o   w o r k .   K u b e r n e t e s   i s   a   p r o d u c t i o n - r e a d y ,   o p e n   s o u r c e   p l a t f o r m   d e s i g n e d   w i t h   G o o g l e ' s   a c c u m u l a t e d   e x p e r i e n c e   i n   c o n t a i n e r   o r c h e s t r a t i o n ,   c o m b i n e d   w i t h   b e s t - o f - b r e e d   i d e a s   f r o m   t h e   c o m m u n i t y .


Question: What is What's next?

Answer: T u t o r i a l   U s i n g   M i n i k u b e   t o   C r e a t e   a   C l u s t e r


Question: What is 2.1 - Create a Cluster?

Answer: L e a r n   a b o u t   K u b e r n e t e s   c l u s t e r   a n d   c r e a t e   a   s i m p l e   c l u s t e r   u s i n g   M i n i k u b e .


Question: What is Objectives?

Answer: L e a r n   w h a t   a   K u b e r n e t e s   c l u s t e r   i s . L e a r n   w h a t   M i n i k u b e   i s . S t a r t   a   K u b e r n e t e s   c l u s t e r   o n   y o u r   c o m p u t e r .


Question: What is Kubernetes Clusters?

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


Question: What is Cluster Diagram?

Answer: T h e   C o n t r o l   P l a n e   i s   r e s p o n s i b l e   f o r   m a n a g i n g   t h e   c l u s t e r .   T h e   C o n t r o l   P l a n e   c o o r d i n a t e s   a l l   a c t i v i t i e s   i n   y o u r   c l u s t e r ,   s u c h   a s   s c h e d u l i n g   a p p l i c a t i o n s ,   m a i n t a i n i n g   a p p l i c a t i o n s '   d e s i r e d   s t a t e ,   s c a l i n g   a p p l i c a t i o n s ,   a n d   r o l l i n g   o u t   n e w   u p d a t e s .   A   n o d e   i s   a   V M   o r   a   p h y s i c a l   c o m p u t e r   t h a t   s e r v e s   a s   a   w o r k e r   m a c h i n e   i n   a   K u b e r n e t e s   c l u s t e r .   E a c h   n o d e   h a s   a   K u b e l e t ,   w h i c h   i s   a n   a g e n t   f o r   m a n a g i n g   t h e   n o d e   a n d   c o m m u n i c a t i n g   w i t h   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 .   T h e   n o d e   s h o u l d   a l s o   h a v e   t o o l s   f o r   h a n d l i n g   c o n t a i n e r   o p e r a t i o n s ,   s u c h   a s   c o n t a i n e r d   o r   C R I - O .   A   K u b e r n e t e s   c l u s t e r   t h a t   h a n d l e s   p r o d u c t i o n   t r a f f i c   s h o u l d   h a v e   a   m i n i m u m   o f   t h r e e   n o d e s   b e c a u s e   i f   o n e   n o d e   g o e s   d o w n ,   b o t h   a n   e t c d   m e m b e r   a n d   a   c o n t r o l   p l a n e   i n s t a n c e   a r e   l o s t ,   a n d   r e d u n d a n c y   i s   c o m p r o m i s e d .   Y o u   c a n   m i t i g a t e   t h i s   r i s k   b y   a d d i n g   m o r e   c o n t r o l   p l a n e   n o d e s .   W h e n   y o u   d e p l o y   a p p l i c a t i o n s   o n   K u b e r n e t e s ,   y o u   t e l l   t h e   c o n t r o l   p l a n e   t o   s t a r t   t h e   a p p l i c a t i o n   c o n t a i n e r s .   T h e   c o n t r o l   p l a n e   s c h e d u l e s   t h e   c o n t a i n e r s   t o   r u n   o n   t h e   c l u s t e


Question: What is What's next?

Answer: T u t o r i a l   H e l l o   M i n i k u b e . L e a r n   m o r e   a b o u t   C l u s t e r   A r c h i t e c t u r e .


Question: What is Objectives?

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


Question: What is Note:?

Answer: O n c e   y o u   h a v e   a   r u n n i n g   K u b e r n e t e s   c l u s t e r ,   y o u   c a n   d e p l o y   y o u r   c o n t a i n e r i z e d   a p p l i c a t i o n s   o n   t o p   o f   i t .   T o   d o   s o ,   y o u   c r e a t e   a   K u b e r n e t e s   D e p l o y m e n t .   T h e   D e p l o y m e n t   i n s t r u c t s   K u b e r n e t e s   h o w   t o   c r e a t e   a n d   u p d a t e   i n s t a n c e s   o f   y o u r   a p p l i c a t i o n .   O n c e   y o u ' v e   c r e a t e d   a   D e p l o y m e n t ,   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 e   a p p l i c a t i o n   i n s t a n c e s   i n c l u d e d   i n   t h a t   D e p l o y m e n t   t o   r u n   o n   i n d i v i d u a l   N o d e s   i n   t h e   c l u s t e r .   O n c e   t h e   a p p l i c a t i o n   i n s t a n c e s   a r e   c r e a t e d ,   a   K u b e r n e t e s   D e p l o y m e n t   c o n t r o l l e r   c o n t i n u o u s l y   m o n i t o r s   t h o s e   i n s t a n c e s .   I f   t h e   N o d e   h o s t i n g   a n   i n s t a n c e   g o e s   d o w n   o r   i s   d e l e t e d ,   t h e   D e p l o y m e n t   c o n t r o l l e r   r e p l a c e s   t h e   i n s t a n c e   w i t h   a n   i n s t a n c e   o n   a n o t h e r   N o d e   i n   t h e   c l u s t e r .   T h i s   p r o v i d e s   a   s e l f - h e a l i n g   m e c h a n i s m   t o   a d d r e s s   m a c h i n e   f a i l u r e   o r   m a i n t e n a n c e .   I n   a   p r e - o r c h e s t r a t i o n   w o r l d ,   i n s t a l l a t i o n   s c r i p t s   w o u l d   o f t e n   b e   u s e d   t o   s t a r t   a p p l i c a t i o n s ,   b u t   t h e y   d i d   n o t   a l l o w   r e c o v e r y   f r o m   m a c h i n e   f a i l u r e .   B y   b o t h   c r e a t i n g   y o u r   a p p l i c a t i o n   i n s t a n c e s   a n d   k e e p i n g   t h e m   r u n n i n g   a c r o s s   N o d e s ,   K u


Question: What is Deploying your first app on Kubernetes?

Answer: Y o u   c a n   c r e a t e   a n d   m a n a g e   a   D e p l o y m e n t   b y   u s i n g   t h e   K u b e r n e t e s   c o m m a n d   l i n e   i n t e r f a c e ,   k u b e c t l .   k u b e c t l   u s e s   t h e   K u b e r n e t e s   A P I   t o   i n t e r a c t   w i t h   t h e   c l u s t e r .   I n   t h i s   m o d u l e ,   y o u ' l l   l e a r n   t h e   m o s t   c o m m o n   k u b e c t l   c o m m a n d s   n e e d e d   t o   c r e a t e   D e p l o y m e n t s   t h a t   r u n   y o u r   a p p l i c a t i o n s   o n   a   K u b e r n e t e s   c l u s t e r .   W h e n   y o u   c r e a t e   a   D e p l o y m e n t ,   y o u ' l l   n e e d   t o   s p e c i f y   t h e   c o n t a i n e r   i m a g e   f o r   y o u r   a p p l i c a t i o n   a n d   t h e   n u m b e r   o f   r e p l i c a s   t h a t   y o u   w a n t   t o   r u n .   Y o u   c a n   c h a n g e   t h a t   i n f o r m a t i o n   l a t e r   b y   u p d a t i n g   y o u r   D e p l o y m e n t ;   M o d u l e   5   a n d   M o d u l e   6   o f   t h e   b o o t c a m p   d i s c u s s   h o w   y o u   c a n   s c a l e   a n d   u p d a t e   y o u r   D e p l o y m e n t s .   F o r   y o u r   f i r s t   D e p l o y m e n t ,   y o u ' l l   u s e   a   h e l l o - n o d e   a p p l i c a t i o n   p a c k a g e d   i n   a   D o c k e r   c o n t a i n e r   t h a t   u s e s   N G I N X   t o   e c h o   b a c k   a l l   t h e   r e q u e s t s .   ( I f   y o u   d i d n ' t   a l r e a d y   t r y   c r e a t i n g   a   h e l l o - n o d e   a p p l i c a t i o n   a n d   d e p l o y i n g   i t   u s i n g   a   c o n t a i n e r ,   y o u   c a n   d o   t h a t   f i r s t   b y   f o l l o w i n g   t h e   i n s t r u c t i o n s   f r o m   t h e   H e l l o   M i n i k u b e   t u t o r i a l . )   Y o u   w i l l   n e e d   t o   h a v e   i n s t a l l e d   k u b e c t l   a s   w e l l .   I f   y o u   n e e d   t o   i n s t a l l


Question: What is kubectl basics?

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


Question: What is Deploy an app?

Answer: L e t ’ s   d e p l o y   o u r   f i r s t   a p p   o n   K u b e r n e t e s   w i t h   t h e   k u b e c t l   c r e a t e   d e p l o y m e n t   c o m m a n d .   W e   n e e d   t o   p r o v i d e   t h e   d e p l o y m e n t   n a m e   a n d   a p p   i m a g e   l o c a t i o n   ( i n c l u d e   t h e   f u l l   r e p o s i t o r y   u r l   f o r   i m a g e s   h o s t e d   o u t s i d e   D o c k e r   H u b ) .   k u b e c t l   c r e a t e   d e p l o y m e n t   k u b e r n e t e s - b o o t c a m p   - - i m a g e = g c r . i o / g o o g l e - s a m p l e s / k u b e r n e t e s - b o o t c a m p : v 1   G r e a t !   Y o u   j u s t   d e p l o y e d   y o u r   f i r s t   a p p l i c a t i o n   b y   c r e a t i n g   a   d e p l o y m e n t .   T h i s   p e r f o r m e d   a   f e w   t h i n g s   f o r   y o u :   s e a r c h e d   f o r   a   s u i t a b l e   n o d e   w h e r e   a n   i n s t a n c e   o f   t h e   a p p l i c a t i o n   c o u l d   b e   r u n   ( w e   h a v e   o n l y   1   a v a i l a b l e   n o d e ) s c h e d u l e d   t h e   a p p l i c a t i o n   t o   r u n   o n   t h a t   N o d e c o n f i g u r e d   t h e   c l u s t e r   t o   r e s c h e d u l e   t h e   i n s t a n c e   o n   a   n e w   N o d e   w h e n   n e e d e d   T o   l i s t   y o u r   d e p l o y m e n t s   u s e   t h e   k u b e c t l   g e t   d e p l o y m e n t s   c o m m a n d :   k u b e c t l   g e t   d e p l o y m e n t s   W e   s e e   t h a t   t h e r e   i s   1   d e p l o y m e n t   r u n n i n g   a   s i n g l e   i n s t a n c e   o f   y o u r   a p p .   T h e   i n s t a n c e   i s   r u n n i n g   i n s i d e   a   c o n t a i n e r   o n   y o u r   n o d e .


Question: What is View the app?

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


Question: What is Note:?

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


Question: What is What's next?

Answer: T u t o r i a l   V i e w i n g   P o d s   a n d   N o d e s . L e a r n   m o r e   a b o u t   D e p l o y m e n t s .


Question: What is Objectives?

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


Question: What is Kubernetes Pods?

Answer: W h e n   y o u   c r e a t e d   a   D e p l o y m e n t   i n   M o d u l e   2 ,   K u b e r n e t e s   c r e a t e d   a   P o d   t o   h o s t   y o u r   a p p l i c a t i o n   i n s t a n c e .   A   P o d   i s   a   K u b e r n e t e s   a b s t r a c t i o n   t h a t   r e p r e s e n t s   a   g r o u p   o f   o n e   o r   m o r e   a p p l i c a t i o n   c o n t a i n e r s   ( s u c h   a s   D o c k e r ) ,   a n d   s o m e   s h a r e d   r e s o u r c e s   f o r   t h o s e   c o n t a i n e r s .   T h o s e   r e s o u r c e s   i n c l u d e :   S h a r e d   s t o r a g e ,   a s   V o l u m e s N e t w o r k i n g ,   a s   a   u n i q u e   c l u s t e r   I P   a d d r e s s I n f o r m a t i o n   a b o u t   h o w   t o   r u n   e a c h   c o n t a i n e r ,   s u c h   a s   t h e   c o n t a i n e r   i m a g e   v e r s i o n   o r   s p e c i f i c   p o r t s   t o   u s e   A   P o d   m o d e l s   a n   a p p l i c a t i o n - s p e c i f i c   " l o g i c a l   h o s t "   a n d   c a n   c o n t a i n   d i f f e r e n t   a p p l i c a t i o n   c o n t a i n e r s   w h i c h   a r e   r e l a t i v e l y   t i g h t l y   c o u p l e d .   F o r   e x a m p l e ,   a   P o d   m i g h t   i n c l u d e   b o t h   t h e   c o n t a i n e r   w i t h   y o u r   N o d e . j s   a p p   a s   w e l l   a s   a   d i f f e r e n t   c o n t a i n e r   t h a t   f e e d s   t h e   d a t a   t o   b e   p u b l i s h e d   b y   t h e   N o d e . j s   w e b s e r v e r .   T h e   c o n t a i n e r s   i n   a   P o d   s h a r e   a n   I P   A d d r e s s   a n d   p o r t   s p a c e ,   a r e   a l w a y s   c o - l o c a t e d   a n d   c o - s c h e d u l e d ,   a n d   r u n   i n   a   s h a r e d   c o n t e x t   o n   t h e   s a m e   N o d e .   P o d s   a r e   t h e   a t o m i c   u n i t   o n   t h e   K u b e r n e t e s   p l a t f o r m .   W h e n   w e   c r e a t e   a   D e p l o y m e n t   o


Question: What is Nodes?

Answer: A   P o d   a l w a y s   r u n s   o n   a   N o d e .   A   N o d e   i s   a   w o r k e r   m a c h i n e   i n   K u b e r n e t e s   a n d   m a y   b e   e i t h e r   a   v i r t u a l   o r   a   p h y s i c a l   m a c h i n e ,   d e p e n d i n g   o n   t h e   c l u s t e r .   E a c h   N o d e   i s   m a n a g e d   b y   t h e   c o n t r o l   p l a n e .   A   N o d e   c a n   h a v e   m u l t i p l e   p o d s ,   a n d   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   a u t o m a t i c a l l y   h a n d l e s   s c h e d u l i n g   t h e   p o d s   a c r o s s   t h e   N o d e s   i n   t h e   c l u s t e r .   T h e   c o n t r o l   p l a n e ' s   a u t o m a t i c   s c h e d u l i n g   t a k e s   i n t o   a c c o u n t   t h e   a v a i l a b l e   r e s o u r c e s   o n   e a c h   N o d e .   E v e r y   K u b e r n e t e s   N o d e   r u n s   a t   l e a s t :   K u b e l e t ,   a   p r o c e s s   r e s p o n s i b l e   f o r   c o m m u n i c a t i o n   b e t w e e n   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   a n d   t h e   N o d e ;   i t   m a n a g e s   t h e   P o d s   a n d   t h e   c o n t a i n e r s   r u n n i n g   o n   a   m a c h i n e . A   c o n t a i n e r   r u n t i m e   ( l i k e   D o c k e r )   r e s p o n s i b l e   f o r   p u l l i n g   t h e   c o n t a i n e r   i m a g e   f r o m   a   r e g i s t r y ,   u n p a c k i n g   t h e   c o n t a i n e r ,   a n d   r u n n i n g   t h e   a p p l i c a t i o n .   K u b e l e t ,   a   p r o c e s s   r e s p o n s i b l e   f o r   c o m m u n i c a t i o n   b e t w e e n   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   a n d   t h e   N o d e ;   i t   m a n a g e s   t h e   P o d s   a n d   t h e   c o n t a i n e r s   r u n n i n g   o n   a   m a c h i n e .   A   c o n t a i n e r   r u n t i m e   ( l i k e   D o c k e r )   r e s p o n s i b l e   f o r   p u l l i n g   t h e   c o n t


Question: What is Troubleshooting with kubectl?

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


Question: What is Check application configuration?

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


Question: What is Show the app in the terminal?

Answer: R e c a l l   t h a t   P o d s   a r e   r u n n i n g   i n   a n   i s o l a t e d ,   p r i v a t e   n e t w o r k   -   s o   w e   n e e d   t o   p r o x y   a c c e s s   t o   t h e m   s o   w e   c a n   d e b u g   a n d   i n t e r a c t   w i t h   t h e m .   T o   d o   t h i s ,   w e ' l l   u s e   t h e   k u b e c t l   p r o x y   c o m m a n d   t o   r u n   a   p r o x y   i n   a   s e c o n d   t e r m i n a l .   O p e n   a   n e w   t e r m i n a l   w i n d o w ,   a n d   i n   t h a t   n e w   t e r m i n a l ,   r u n :   k u b e c t l   p r o x y   N o w   a g a i n ,   w e ' l l   g e t   t h e   P o d   n a m e   a n d   q u e r y   t h a t   p o d   d i r e c t l y   t h r o u g h   t h e   p r o x y .   T o   g e t   t h e   P o d   n a m e   a n d   s t o r e   i t   i n   t h e   P O D _ N A M E   e n v i r o n m e n t   v a r i a b l e :   e x p o r t   P O D _ N A M E = " $ ( k u b e c t l   g e t   p o d s   - o   g o - t e m p l a t e   - - t e m p l a t e   ' { { r a n g e   . i t e m s } } { { . m e t a d a t a . n a m e } } { { " \ n " } } { { e n d } } ' ) "   e c h o   N a m e   o f   t h e   P o d :   $ P O D _ N A M E   T o   s e e   t h e   o u t p u t   o f   o u r   a p p l i c a t i o n ,   r u n   a   c u r l   r e q u e s t :   c u r l   h t t p : / / l o c a l h o s t : 8 0 0 1 / a p i / v 1 / n a m e s p a c e s / d e f a u l t / p o d s / $ P O D _ N A M E : 8 0 8 0 / p r o x y /   T h e   U R L   i s   t h e   r o u t e   t o   t h e   A P I   o f   t h e   P o d .


Question: What is Executing commands on the container?

Answer: W e   c a n   e x e c u t e   c o m m a n d s   d i r e c t l y   o n   t h e   c o n t a i n e r   o n c e   t h e   P o d   i s   u p   a n d   r u n n i n g .   F o r   t h i s ,   w e   u s e   t h e   e x e c   s u b c o m m a n d   a n d   u s e   t h e   n a m e   o f   t h e   P o d   a s   a   p a r a m e t e r .   L e t ’ s   l i s t   t h e   e n v i r o n m e n t   v a r i a b l e s :   k u b e c t l   e x e c   " $ P O D _ N A M E "   - -   e n v   A g a i n ,   i t ' s   w o r t h   m e n t i o n i n g   t h a t   t h e   n a m e   o f   t h e   c o n t a i n e r   i t s e l f   c a n   b e   o m i t t e d   s i n c e   w e   o n l y   h a v e   a   s i n g l e   c o n t a i n e r   i n   t h e   P o d .   N e x t   l e t ’ s   s t a r t   a   b a s h   s e s s i o n   i n   t h e   P o d ’ s   c o n t a i n e r :   k u b e c t l   e x e c   - t i   $ P O D _ N A M E   - -   b a s h   W e   h a v e   n o w   a n   o p e n   c o n s o l e   o n   t h e   c o n t a i n e r   w h e r e   w e   r u n   o u r   N o d e J S   a p p l i c a t i o n .   T h e   s o u r c e   c o d e   o f   t h e   a p p   i s   i n   t h e   s e r v e r . j s   f i l e :   c a t   s e r v e r . j s   Y o u   c a n   c h e c k   t h a t   t h e   a p p l i c a t i o n   i s   u p   b y   r u n n i n g   a   c u r l   c o m m a n d :   c u r l   h t t p : / / l o c a l h o s t : 8 0 8 0


Question: What is Note:?

Answer: T o   c l o s e   y o u r   c o n t a i n e r   c o n n e c t i o n ,   t y p e   e x i t .


Question: What is What's next?

Answer: T u t o r i a l   U s i n g   A   S e r v i c e   T o   E x p o s e   Y o u r   A p p . L e a r n   m o r e   a b o u t   P o d s . L e a r n   m o r e   a b o u t   N o d e s .


Question: What is Objectives?

Answer: L e a r n   a b o u t   a   S e r v i c e   i n   K u b e r n e t e s . U n d e r s t a n d   h o w   l a b e l s   a n d   s e l e c t o r s   r e l a t e   t o   a   S e r v i c e . E x p o s e   a n   a p p l i c a t i o n   o u t s i d e   a   K u b e r n e t e s   c l u s t e r .


Question: What is Overview of Kubernetes Services?

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


Question: What is Services and Labels?

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


Question: What is Step 1: Creating a new Service?

Answer: L e t ’ s   v e r i f y   t h a t   o u r   a p p l i c a t i o n   i s   r u n n i n g .   W e ’ l l   u s e   t h e   k u b e c t l   g e t   c o m m a n d   a n d   l o o k   f o r   e x i s t i n g   P o d s :   k u b e c t l   g e t   p o d s   I f   n o   P o d s   a r e   r u n n i n g   t h e n   i t   m e a n s   t h e   o b j e c t s   f r o m   t h e   p r e v i o u s   t u t o r i a l s   w e r e   c l e a n e d   u p .   I n   t h i s   c a s e ,   g o   b a c k   a n d   r e c r e a t e   t h e   d e p l o y m e n t   f r o m   t h e   U s i n g   k u b e c t l   t o   c r e a t e   a   D e p l o y m e n t   t u t o r i a l .   P l e a s e   w a i t   a   c o u p l e   o f   s e c o n d s   a n d   l i s t   t h e   P o d s   a g a i n .   Y o u   c a n   c o n t i n u e   o n c e   y o u   s e e   t h e   o n e   P o d   r u n n i n g .   N e x t ,   l e t ’ s   l i s t   t h e   c u r r e n t   S e r v i c e s   f r o m   o u r   c l u s t e r :   k u b e c t l   g e t   s e r v i c e s   T o   e x p o s e   t h e   d e p l o y m e n t   t o   e x t e r n a l   t r a f f i c ,   w e ' l l   u s e   t h e   k u b e c t l   e x p o s e   c o m m a n d   w i t h   t h e   - - t y p e = N o d e P o r t   o p t i o n :   k u b e c t l   e x p o s e   d e p l o y m e n t / k u b e r n e t e s - b o o t c a m p   - - t y p e = " N o d e P o r t "   - - p o r t   8 0 8 0   W e   h a v e   n o w   a   r u n n i n g   S e r v i c e   c a l l e d   k u b e r n e t e s - b o o t c a m p .   H e r e   w e   s e e   t h a t   t h e   S e r v i c e   r e c e i v e d   a   u n i q u e   c l u s t e r - I P ,   a n   i n t e r n a l   p o r t   a n d   a n   e x t e r n a l - I P   ( t h e   I P   o f   t h e   N o d e ) .   T o   f i n d   o u t   w h a t   p o r t   w a s   o p e n e d   e x t e r n a l l y   ( f o r   t h e   t y p e :   N o d e P o r t   S e r v i c e )   w e ’ l l   r u n   t h e   d e s c r i b e   s e r v i c e   s u b c o m m a n d :   k u b


Question: What is Note:?

Answer: I f   y o u ' r e   r u n n i n g   m i n i k u b e   w i t h   D o c k e r   D e s k t o p   a s   t h e   c o n t a i n e r   d r i v e r ,   a   m i n i k u b e   t u n n e l   i s   n e e d e d .   T h i s   i s   b e c a u s e   c o n t a i n e r s   i n s i d e   D o c k e r   D e s k t o p   a r e   i s o l a t e d   f r o m   y o u r   h o s t   c o m p u t e r .   I n   a   s e p a r a t e   t e r m i n a l   w i n d o w ,   e x e c u t e :   m i n i k u b e   s e r v i c e   k u b e r n e t e s - b o o t c a m p   - - u r l   T h e   o u t p u t   l o o k s   l i k e   t h i s :   h t t p : / / 1 2 7 . 0 . 0 . 1 : 5 1 0 8 2   !   B e c a u s e   y o u   a r e   u s i n g   a   D o c k e r   d r i v e r   o n   d a r w i n ,   t h e   t e r m i n a l   n e e d s   t o   b e   o p e n   t o   r u n   i t .   T h e n   u s e   t h e   g i v e n   U R L   t o   a c c e s s   t h e   a p p :   c u r l   1 2 7 . 0 . 0 . 1 : 5 1 0 8 2   A n d   w e   g e t   a   r e s p o n s e   f r o m   t h e   s e r v e r .   T h e   S e r v i c e   i s   e x p o s e d .


Question: What is Step 2: Using labels?

Answer: T h e   D e p l o y m e n t   c r e a t e d   a u t o m a t i c a l l y   a   l a b e l   f o r   o u r   P o d .   W i t h   t h e   d e s c r i b e   d e p l o y m e n t   s u b c o m m a n d   y o u   c a n   s e e   t h e   n a m e   ( t h e   k e y )   o f   t h a t   l a b e l :   k u b e c t l   d e s c r i b e   d e p l o y m e n t   L e t ’ s   u s e   t h i s   l a b e l   t o   q u e r y   o u r   l i s t   o f   P o d s .   W e ’ l l   u s e   t h e   k u b e c t l   g e t   p o d s   c o m m a n d   w i t h   - l   a s   a   p a r a m e t e r ,   f o l l o w e d   b y   t h e   l a b e l   v a l u e s :   k u b e c t l   g e t   p o d s   - l   a p p = k u b e r n e t e s - b o o t c a m p   Y o u   c a n   d o   t h e   s a m e   t o   l i s t   t h e   e x i s t i n g   S e r v i c e s :   k u b e c t l   g e t   s e r v i c e s   - l   a p p = k u b e r n e t e s - b o o t c a m p   G e t   t h e   n a m e   o f   t h e   P o d   a n d   s t o r e   i t   i n   t h e   P O D _ N A M E   e n v i r o n m e n t   v a r i a b l e :   e x p o r t   P O D _ N A M E = " $ ( k u b e c t l   g e t   p o d s   - o   g o - t e m p l a t e   - - t e m p l a t e   ' { { r a n g e   . i t e m s } } { { . m e t a d a t a . n a m e } } { { " \ n " } } { { e n d } } ' ) "   e c h o   " N a m e   o f   t h e   P o d :   $ P O D _ N A M E "   T o   a p p l y   a   n e w   l a b e l   w e   u s e   t h e   l a b e l   s u b c o m m a n d   f o l l o w e d   b y   t h e   o b j e c t   t y p e ,   o b j e c t   n a m e   a n d   t h e   n e w   l a b e l :   k u b e c t l   l a b e l   p o d s   " $ P O D _ N A M E "   v e r s i o n = v 1   T h i s   w i l l   a p p l y   a   n e w   l a b e l   t o   o u r   P o d   ( w e   p i n n e d   t h e   a p p l i c a t i o n   v e r s i o n   t o   t h e   P o d ) ,   a n d   w e   c a n   c h e c k   i t   w i t h   t h e   d e s c r i b e   p o d   c o m m a n d :   k u b e c t l   d e s c r i b e   p o d s   " $ P O D _ N A