Question: What is Overall approach?

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


Question: What is 0. Decide whether Pod Security Admission is right for you?

Answer: P o d   S e c u r i t y   A d m i s s i o n   w a s   d e s i g n e d   t o   m e e t   t h e   m o s t   c o m m o n   s e c u r i t y   n e e d s   o u t   o f   t h e   b o x ,   a n d   t o   p r o v i d e   a   s t a n d a r d   s e t   o f   s e c u r i t y   l e v e l s   a c r o s s   c l u s t e r s .   H o w e v e r ,   i t   i s   l e s s   f l e x i b l e   t h a n   P o d S e c u r i t y P o l i c y .   N o t a b l y ,   t h e   f o l l o w i n g   f e a t u r e s   a r e   s u p p o r t e d   b y   P o d S e c u r i t y P o l i c y   b u t   n o t   P o d   S e c u r i t y   A d m i s s i o n :   S e t t i n g   d e f a u l t   s e c u r i t y   c o n s t r a i n t s   -   P o d   S e c u r i t y   A d m i s s i o n   i s   a   n o n - m u t a t i n g   a d m i s s i o n   c o n t r o l l e r ,   m e a n i n g   i t   w o n ' t   m o d i f y   p o d s   b e f o r e   v a l i d a t i n g   t h e m .   I f   y o u   w e r e   r e l y i n g   o n   t h i s   a s p e c t   o f   P S P ,   y o u   w i l l   n e e d   t o   e i t h e r   m o d i f y   y o u r   w o r k l o a d s   t o   m e e t   t h e   P o d   S e c u r i t y   c o n s t r a i n t s ,   o r   u s e   a   M u t a t i n g   A d m i s s i o n   W e b h o o k   t o   m a k e   t h o s e   c h a n g e s .   S e e   S i m p l i f y   &   S t a n d a r d i z e   P o d S e c u r i t y P o l i c i e s   b e l o w   f o r   m o r e   d e t a i l . F i n e - g r a i n e d   c o n t r o l   o v e r   p o l i c y   d e f i n i t i o n   -   P o d   S e c u r i t y   A d m i s s i o n   o n l y   s u p p o r t s   3   s t a n d a r d   l e v e l s .   I f   y o u   r e q u i r e   m o r e   c o n t r o l   o v e r   s p e c i f i c   c o n s t r a i n t s ,   t h e n   y o u   w i l l   n e e d   t o   u s e   a   V a l i d a t i n g   A d m i s s i o n   W e b h o o k   t o   e n f o r c e   t h o s e   p o l i c i e s . S u b - n a m e s p a c e   p o l i c y   g r a n u l a r i t y   -   P o d S e c


Question: What is 1. Review namespace permissions?

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


Question: What is 2. Simplify & standardize PodSecurityPolicies?

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


Question: What is 2.a. Eliminate purely mutating fields?

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


Question: What is 2.b. Eliminate options not covered by the Pod Security Standards?

Answer: T h e r e   a r e   s e v e r a l   f i e l d s   i n   P o d S e c u r i t y P o l i c y   t h a t   a r e   n o t   c o v e r e d   b y   t h e   P o d   S e c u r i t y   S t a n d a r d s .   I f   y o u   m u s t   e n f o r c e   t h e s e   o p t i o n s ,   y o u   w i l l   n e e d   t o   s u p p l e m e n t   P o d   S e c u r i t y   A d m i s s i o n   w i t h   a n   a d m i s s i o n   w e b h o o k ,   w h i c h   i s   o u t s i d e   t h e   s c o p e   o f   t h i s   g u i d e .   F i r s t ,   y o u   c a n   r e m o v e   t h e   p u r e l y   v a l i d a t i n g   f i e l d s   t h a t   t h e   P o d   S e c u r i t y   S t a n d a r d s   d o   n o t   c o v e r .   T h e s e   f i e l d s   ( a l s o   l i s t e d   i n   t h e   M a p p i n g   P o d S e c u r i t y P o l i c i e s   t o   P o d   S e c u r i t y   S t a n d a r d s   r e f e r e n c e   w i t h   " n o   o p i n i o n " )   a r e :   . s p e c . a l l o w e d H o s t P a t h s . s p e c . a l l o w e d F l e x V o l u m e s . s p e c . a l l o w e d C S I D r i v e r s . s p e c . f o r b i d d e n S y s c t l s . s p e c . r u n t i m e C l a s s   Y o u   c a n   a l s o   r e m o v e   t h e   f o l l o w i n g   f i e l d s ,   t h a t   a r e   r e l a t e d   t o   P O S I X   /   U N I X   g r o u p   c o n t r o l s .


Question: What is Caution:?

Answer: . s p e c . r u n A s G r o u p . s p e c . s u p p l e m e n t a l G r o u p s . s p e c . f s G r o u p   T h e   r e m a i n i n g   m u t a t i n g   f i e l d s   a r e   r e q u i r e d   t o   p r o p e r l y   s u p p o r t   t h e   P o d   S e c u r i t y   S t a n d a r d s ,   a n d   w i l l   n e e d   t o   b e   h a n d l e d   o n   a   c a s e - b y - c a s e   b a s i s   l a t e r :   . s p e c . r e q u i r e d D r o p C a p a b i l i t i e s   -   R e q u i r e d   t o   d r o p   A L L   f o r   t h e   R e s t r i c t e d   p r o f i l e . . s p e c . s e L i n u x   -   ( O n l y   m u t a t i n g   w i t h   t h e   M u s t R u n A s   r u l e )   r e q u i r e d   t o   e n f o r c e   t h e   S E L i n u x   r e q u i r e m e n t s   o f   t h e   B a s e l i n e   &   R e s t r i c t e d   p r o f i l e s . . s p e c . r u n A s U s e r   -   ( N o n - m u t a t i n g   w i t h   t h e   R u n A s A n y   r u l e )   r e q u i r e d   t o   e n f o r c e   R u n A s N o n R o o t   f o r   t h e   R e s t r i c t e d   p r o f i l e . . s p e c . a l l o w P r i v i l e g e E s c a l a t i o n   -   ( O n l y   m u t a t i n g   i f   s e t   t o   f a l s e )   r e q u i r e d   f o r   t h e   R e s t r i c t e d   p r o f i l e .


Question: What is 2.c. Rollout the updated PSPs?

Answer: N e x t ,   y o u   c a n   r o l l o u t   t h e   u p d a t e d   p o l i c i e s   t o   y o u r   c l u s t e r .   Y o u   s h o u l d   p r o c e e d   w i t h   c a u t i o n ,   a s   r e m o v i n g   t h e   m u t a t i n g   o p t i o n s   m a y   r e s u l t   i n   w o r k l o a d s   m i s s i n g   r e q u i r e d   c o n f i g u r a t i o n .   F o r   e a c h   u p d a t e d   P o d S e c u r i t y P o l i c y :   I d e n t i f y   p o d s   r u n n i n g   u n d e r   t h e   o r i g i n a l   P S P .   T h i s   c a n   b e   d o n e   u s i n g   t h e   k u b e r n e t e s . i o / p s p   a n n o t a t i o n .   F o r   e x a m p l e ,   u s i n g   k u b e c t l : P S P _ N A M E = " o r i g i n a l "   #   S e t   t h e   n a m e   o f   t h e   P S P   y o u ' r e   c h e c k i n g   f o r   k u b e c t l   g e t   p o d s   - - a l l - n a m e s p a c e s   - o   j s o n p a t h = " { r a n g e   . i t e m s [ ? ( @ . m e t a d a t a . a n n o t a t i o n s . k u b e r n e t e s \ . i o \ / p s p = = ' $ P S P _ N A M E ' ) ] } { . m e t a d a t a . n a m e s p a c e }   { . m e t a d a t a . n a m e } { ' \ n ' } { e n d } "   C o m p a r e   t h e s e   r u n n i n g   p o d s   a g a i n s t   t h e   o r i g i n a l   p o d   s p e c   t o   d e t e r m i n e   w h e t h e r   P o d S e c u r i t y P o l i c y   h a s   m o d i f i e d   t h e   p o d .   F o r   p o d s   c r e a t e d   b y   a   w o r k l o a d   r e s o u r c e   y o u   c a n   c o m p a r e   t h e   p o d   w i t h   t h e   P o d T e m p l a t e   i n   t h e   c o n t r o l l e r   r e s o u r c e .   I f   a n y   c h a n g e s   a r e   i d e n t i f i e d ,   t h e   o r i g i n a l   P o d   o r   P o d T e m p l a t e   s h o u l d   b e   u p d a t e d   w i t h   t h e   d e s i r e d   c o n f i g u r a t i o n .   T h e   f i e l d s   t o   r e v i e w   a r e : . m e t a d a t a . a n n o t a t i o n s [ ' c o n t a i n e r . a p p a r m o r . s e c


Question: What is 3. Update Namespaces?

Answer: T h e   f o l l o w i n g   s t e p s   w i l l   n e e d   t o   b e   p e r f o r m e d   o n   e v e r y   n a m e s p a c e   i n   t h e   c l u s t e r .   C o m m a n d s   r e f e r e n c e d   i n   t h e s e   s t e p s   u s e   t h e   $ N A M E S P A C E   v a r i a b l e   t o   r e f e r   t o   t h e   n a m e s p a c e   b e i n g   u p d a t e d .


Question: What is 3.a. Identify an appropriate Pod Security level?

Answer: S t a r t   r e v i e w i n g   t h e   P o d   S e c u r i t y   S t a n d a r d s   a n d   f a m i l i a r i z i n g   y o u r s e l f   w i t h   t h e   3   d i f f e r e n t   l e v e l s .   T h e r e   a r e   s e v e r a l   w a y s   t o   c h o o s e   a   P o d   S e c u r i t y   l e v e l   f o r   y o u r   n a m e s p a c e :   B y   s e c u r i t y   r e q u i r e m e n t s   f o r   t h e   n a m e s p a c e   -   I f   y o u   a r e   f a m i l i a r   w i t h   t h e   e x p e c t e d   a c c e s s   l e v e l   f o r   t h e   n a m e s p a c e ,   y o u   c a n   c h o o s e   a n   a p p r o p r i a t e   l e v e l   b a s e d   o n   t h o s e   r e q u i r e m e n t s ,   s i m i l a r   t o   h o w   o n e   m i g h t   a p p r o a c h   t h i s   o n   a   n e w   c l u s t e r . B y   e x i s t i n g   P o d S e c u r i t y P o l i c i e s   -   U s i n g   t h e   M a p p i n g   P o d S e c u r i t y P o l i c i e s   t o   P o d   S e c u r i t y   S t a n d a r d s   r e f e r e n c e   y o u   c a n   m a p   e a c h   P S P   t o   a   P o d   S e c u r i t y   S t a n d a r d   l e v e l .   I f   y o u r   P S P s   a r e n ' t   b a s e d   o n   t h e   P o d   S e c u r i t y   S t a n d a r d s ,   y o u   m a y   n e e d   t o   d e c i d e   b e t w e e n   c h o o s i n g   a   l e v e l   t h a t   i s   a t   l e a s t   a s   p e r m i s s i v e   a s   t h e   P S P ,   a n d   a   l e v e l   t h a t   i s   a t   l e a s t   a s   r e s t r i c t i v e .   Y o u   c a n   s e e   w h i c h   P S P s   a r e   i n   u s e   f o r   p o d s   i n   a   g i v e n   n a m e s p a c e   w i t h   t h i s   c o m m a n d : k u b e c t l   g e t   p o d s   - n   $ N A M E S P A C E   - o   j s o n p a t h = " { . i t e m s [ * ] . m e t a d a t a . a n n o t a t i o n s . k u b e r n e t e s \ . i o \ / p s p } "   |   t r   "   "   " \ n "   |   s o r t   - u   B y   e x i s t i n g   p o d s   -   U s i n g   t h e   s t


Question: What is 3.b. Verify the Pod Security level?

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


Question: What is 3.c. Enforce the Pod Security level?

Answer: W h e n   y o u   a r e   s a t i s f i e d   t h a t   t h e   c h o s e n   l e v e l   c a n   s a f e l y   b e   e n f o r c e d   o n   t h e   n a m e s p a c e ,   y o u   c a n   u p d a t e   t h e   n a m e s p a c e   t o   e n f o r c e   t h e   d e s i r e d   l e v e l :   k u b e c t l   l a b e l   - - o v e r w r i t e   n s   $ N A M E S P A C E   p o d - s e c u r i t y . k u b e r n e t e s . i o / e n f o r c e = $ L E V E L


Question: What is 3.d. Bypass PodSecurityPolicy?

Answer: F i n a l l y ,   y o u   c a n   e f f e c t i v e l y   b y p a s s   P o d S e c u r i t y P o l i c y   a t   t h e   n a m e s p a c e   l e v e l   b y   b i n d i n g   t h e   f u l l y   p r i v i l e g e d   P S P   t o   a l l   s e r v i c e   a c c o u n t s   i n   t h e   n a m e s p a c e .   #   T h e   f o l l o w i n g   c l u s t e r - s c o p e d   c o m m a n d s   a r e   o n l y   n e e d e d   o n c e .   k u b e c t l   a p p l y   - f   p r i v i l e g e d - p s p . y a m l   k u b e c t l   c r e a t e   c l u s t e r r o l e   p r i v i l e g e d - p s p   - - v e r b   u s e   - - r e s o u r c e   p o d s e c u r i t y p o l i c i e s . p o l i c y   - - r e s o u r c e - n a m e   p r i v i l e g e d   #   P e r - n a m e s p a c e   d i s a b l e   k u b e c t l   c r e a t e   - n   $ N A M E S P A C E   r o l e b i n d i n g   d i s a b l e - p s p   - - c l u s t e r r o l e   p r i v i l e g e d - p s p   - - g r o u p   s y s t e m : s e r v i c e a c c o u n t s : $ N A M E S P A C E   S i n c e   t h e   p r i v i l e g e d   P S P   i s   n o n - m u t a t i n g ,   a n d   t h e   P S P   a d m i s s i o n   c o n t r o l l e r   a l w a y s   p r e f e r s   n o n - m u t a t i n g   P S P s ,   t h i s   w i l l   e n s u r e   t h a t   p o d s   i n   t h i s   n a m e s p a c e   a r e   n o   l o n g e r   b e i n g   m o d i f i e d   o r   r e s t r i c t e d   b y   P o d S e c u r i t y P o l i c y .   T h e   a d v a n t a g e   t o   d i s a b l i n g   P o d S e c u r i t y P o l i c y   o n   a   p e r - n a m e s p a c e   b a s i s   l i k e   t h i s   i s   i f   a   p r o b l e m   a r i s e s   y o u   c a n   e a s i l y   r o l l   t h e   c h a n g e   b a c k   b y   d e l e t i n g   t h e   R o l e B i n d i n g .   J u s t   m a k e   s u r e   t h e   p r e - e x i s t i n g   P o d S e c u r i t y P o l i c i e s   a r e   s t i l l   i n   p l a c e !   #   U n d o   P o d S e c u r i t y P o l


Question: What is 4. Review namespace creation processes?

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


Question: What is 5. Disable PodSecurityPolicy?

Answer: F i n a l l y ,   y o u ' r e   r e a d y   t o   d i s a b l e   P o d S e c u r i t y P o l i c y .   T o   d o   s o ,   y o u   w i l l   n e e d   t o   m o d i f y   t h e   a d m i s s i o n   c o n f i g u r a t i o n   o f   t h e   A P I   s e r v e r :   H o w   d o   I   t u r n   o f f   a n   a d m i s s i o n   c o n t r o l l e r ? .   T o   v e r i f y   t h a t   t h e   P o d S e c u r i t y P o l i c y   a d m i s s i o n   c o n t r o l l e r   i s   n o   l o n g e r   e n a b l e d ,   y o u   c a n   m a n u a l l y   r u n   a   t e s t   b y   i m p e r s o n a t i n g   a   u s e r   w i t h o u t   a c c e s s   t o   a n y   P o d S e c u r i t y P o l i c i e s   ( s e e   t h e   P o d S e c u r i t y P o l i c y   e x a m p l e ) ,   o r   b y   v e r i f y i n g   i n   t h e   A P I   s e r v e r   l o g s .   A t   s t a r t u p ,   t h e   A P I   s e r v e r   o u t p u t s   l o g   l i n e s   l i s t i n g   t h e   l o a d e d   a d m i s s i o n   c o n t r o l l e r   p l u g i n s :   I 0 2 1 8   0 0 : 5 9 : 4 4 . 9 0 3 3 2 9   1 3   p l u g i n s . g o : 1 5 8 ]   L o a d e d   1 6   m u t a t i n g   a d m i s s i o n   c o n t r o l l e r ( s )   s u c c e s s f u l l y   i n   t h e   f o l l o w i n g   o r d e r :   N a m e s p a c e L i f e c y c l e , L i m i t R a n g e r , S e r v i c e A c c o u n t , N o d e R e s t r i c t i o n , T a i n t N o d e s B y C o n d i t i o n , P r i o r i t y , D e f a u l t T o l e r a t i o n S e c o n d s , E x t e n d e d R e s o u r c e T o l e r a t i o n , P e r s i s t e n t V o l u m e L a b e l , D e f a u l t S t o r a g e C l a s s , S t o r a g e O b j e c t I n U s e P r o t e c t i o n , R u n t i m e C l a s s , D e f a u l t I n g r e s s C l a s s , M u t a t i n g A d m i s s i o n W e b h o o k .   I 0 2 1 8   0 0 : 5 9 : 4 4 . 9 0 3 3 5 0   1 3   p l u g i n s . g o : 1 6 1 ]   L o a d e d   1 4   v a l i d a t i n g   a d m i s s i o n   c o n t r o l l e r


Question: What is Access Applications in a Cluster?

Answer: This is the multi-page printable view of this section. Click here to print.Return to the regular view of this page.Access Applications in a ClusterConfigure load balancing, port forwarding, or setup firewall or DNS configurations to access applications in a cluster.1: Deploy and Access the Kubernetes Dashboard2: Accessing Clusters3: Configure Access to Multiple Clusters4: Use Port Forwarding to Access Applications in a Cluster5: Use a Service to Access an Application in a Cluster6: Connect a Frontend to a Backend Using Services7: Create an External Load Balancer8: List All Container Images Running in a Cluster9: Set up Ingress on Minikube with the NGINX Ingress Controller10: Communicate Between Containers in the Same Pod Using a Shared Volume11: Configure DNS for a Cluster12: Access Services Running on Clusters1 - Deploy and Access the Kubernetes DashboardDeploy the web UI (Kubernetes Dashboard) and access it.Dashboard is a web-based Kubernetes user interface. You can use Dashboard to deploy containerized applications to a Kubernetes cluster, troubleshoot your containerized application, and manage the cluster resources. You can use Dashboard to get an overview of applications running on your cluster, as well as for creating or modifying individual Kubernetes resources (such as Deployments, Jobs, DaemonSets, etc). For example, you can scale a Deployment, initiate a rolling update, restart a pod or deploy new applications using a deploy wizard.Dashboard also provides information on the state of Kubernetes resources in your cluster and on any errors that may have occurred.Deploying the Dashboard UINote:Kubernetes Dashboard supports only Helm-based installation currently as it is faster and gives us better control over all dependencies required by Dashboard to run.The Dashboard UI is not deployed by default. To deploy it, run the following command:# Add kubernetes-dashboard repository helm repo add kubernetes-dashboard https://kubernetes.github.io/dashboard/ # Deploy a Helm Release named "kubernetes-dashboard" using the kubernetes-dashboard chart helm upgrade --install kubernetes-dashboard kubernetes-dashboard/kubernetes-dashboard --create-namespace --namespace kubernetes-dashboard Accessing the Dashboard UITo protect your cluster data, Dashboard deploys with a minimal RBAC configuration by default. Currently, Dashboard only supports logging in with a Bearer Token. To create a token for this demo, you can follow our guide on creating a sample user.Warning:The sample user created in the tutorial will have administrative privileges and is for educational purposes only.Command line proxyYou can enable access to the Dashboard using the kubectl command-line tool, by running the following command:kubectl -n kubernetes-dashboard port-forward svc/kubernetes-dashboard-kong-proxy 8443:443 Kubectl will make Dashboard available at https://localhost:8443.The UI can only be accessed from the machine where the command is executed. See kubectl port-forward --help fo


Question: How does Access Applications in a Cluster work?

Answer: This is the multi-page printable view of this section. Click here to print.Return to the regular view of this page.Access Applications in a ClusterConfigure load balancing, port forwarding, or setup firewall or DNS configurations to access applications in a cluster.1: Deploy and Access the Kubernetes Dashboard2: Accessing Clusters3: Configure Access to Multiple Clusters4: Use Port Forwarding to Access Applications in a Cluster5: Use a Service to Access an Application in a Cluster6: Connect a Frontend to a Backend Using Services7: Create an External Load Balancer8: List All Container Images Running in a Cluster9: Set up Ingress on Minikube with the NGINX Ingress Controller10: Communicate Between Containers in the Same Pod Using a Shared Volume11: Configure DNS for a Cluster12: Access Services Running on Clusters1 - Deploy and Access the Kubernetes DashboardDeploy the web UI (Kubernetes Dashboard) and access it.Dashboard is a web-based Kubernetes user interface. You can use Dashboard to deploy containerized applications to a Kubernetes cluster, troubleshoot your containerized application, and manage the cluster resources. You can use Dashboard to get an overview of applications running on your cluster, as well as for creating or modifying individual Kubernetes resources (such as Deployments, Jobs, DaemonSets, etc). For example, you can scale a Deployment, initiate a rolling update, restart a pod or deploy new applications using a deploy wizard.Dashboard also provides information on the state of Kubernetes resources in your cluster and on any errors that may have occurred.Deploying the Dashboard UINote:Kubernetes Dashboard supports only Helm-based installation currently as it is faster and gives us better control over all dependencies required by Dashboard to run.The Dashboard UI is not deployed by default. To deploy it, run the following command:# Add kubernetes-dashboard repository helm repo add kubernetes-dashboard https://kubernetes.github.io/dashboard/ # Deploy a Helm Release named "kubernetes-dashboard" using the kubernetes-dashboard chart helm upgrade --install kubernetes-dashboard kubernetes-dashboard/kubernetes-dashboard --create-namespace --namespace kubernetes-dashboard Accessing the Dashboard UITo protect your cluster data, Dashboard deploys with a minimal RBAC configuration by default. Currently, Dashboard only supports logging in with a Bearer Token. To create a token for this demo, you can follow our guide on creating a sample user.Warning:The sample user created in the tutorial will have administrative privileges and is for educational purposes only.Command line proxyYou can enable access to the Dashboard using the kubectl command-line tool, by running the following command:kubectl -n kubernetes-dashboard port-forward svc/kubernetes-dashboard-kong-proxy 8443:443 Kubectl will make Dashboard available at https://localhost:8443.The UI can only be accessed from the machine where the command is executed. See kubectl port-forward --help fo


Question: When would you use Access Applications in a Cluster?

Answer: This is the multi-page printable view of this section. Click here to print.Return to the regular view of this page.Access Applications in a ClusterConfigure load balancing, port forwarding, or setup firewall or DNS configurations to access applications in a cluster.1: Deploy and Access the Kubernetes Dashboard2: Accessing Clusters3: Configure Access to Multiple Clusters4: Use Port Forwarding to Access Applications in a Cluster5: Use a Service to Access an Application in a Cluster6: Connect a Frontend to a Backend Using Services7: Create an External Load Balancer8: List All Container Images Running in a Cluster9: Set up Ingress on Minikube with the NGINX Ingress Controller10: Communicate Between Containers in the Same Pod Using a Shared Volume11: Configure DNS for a Cluster12: Access Services Running on Clusters1 - Deploy and Access the Kubernetes DashboardDeploy the web UI (Kubernetes Dashboard) and access it.Dashboard is a web-based Kubernetes user interface. You can use Dashboard to deploy containerized applications to a Kubernetes cluster, troubleshoot your containerized application, and manage the cluster resources. You can use Dashboard to get an overview of applications running on your cluster, as well as for creating or modifying individual Kubernetes resources (such as Deployments, Jobs, DaemonSets, etc). For example, you can scale a Deployment, initiate a rolling update, restart a pod or deploy new applications using a deploy wizard.Dashboard also provides information on the state of Kubernetes resources in your cluster and on any errors that may have occurred.Deploying the Dashboard UINote:Kubernetes Dashboard supports only Helm-based installation currently as it is faster and gives us better control over all dependencies required by Dashboard to run.The Dashboard UI is not deployed by default. To deploy it, run the following command:# Add kubernetes-dashboard repository helm repo add kubernetes-dashboard https://kubernetes.github.io/dashboard/ # Deploy a Helm Release named "kubernetes-dashboard" using the kubernetes-dashboard chart helm upgrade --install kubernetes-dashboard kubernetes-dashboard/kubernetes-dashboard --create-namespace --namespace kubernetes-dashboard Accessing the Dashboard UITo protect your cluster data, Dashboard deploys with a minimal RBAC configuration by default. Currently, Dashboard only supports logging in with a Bearer Token. To create a token for this demo, you can follow our guide on creating a sample user.Warning:The sample user created in the tutorial will have administrative privileges and is for educational purposes only.Command line proxyYou can enable access to the Dashboard using the kubectl command-line tool, by running the following command:kubectl -n kubernetes-dashboard port-forward svc/kubernetes-dashboard-kong-proxy 8443:443 Kubectl will make Dashboard available at https://localhost:8443.The UI can only be accessed from the machine where the command is executed. See kubectl port-forward --help fo


Question: What are the benefits of Access Applications in a Cluster?

Answer: This is the multi-page printable view of this section. Click here to print.Return to the regular view of this page.Access Applications in a ClusterConfigure load balancing, port forwarding, or setup firewall or DNS configurations to access applications in a cluster.1: Deploy and Access the Kubernetes Dashboard2: Accessing Clusters3: Configure Access to Multiple Clusters4: Use Port Forwarding to Access Applications in a Cluster5: Use a Service to Access an Application in a Cluster6: Connect a Frontend to a Backend Using Services7: Create an External Load Balancer8: List All Container Images Running in a Cluster9: Set up Ingress on Minikube with the NGINX Ingress Controller10: Communicate Between Containers in the Same Pod Using a Shared Volume11: Configure DNS for a Cluster12: Access Services Running on Clusters1 - Deploy and Access the Kubernetes DashboardDeploy the web UI (Kubernetes Dashboard) and access it.Dashboard is a web-based Kubernetes user interface. You can use Dashboard to deploy containerized applications to a Kubernetes cluster, troubleshoot your containerized application, and manage the cluster resources. You can use Dashboard to get an overview of applications running on your cluster, as well as for creating or modifying individual Kubernetes resources (such as Deployments, Jobs, DaemonSets, etc). For example, you can scale a Deployment, initiate a rolling update, restart a pod or deploy new applications using a deploy wizard.Dashboard also provides information on the state of Kubernetes resources in your cluster and on any errors that may have occurred.Deploying the Dashboard UINote:Kubernetes Dashboard supports only Helm-based installation currently as it is faster and gives us better control over all dependencies required by Dashboard to run.The Dashboard UI is not deployed by default. To deploy it, run the following command:# Add kubernetes-dashboard repository helm repo add kubernetes-dashboard https://kubernetes.github.io/dashboard/ # Deploy a Helm Release named "kubernetes-dashboard" using the kubernetes-dashboard chart helm upgrade --install kubernetes-dashboard kubernetes-dashboard/kubernetes-dashboard --create-namespace --namespace kubernetes-dashboard Accessing the Dashboard UITo protect your cluster data, Dashboard deploys with a minimal RBAC configuration by default. Currently, Dashboard only supports logging in with a Bearer Token. To create a token for this demo, you can follow our guide on creating a sample user.Warning:The sample user created in the tutorial will have administrative privileges and is for educational purposes only.Command line proxyYou can enable access to the Dashboard using the kubectl command-line tool, by running the following command:kubectl -n kubernetes-dashboard port-forward svc/kubernetes-dashboard-kong-proxy 8443:443 Kubectl will make Dashboard available at https://localhost:8443.The UI can only be accessed from the machine where the command is executed. See kubectl port-forward --help fo


Question: What is Access Applications in a Cluster?

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


Question: What is 1 - Deploy and Access the Kubernetes Dashboard?

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


Question: What is Note:?

Answer: T h e   D a s h b o a r d   U I   i s   n o t   d e p l o y e d   b y   d e f a u l t .   T o   d e p l o y   i t ,   r u n   t h e   f o l l o w i n g   c o m m a n d :   #   A d d   k u b e r n e t e s - d a s h b o a r d   r e p o s i t o r y   h e l m   r e p o   a d d   k u b e r n e t e s - d a s h b o a r d   h t t p s : / / k u b e r n e t e s . g i t h u b . i o / d a s h b o a r d /   #   D e p l o y   a   H e l m   R e l e a s e   n a m e d   " k u b e r n e t e s - d a s h b o a r d "   u s i n g   t h e   k u b e r n e t e s - d a s h b o a r d   c h a r t   h e l m   u p g r a d e   - - i n s t a l l   k u b e r n e t e s - d a s h b o a r d   k u b e r n e t e s - d a s h b o a r d / k u b e r n e t e s - d a s h b o a r d   - - c r e a t e - n a m e s p a c e   - - n a m e s p a c e   k u b e r n e t e s - d a s h b o a r d


Question: What is Accessing the Dashboard UI?

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


Question: What is Command line proxy?

Answer: Y o u   c a n   e n a b l e   a c c e s s   t o   t h e   D a s h b o a r d   u s i n g   t h e   k u b e c t l   c o m m a n d - l i n e   t o o l ,   b y   r u n n i n g   t h e   f o l l o w i n g   c o m m a n d :   k u b e c t l   - n   k u b e r n e t e s - d a s h b o a r d   p o r t - f o r w a r d   s v c / k u b e r n e t e s - d a s h b o a r d - k o n g - p r o x y   8 4 4 3 : 4 4 3   K u b e c t l   w i l l   m a k e   D a s h b o a r d   a v a i l a b l e   a t   h t t p s : / / l o c a l h o s t : 8 4 4 3 .   T h e   U I   c a n   o n l y   b e   a c c e s s e d   f r o m   t h e   m a c h i n e   w h e r e   t h e   c o m m a n d   i s   e x e c u t e d .   S e e   k u b e c t l   p o r t - f o r w a r d   - - h e l p   f o r   m o r e   o p t i o n s .


Question: What is Welcome view?

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


Question: What is Deploying containerized applications?

Answer: D a s h b o a r d   l e t s   y o u   c r e a t e   a n d   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   a s   a   D e p l o y m e n t   a n d   o p t i o n a l   S e r v i c e   w i t h   a   s i m p l e   w i z a r d .   Y o u   c a n   e i t h e r   m a n u a l l y   s p e c i f y   a p p l i c a t i o n   d e t a i l s ,   o r   u p l o a d   a   Y A M L   o r   J S O N   m a n i f e s t   f i l e   c o n t a i n i n g   a p p l i c a t i o n   c o n f i g u r a t i o n .   C l i c k   t h e   C R E A T E   b u t t o n   i n   t h e   u p p e r   r i g h t   c o r n e r   o f   a n y   p a g e   t o   b e g i n .


Question: What is Specifying application details?

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


Question: What is Note:?

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


Question: What is Uploading a YAML or JSON file?

Answer: K u b e r n e t e s   s u p p o r t s   d e c l a r a t i v e   c o n f i g u r a t i o n .   I n   t h i s   s t y l e ,   a l l   c o n f i g u r a t i o n   i s   s t o r e d   i n   m a n i f e s t s   ( Y A M L   o r   J S O N   c o n f i g u r a t i o n   f i l e s ) .   T h e   m a n i f e s t s   u s e   K u b e r n e t e s   A P I   r e s o u r c e   s c h e m a s .   A s   a n   a l t e r n a t i v e   t o   s p e c i f y i n g   a p p l i c a t i o n   d e t a i l s   i n   t h e   d e p l o y   w i z a r d ,   y o u   c a n   d e f i n e   y o u r   a p p l i c a t i o n   i n   o n e   o r   m o r e   m a n i f e s t s ,   a n d   u p l o a d   t h e   f i l e s   u s i n g   D a s h b o a r d .


Question: What is Using Dashboard?

Answer: F o l l o w i n g   s e c t i o n s   d e s c r i b e   v i e w s   o f   t h e   K u b e r n e t e s   D a s h b o a r d   U I ;   w h a t   t h e y   p r o v i d e   a n d   h o w   c a n   t h e y   b e   u s e d .


Question: What is Navigation?

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


Question: What is Admin overview?

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


Question: What is Workloads?

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


Question: What is Services?

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


Question: What is Storage?

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


Question: What is ConfigMaps and Secrets?

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


Question: What is Logs viewer?

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


Question: What is What's next?

Answer: F o r   m o r e   i n f o r m a t i o n ,   s e e   t h e   K u b e r n e t e s   D a s h b o a r d   p r o j e c t   p a g e .


Question: What is 2 - Accessing Clusters?

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


Question: What is Accessing for the first time with kubectl?

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


Question: What is Directly accessing the REST API?

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


Question: What is Using kubectl proxy?

Answer: T h e   f o l l o w i n g   c o m m a n d   r u n s   k u b e c t l   i n   a   m o d e   w h e r e   i t   a c t s   a s   a   r e v e r s e   p r o x y .   I t   h a n d l e s   l o c a t i n g   t h e   a p i s e r v e r   a n d   a u t h e n t i c a t i n g .   R u n   i t   l i k e   t h i s :   k u b e c t l   p r o x y   - - p o r t = 8 0 8 0   S e e   k u b e c t l   p r o x y   f o r   m o r e   d e t a i l s .   T h e n   y o u   c a n   e x p l o r e   t h e   A P I   w i t h   c u r l ,   w g e t ,   o r   a   b r o w s e r ,   r e p l a c i n g   l o c a l h o s t   w i t h   [ : : 1 ]   f o r   I P v 6 ,   l i k e   s o :   c u r l   h t t p : / / l o c a l h o s t : 8 0 8 0 / a p i /   T h e   o u t p u t   i s   s i m i l a r   t o   t h i s :   {   " k i n d " :   " A P I V e r s i o n s " ,   " v e r s i o n s " :   [   " v 1 "   ] ,   " s e r v e r A d d r e s s B y C l i e n t C I D R s " :   [   {   " c l i e n t C I D R " :   " 0 . 0 . 0 . 0 / 0 " ,   " s e r v e r A d d r e s s " :   " 1 0 . 0 . 1 . 1 4 9 : 4 4 3 "   }   ]   }


Question: What is Without kubectl proxy?

Answer: U s e   k u b e c t l   a p p l y   a n d   k u b e c t l   d e s c r i b e   s e c r e t . . .   t o   c r e a t e   a   t o k e n   f o r   t h e   d e f a u l t   s e r v i c e   a c c o u n t   w i t h   g r e p / c u t :   F i r s t ,   c r e a t e   t h e   S e c r e t ,   r e q u e s t i n g   a   t o k e n   f o r   t h e   d e f a u l t   S e r v i c e A c c o u n t :   k u b e c t l   a p p l y   - f   -   < < E O F   a p i V e r s i o n :   v 1   k i n d :   S e c r e t   m e t a d a t a :   n a m e :   d e f a u l t - t o k e n   a n n o t a t i o n s :   k u b e r n e t e s . i o / s e r v i c e - a c c o u n t . n a m e :   d e f a u l t   t y p e :   k u b e r n e t e s . i o / s e r v i c e - a c c o u n t - t o k e n   E O F   N e x t ,   w a i t   f o r   t h e   t o k e n   c o n t r o l l e r   t o   p o p u l a t e   t h e   S e c r e t   w i t h   a   t o k e n :   w h i l e   !   k u b e c t l   d e s c r i b e   s e c r e t   d e f a u l t - t o k e n   |   g r e p   - E   ' ^ t o k e n '   > / d e v / n u l l ;   d o   e c h o   " w a i t i n g   f o r   t o k e n . . . "   > & 2   s l e e p   1   d o n e   C a p t u r e   a n d   u s e   t h e   g e n e r a t e d   t o k e n :   A P I S E R V E R = $ ( k u b e c t l   c o n f i g   v i e w   - - m i n i f y   |   g r e p   s e r v e r   |   c u t   - f   2 -   - d   " : "   |   t r   - d   "   " )   T O K E N = $ ( k u b e c t l   d e s c r i b e   s e c r e t   d e f a u l t - t o k e n   |   g r e p   - E   ' ^ t o k e n '   |   c u t   - f 2   - d ' : '   |   t r   - d   "   " )   c u r l   $ A P I S E R V E R / a p i   - - h e a d e r   " A u t h o r i z a t i o n :   B e a r e r   $ T O K E N "   - - i n s e c u r e   T h e   o u t p u t   i s   s i m i l a r   t o   t h i s :   {   " k i n d " :   " A P I V e r s i o n s " ,   " v e r s i o n s " :   [   " v 1 "   ] ,   " s e r v e r A d d r e s s B y C l i e n t C I D R s " :   [   {   " c l i e n t C I D R " :   " 0 . 0 . 0 . 0 / 0


Question: What is Programmatic access to the API?

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


Question: What is Go client?

Answer: T o   g e t   t h e   l i b r a r y ,   r u n   t h e   f o l l o w i n g   c o m m a n d :   g o   g e t   k 8 s . i o / c l i e n t - g o @ k u b e r n e t e s - < k u b e r n e t e s - v e r s i o n - n u m b e r > ,   s e e   I N S T A L L . m d   f o r   d e t a i l e d   i n s t a l l a t i o n   i n s t r u c t i o n s .   S e e   h t t p s : / / g i t h u b . c o m / k u b e r n e t e s / c l i e n t - g o   t o   s e e   w h i c h   v e r s i o n s   a r e   s u p p o r t e d . W r i t e   a n   a p p l i c a t i o n   a t o p   o f   t h e   c l i e n t - g o   c l i e n t s .   N o t e   t h a t   c l i e n t - g o   d e f i n e s   i t s   o w n   A P I   o b j e c t s ,   s o   i f   n e e d e d ,   p l e a s e   i m p o r t   A P I   d e f i n i t i o n s   f r o m   c l i e n t - g o   r a t h e r   t h a n   f r o m   t h e   m a i n   r e p o s i t o r y ,   e . g . ,   i m p o r t   " k 8 s . i o / c l i e n t - g o / k u b e r n e t e s "   i s   c o r r e c t .   T h e   G o   c l i e n t   c a n   u s e   t h e   s a m e   k u b e c o n f i g   f i l e   a s   t h e   k u b e c t l   C L I   d o e s   t o   l o c a t e   a n d   a u t h e n t i c a t e   t o   t h e   a p i s e r v e r .   S e e   t h i s   e x a m p l e .   I f   t h e   a p p l i c a t i o n   i s   d e p l o y e d   a s   a   P o d   i n   t h e   c l u s t e r ,   p l e a s e   r e f e r   t o   t h e   n e x t   s e c t i o n .


Question: What is Python client?

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


Question: What is Other languages?

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


Question: What is Accessing the API from a Pod?

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


Question: What is Accessing services running on the cluster?

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


Question: What is Requesting redirects?

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


Question: What is So many proxies?

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


Question: What is 3 - Configure Access to Multiple Clusters?

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


Question: What is Before you begin?

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


Question: What is Define clusters, users, and contexts?

Answer: S u p p o s e   y o u   h a v e   t w o   c l u s t e r s ,   o n e   f o r   d e v e l o p m e n t   w o r k   a n d   o n e   f o r   t e s t   w o r k .   I n   t h e   d e v e l o p m e n t   c l u s t e r ,   y o u r   f r o n t e n d   d e v e l o p e r s   w o r k   i n   a   n a m e s p a c e   c a l l e d   f r o n t e n d ,   a n d   y o u r   s t o r a g e   d e v e l o p e r s   w o r k   i n   a   n a m e s p a c e   c a l l e d   s t o r a g e .   I n   y o u r   t e s t   c l u s t e r ,   d e v e l o p e r s   w o r k   i n   t h e   d e f a u l t   n a m e s p a c e ,   o r   t h e y   c r e a t e   a u x i l i a r y   n a m e s p a c e s   a s   t h e y   s e e   f i t .   A c c e s s   t o   t h e   d e v e l o p m e n t   c l u s t e r   r e q u i r e s   a u t h e n t i c a t i o n   b y   c e r t i f i c a t e .   A c c e s s   t o   t h e   t e s t   c l u s t e r   r e q u i r e s   a u t h e n t i c a t i o n   b y   u s e r n a m e   a n d   p a s s w o r d .   C r e a t e   a   d i r e c t o r y   n a m e d   c o n f i g - e x e r c i s e .   I n   y o u r   c o n f i g - e x e r c i s e   d i r e c t o r y ,   c r e a t e   a   f i l e   n a m e d   c o n f i g - d e m o   w i t h   t h i s   c o n t e n t :   a p i V e r s i o n :   v 1   k i n d :   C o n f i g   p r e f e r e n c e s :   { }   c l u s t e r s :   -   c l u s t e r :   n a m e :   d e v e l o p m e n t   -   c l u s t e r :   n a m e :   t e s t   u s e r s :   -   n a m e :   d e v e l o p e r   -   n a m e :   e x p e r i m e n t e r   c o n t e x t s :   -   c o n t e x t :   n a m e :   d e v - f r o n t e n d   -   c o n t e x t :   n a m e :   d e v - s t o r a g e   -   c o n t e x t :   n a m e :   e x p - t e s t   A   c o n f i g u r a t i o n   f i l e   d e s c r i b e s   c l u s t e r s ,   u s e r s ,   a n d   c o n t e x t s .   Y o u r   c o n f i g - d e m o   f i l e   h a s   t h e   f r a m e w o r k   t o   d e s c r i b e   t w o   c l u s t e r


Question: What is Caution:?

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


Question: What is Note:?

Answer: T o   d e l e t e   a   u s e r   y o u   c a n   r u n   k u b e c t l   - - k u b e c o n f i g = c o n f i g - d e m o   c o n f i g   u n s e t   u s e r s . < n a m e > T o   r e m o v e   a   c l u s t e r ,   y o u   c a n   r u n   k u b e c t l   - - k u b e c o n f i g = c o n f i g - d e m o   c o n f i g   u n s e t   c l u s t e r s . < n a m e > T o   r e m o v e   a   c o n t e x t ,   y o u   c a n   r u n   k u b e c t l   - - k u b e c o n f i g = c o n f i g - d e m o   c o n f i g   u n s e t   c o n t e x t s . < n a m e >   A d d   c o n t e x t   d e t a i l s   t o   y o u r   c o n f i g u r a t i o n   f i l e :   k u b e c t l   c o n f i g   - - k u b e c o n f i g = c o n f i g - d e m o   s e t - c o n t e x t   d e v - f r o n t e n d   - - c l u s t e r = d e v e l o p m e n t   - - n a m e s p a c e = f r o n t e n d   - - u s e r = d e v e l o p e r   k u b e c t l   c o n f i g   - - k u b e c o n f i g = c o n f i g - d e m o   s e t - c o n t e x t   d e v - s t o r a g e   - - c l u s t e r = d e v e l o p m e n t   - - n a m e s p a c e = s t o r a g e   - - u s e r = d e v e l o p e r   k u b e c t l   c o n f i g   - - k u b e c o n f i g = c o n f i g - d e m o   s e t - c o n t e x t   e x p - t e s t   - - c l u s t e r = t e s t   - - n a m e s p a c e = d e f a u l t   - - u s e r = e x p e r i m e n t e r   O p e n   y o u r   c o n f i g - d e m o   f i l e   t o   s e e   t h e   a d d e d   d e t a i l s .   A s   a n   a l t e r n a t i v e   t o   o p e n i n g   t h e   c o n f i g - d e m o   f i l e ,   y o u   c a n   u s e   t h e   c o n f i g   v i e w   c o m m a n d .   k u b e c t l   c o n f i g   - - k u b e c o n f i g = c o n f i g - d e m o   v i e w   T h e   o u t p u t   s h o w s   t h e   t w o   c l u s t e r s ,   t w o   u s e r s ,   a n d   t h r e e   c o n t e x t s :   a p i V e r s i o n :   v 1   c l u s t e r s :   -   c l u s t e r :   c e r t i f i c a t e - a u t h o r i t y :   f


Question: What is Create a second configuration file?

Answer: I n   y o u r   c o n f i g - e x e r c i s e   d i r e c t o r y ,   c r e a t e   a   f i l e   n a m e d   c o n f i g - d e m o - 2   w i t h   t h i s   c o n t e n t :   a p i V e r s i o n :   v 1   k i n d :   C o n f i g   p r e f e r e n c e s :   { }   c o n t e x t s :   -   c o n t e x t :   c l u s t e r :   d e v e l o p m e n t   n a m e s p a c e :   r a m p   u s e r :   d e v e l o p e r   n a m e :   d e v - r a m p - u p   T h e   p r e c e d i n g   c o n f i g u r a t i o n   f i l e   d e f i n e s   a   n e w   c o n t e x t   n a m e d   d e v - r a m p - u p .


Question: What is Set the KUBECONFIG environment variable?

Answer: S e e   w h e t h e r   y o u   h a v e   a n   e n v i r o n m e n t   v a r i a b l e   n a m e d   K U B E C O N F I G .   I f   s o ,   s a v e   t h e   c u r r e n t   v a l u e   o f   y o u r   K U B E C O N F I G   e n v i r o n m e n t   v a r i a b l e ,   s o   y o u   c a n   r e s t o r e   i t   l a t e r .   F o r   e x a m p l e :


Question: What is Linux?

Answer: e x p o r t   K U B E C O N F I G _ S A V E D = " $ K U B E C O N F I G "


Question: What is Windows PowerShell?

Answer: $ E n v : K U B E C O N F I G _ S A V E D = $ E N V : K U B E C O N F I G   T h e   K U B E C O N F I G   e n v i r o n m e n t   v a r i a b l e   i s   a   l i s t   o f   p a t h s   t o   c o n f i g u r a t i o n   f i l e s .   T h e   l i s t   i s   c o l o n - d e l i m i t e d   f o r   L i n u x   a n d   M a c ,   a n d   s e m i c o l o n - d e l i m i t e d   f o r   W i n d o w s .   I f   y o u   h a v e   a   K U B E C O N F I G   e n v i r o n m e n t   v a r i a b l e ,   f a m i l i a r i z e   y o u r s e l f   w i t h   t h e   c o n f i g u r a t i o n   f i l e s   i n   t h e   l i s t .   T e m p o r a r i l y   a p p e n d   t w o   p a t h s   t o   y o u r   K U B E C O N F I G   e n v i r o n m e n t   v a r i a b l e .   F o r   e x a m p l e :


Question: What is Linux?

Answer: e x p o r t   K U B E C O N F I G = " $ { K U B E C O N F I G } : c o n f i g - d e m o : c o n f i g - d e m o - 2 "


Question: What is Windows PowerShell?

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


Question: What is Explore the $HOME/.kube directory?

Answer: I f   y o u   a l r e a d y   h a v e   a   c l u s t e r ,   a n d   y o u   c a n   u s e   k u b e c t l   t o   i n t e r a c t   w i t h   t h e   c l u s t e r ,   t h e n   y o u   p r o b a b l y   h a v e   a   f i l e   n a m e d   c o n f i g   i n   t h e   $ H O M E / . k u b e   d i r e c t o r y .   G o   t o   $ H O M E / . k u b e ,   a n d   s e e   w h a t   f i l e s   a r e   t h e r e .   T y p i c a l l y ,   t h e r e   i s   a   f i l e   n a m e d   c o n f i g .   T h e r e   m i g h t   a l s o   b e   o t h e r   c o n f i g u r a t i o n   f i l e s   i n   t h i s   d i r e c t o r y .   B r i e f l y   f a m i l i a r i z e   y o u r s e l f   w i t h   t h e   c o n t e n t s   o f   t h e s e   f i l e s .


Question: What is Append $HOME/.kube/config to your KUBECONFIG environment variable?

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


Question: What is Linux?

Answer: e x p o r t   K U B E C O N F I G = " $ { K U B E C O N F I G } : $ { H O M E } / . k u b e / c o n f i g "


Question: What is Windows Powershell?

Answer: $ E n v : K U B E C O N F I G = " $ E n v : K U B E C O N F I G ; $ H O M E \ . k u b e \ c o n f i g "   V i e w   c o n f i g u r a t i o n   i n f o r m a t i o n   m e r g e d   f r o m   a l l   t h e   f i l e s   t h a t   a r e   n o w   l i s t e d   i n   y o u r   K U B E C O N F I G   e n v i r o n m e n t   v a r i a b l e .   I n   y o u r   c o n f i g - e x e r c i s e   d i r e c t o r y ,   e n t e r :   k u b e c t l   c o n f i g   v i e w


Question: What is Clean up?

Answer: R e t u r n   y o u r   K U B E C O N F I G   e n v i r o n m e n t   v a r i a b l e   t o   i t s   o r i g i n a l   v a l u e .   F o r   e x a m p l e :


Question: What is Linux?

Answer: e x p o r t   K U B E C O N F I G = " $ K U B E C O N F I G _ S A V E D "


Question: What is Windows PowerShell?

Answer: $ E n v : K U B E C O N F I G = $ E N V : K U B E C O N F I G _ S A V E D


Question: What is Check the subject represented by the kubeconfig?

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


Question: What is What's next?

Answer: O r g a n i z i n g   C l u s t e r   A c c e s s   U s i n g   k u b e c o n f i g   F i l e s k u b e c t l   c o n f i g


Question: What is 4 - Use Port Forwarding to Access Applications in a Cluster?

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


Question: What is Before you begin?

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


Question: What is Creating MongoDB deployment and service?

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


Question: What is Forward a local port to a port on the Pod?

Answer: k u b e c t l   p o r t - f o r w a r d   a l l o w s   u s i n g   r e s o u r c e   n a m e ,   s u c h   a s   a   p o d   n a m e ,   t o   s e l e c t   a   m a t c h i n g   p o d   t o   p o r t   f o r w a r d   t o . #   C h a n g e   m o n g o - 7 5 f 5 9 d 5 7 f 4 - 4 n d 6 q   t o   t h e   n a m e   o f   t h e   P o d   k u b e c t l   p o r t - f o r w a r d   m o n g o - 7 5 f 5 9 d 5 7 f 4 - 4 n d 6 q   2 8 0 1 5 : 2 7 0 1 7   w h i c h   i s   t h e   s a m e   a s k u b e c t l   p o r t - f o r w a r d   p o d s / m o n g o - 7 5 f 5 9 d 5 7 f 4 - 4 n d 6 q   2 8 0 1 5 : 2 7 0 1 7   o r k u b e c t l   p o r t - f o r w a r d   d e p l o y m e n t / m o n g o   2 8 0 1 5 : 2 7 0 1 7   o r k u b e c t l   p o r t - f o r w a r d   r e p l i c a s e t / m o n g o - 7 5 f 5 9 d 5 7 f 4   2 8 0 1 5 : 2 7 0 1 7   o r k u b e c t l   p o r t - f o r w a r d   s e r v i c e / m o n g o   2 8 0 1 5 : 2 7 0 1 7   A n y   o f   t h e   a b o v e   c o m m a n d s   w o r k s .   T h e   o u t p u t   i s   s i m i l a r   t o   t h i s : F o r w a r d i n g   f r o m   1 2 7 . 0 . 0 . 1 : 2 8 0 1 5   - >   2 7 0 1 7   F o r w a r d i n g   f r o m   [ : : 1 ] : 2 8 0 1 5   - >   2 7 0 1 7   N o t e : k u b e c t l   p o r t - f o r w a r d   d o e s   n o t   r e t u r n .   T o   c o n t i n u e   w i t h   t h e   e x e r c i s e s ,   y o u   w i l l   n e e d   t o   o p e n   a n o t h e r   t e r m i n a l . S t a r t   t h e   M o n g o D B   c o m m a n d   l i n e   i n t e r f a c e : m o n g o s h   - - p o r t   2 8 0 1 5   A t   t h e   M o n g o D B   c o m m a n d   l i n e   p r o m p t ,   e n t e r   t h e   p i n g   c o m m a n d : d b . r u n C o m m a n d (   {   p i n g :   1   }   )   A   s u c c e s s f u l   p i n g   r e q u e s t   r e t u r n s : {   o k :   1   }   k u b e c t l   p o r t - f o r w a r d   a l l o w s   u s i n g   r e s o u r c e   n a m e ,   s u c h   a s   a   p o d   n a m e ,   t o   s e l e c t   a   m


Question: What is Note:?

Answer: S t a r t   t h e   M o n g o D B   c o m m a n d   l i n e   i n t e r f a c e :   m o n g o s h   - - p o r t   2 8 0 1 5   A t   t h e   M o n g o D B   c o m m a n d   l i n e   p r o m p t ,   e n t e r   t h e   p i n g   c o m m a n d :   d b . r u n C o m m a n d (   {   p i n g :   1   }   )   A   s u c c e s s f u l   p i n g   r e q u e s t   r e t u r n s :   {   o k :   1   }


Question: What is Optionally let kubectl choose the local port?

Answer: I f   y o u   d o n ' t   n e e d   a   s p e c i f i c   l o c a l   p o r t ,   y o u   c a n   l e t   k u b e c t l   c h o o s e   a n d   a l l o c a t e   t h e   l o c a l   p o r t   a n d   t h u s   r e l i e v e   y o u   f r o m   h a v i n g   t o   m a n a g e   l o c a l   p o r t   c o n f l i c t s ,   w i t h   t h e   s l i g h t l y   s i m p l e r   s y n t a x :   k u b e c t l   p o r t - f o r w a r d   d e p l o y m e n t / m o n g o   : 2 7 0 1 7   T h e   k u b e c t l   t o o l   f i n d s   a   l o c a l   p o r t   n u m b e r   t h a t   i s   n o t   i n   u s e   ( a v o i d i n g   l o w   p o r t s   n u m b e r s ,   b e c a u s e   t h e s e   m i g h t   b e   u s e d   b y   o t h e r   a p p l i c a t i o n s ) .   T h e   o u t p u t   i s   s i m i l a r   t o :   F o r w a r d i n g   f r o m   1 2 7 . 0 . 0 . 1 : 6 3 7 5 3   - >   2 7 0 1 7   F o r w a r d i n g   f r o m   [ : : 1 ] : 6 3 7 5 3   - >   2 7 0 1 7


Question: What is Discussion?

Answer: C o n n e c t i o n s   m a d e   t o   l o c a l   p o r t   2 8 0 1 5   a r e   f o r w a r d e d   t o   p o r t   2 7 0 1 7   o f   t h e   P o d   t h a t   i s   r u n n i n g   t h e   M o n g o D B   s e r v e r .   W i t h   t h i s   c o n n e c t i o n   i n   p l a c e ,   y o u   c a n   u s e   y o u r   l o c a l   w o r k s t a t i o n   t o   d e b u g   t h e   d a t a b a s e   t h a t   i s   r u n n i n g   i n   t h e   P o d .


Question: What is What's next?

Answer: L e a r n   m o r e   a b o u t   k u b e c t l   p o r t - f o r w a r d .


Question: What is 5 - Use a Service to Access an Application in a Cluster?

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


Question: What is Before you begin?

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


Question: What is Objectives?

Answer: R u n   t w o   i n s t a n c e s   o f   a   H e l l o   W o r l d   a p p l i c a t i o n . C r e a t e   a   S e r v i c e   o b j e c t   t h a t   e x p o s e s   a   n o d e   p o r t . U s e   t h e   S e r v i c e   o b j e c t   t o   a c c e s s   t h e   r u n n i n g   a p p l i c a t i o n .


Question: What is Creating a service for an application running in two pods?

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


Question: What is Using a service configuration file?

Answer: A s   a n   a l t e r n a t i v e   t o   u s i n g   k u b e c t l   e x p o s e ,   y o u   c a n   u s e   a   s e r v i c e   c o n f i g u r a t i o n   f i l e   t o   c r e a t e   a   S e r v i c e .


Question: What is Cleaning up?

Answer: T o   d e l e t e   t h e   S e r v i c e ,   e n t e r   t h i s   c o m m a n d :   k u b e c t l   d e l e t e   s e r v i c e s   e x a m p l e - s e r v i c e   T o   d e l e t e   t h e   D e p l o y m e n t ,   t h e   R e p l i c a S e t ,   a n d   t h e   P o d s   t h a t   a r e   r u n n i n g   t h e   H e l l o   W o r l d   a p p l i c a t i o n ,   e n t e r   t h i s   c o m m a n d :   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 - w o r l d


Question: What is What's next?

Answer: F o l l o w   t h e   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   t u t o r i a l .


Question: What is 6 - Connect a Frontend to a Backend Using Services?

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


Question: What is Objectives?

Answer: C r e a t e   a n d   r u n   a   s a m p l e   h e l l o   b a c k e n d   m i c r o s e r v i c e   u s i n g   a   D e p l o y m e n t   o b j e c t . U s e   a   S e r v i c e   o b j e c t   t o   s e n d   t r a f f i c   t o   t h e   b a c k e n d   m i c r o s e r v i c e ' s   m u l t i p l e   r e p l i c a s . C r e a t e   a n d   r u n   a   n g i n x   f r o n t e n d   m i c r o s e r v i c e ,   a l s o   u s i n g   a   D e p l o y m e n t   o b j e c t . C o n f i g u r e   t h e   f r o n t e n d   m i c r o s e r v i c e   t o   s e n d   t r a f f i c   t o   t h e   b a c k e n d   m i c r o s e r v i c e . U s e   a   S e r v i c e   o b j e c t   o f   t y p e = L o a d B a l a n c e r   t o   e x p o s e   t h e   f r o n t e n d   m i c r o s e r v i c e   o u t s i d e   t h e   c l u s t e r .


Question: What is Before you begin?

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


Question: What is Creating the backend using a Deployment?

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


Question: What is Creating the hello Service object?

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