Question: What is KMS v2?

Answer: a p i V e r s i o n :   a p i s e r v e r . c o n f i g . k 8 s . i o / v 1   k i n d :   E n c r y p t i o n C o n f i g u r a t i o n   r e s o u r c e s :   -   r e s o u r c e s :   -   s e c r e t s   -   c o n f i g m a p s   -   p a n d a s . a w e s o m e . b e a r s . e x a m p l e   p r o v i d e r s :   -   k m s :   a p i V e r s i o n :   v 2   n a m e :   m y K m s P l u g i n F o o   e n d p o i n t :   u n i x : / / / t m p / s o c k e t f i l e - f o o . s o c k   t i m e o u t :   3 s   -   k m s :   a p i V e r s i o n :   v 2   n a m e :   m y K m s P l u g i n B a r   e n d p o i n t :   u n i x : / / / t m p / s o c k e t f i l e - b a r . s o c k   t i m e o u t :   3 s   S e t t i n g   - - e n c r y p t i o n - p r o v i d e r - c o n f i g - a u t o m a t i c - r e l o a d   t o   t r u e   c o l l a p s e s   a l l   h e a l t h   c h e c k s   t o   a   s i n g l e   h e a l t h   c h e c k   e n d p o i n t .   I n d i v i d u a l   h e a l t h   c h e c k s   a r e   o n l y   a v a i l a b l e   w h e n   K M S   v 1   p r o v i d e r s   a r e   i n   u s e   a n d   t h e   e n c r y p t i o n   c o n f i g   i s   n o t   a u t o - r e l o a d e d .   T h e   f o l l o w i n g   t a b l e   s u m m a r i z e s   t h e   h e a l t h   c h e c k   e n d p o i n t s   f o r   e a c h   K M S   v e r s i o n :   S i n g l e   H e a l t h c h e c k   m e a n s   t h a t   t h e   o n l y   h e a l t h   c h e c k   e n d p o i n t   i s   / h e a l t h z / k m s - p r o v i d e r s .   I n d i v i d u a l   H e a l t h c h e c k s   m e a n s   t h a t   e a c h   K M S   p l u g i n   h a s   a n   a s s o c i a t e d   h e a l t h   c h e c k   e n d p o i n t   b a s e d   o n   i t s   l o c a t i o n   i n   t h e   e n c r y p t i o n   c o n f i g :   / h e a l t h z / k m s - p r o v i d e r - 0 ,   / h e a l t h z / k m s - p r o v i d e r - 1   e t c .   T h e s e   h e a l t h c h e c k   e n d p o i n t   p a t h s   a r e


Question: What is Verifying that the data is encrypted?

Answer: W h e n   e n c r y p t i o n   a t   r e s t   i s   c o r r e c t l y   c o n f i g u r e d ,   r e s o u r c e s   a r e   e n c r y p t e d   o n   w r i t e .   A f t e r   r e s t a r t i n g   y o u r   k u b e - a p i s e r v e r ,   a n y   n e w l y   c r e a t e d   o r   u p d a t e d   S e c r e t   o r   o t h e r   r e s o u r c e   t y p e s   c o n f i g u r e d   i n   E n c r y p t i o n C o n f i g u r a t i o n   s h o u l d   b e   e n c r y p t e d   w h e n   s t o r e d .   T o   v e r i f y ,   y o u   c a n   u s e   t h e   e t c d c t l   c o m m a n d   l i n e   p r o g r a m   t o   r e t r i e v e   t h e   c o n t e n t s   o f   y o u r   s e c r e t   d a t a .   C r e a t e   a   n e w   s e c r e t   c a l l e d   s e c r e t 1   i n   t h e   d e f a u l t   n a m e s p a c e : k u b e c t l   c r e a t e   s e c r e t   g e n e r i c   s e c r e t 1   - n   d e f a u l t   - - f r o m - l i t e r a l = m y k e y = m y d a t a   U s i n g   t h e   e t c d c t l   c o m m a n d   l i n e ,   r e a d   t h a t   s e c r e t   o u t   o f   e t c d : E T C D C T L _ A P I = 3   e t c d c t l   g e t   / k u b e r n e t e s . i o / s e c r e t s / d e f a u l t / s e c r e t 1   [ . . . ]   |   h e x d u m p   - C   w h e r e   [ . . . ]   c o n t a i n s   t h e   a d d i t i o n a l   a r g u m e n t s   f o r   c o n n e c t i n g   t o   t h e   e t c d   s e r v e r . V e r i f y   t h e   s t o r e d   s e c r e t   i s   p r e f i x e d   w i t h   k 8 s : e n c : k m s : v 1 :   f o r   K M S   v 1   o r   p r e f i x e d   w i t h   k 8 s : e n c : k m s : v 2 :   f o r   K M S   v 2 ,   w h i c h   i n d i c a t e s   t h a t   t h e   k m s   p r o v i d e r   h a s   e n c r y p t e d   t h e   r e s u l t i n g   d a t a . V e r i f y   t h a t   t h e   s e c r e t   i s   c o r r e c t l y   d e c r y p t e d   w h e n   r e t r i e v e d   v i a   t h e   A P I : k u b e c t l   d e s c r i b e   s e c r e t   s e


Question: What is Ensuring all secrets are encrypted?

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


Question: What is Switching from a local encryption provider to the KMS provider?

Answer: T o   s w i t c h   f r o m   a   l o c a l   e n c r y p t i o n   p r o v i d e r   t o   t h e   k m s   p r o v i d e r   a n d   r e - e n c r y p t   a l l   o f   t h e   s e c r e t s :   A d d   t h e   k m s   p r o v i d e r   a s   t h e   f i r s t   e n t r y   i n   t h e   c o n f i g u r a t i o n   f i l e   a s   s h o w n   i n   t h e   f o l l o w i n g   e x a m p l e . a p i V e r s i o n :   a p i s e r v e r . c o n f i g . k 8 s . i o / v 1   k i n d :   E n c r y p t i o n C o n f i g u r a t i o n   r e s o u r c e s :   -   r e s o u r c e s :   -   s e c r e t s   p r o v i d e r s :   -   k m s :   a p i V e r s i o n :   v 2   n a m e   :   m y K m s P l u g i n   e n d p o i n t :   u n i x : / / / t m p / s o c k e t f i l e . s o c k   -   a e s c b c :   k e y s :   -   n a m e :   k e y 1   s e c r e t :   < B A S E   6 4   E N C O D E D   S E C R E T >   R e s t a r t   a l l   k u b e - a p i s e r v e r   p r o c e s s e s . R u n   t h e   f o l l o w i n g   c o m m a n d   t o   f o r c e   a l l   s e c r e t s   t o   b e   r e - e n c r y p t e d   u s i n g   t h e   k m s   p r o v i d e r . k u b e c t l   g e t   s e c r e t s   - - a l l - n a m e s p a c e s   - o   j s o n   |   k u b e c t l   r e p l a c e   - f   -   A d d   t h e   k m s   p r o v i d e r   a s   t h e   f i r s t   e n t r y   i n   t h e   c o n f i g u r a t i o n   f i l e   a s   s h o w n   i n   t h e   f o l l o w i n g   e x a m p l e .   a p i V e r s i o n :   a p i s e r v e r . c o n f i g . k 8 s . i o / v 1   k i n d :   E n c r y p t i o n C o n f i g u r a t i o n   r e s o u r c e s :   -   r e s o u r c e s :   -   s e c r e t s   p r o v i d e r s :   -   k m s :   a p i V e r s i o n :   v 2   n a m e   :   m y K m s P l u g i n   e n d p o i n t :   u n i x : / / / t m p / s o c k e t f i l e . s o c k   -   a e s c b c :   k e y s :   -   n a m e :   k e y 1   s e c r e t :   < B A S E   6 4   E N C O D E D   S E C R E


Question: What is What's next?

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


Question: What is kubectl drain?

Answer: kubectl drainSynopsisDrain node in preparation for maintenance.The given node will be marked unschedulable to prevent new pods from arriving. 'drain' evicts the pods if the API server supports https://kubernetes.io/docs/concepts/workloads/pods/disruptions/ eviction https://kubernetes.io/docs/concepts/workloads/pods/disruptions/ . Otherwise, it will use normal DELETE to delete the pods. The 'drain' evicts or deletes all pods except mirror pods (which cannot be deleted through the API server). If there are daemon set-managed pods, drain will not proceed without --ignore-daemonsets, and regardless it will not delete any daemon set-managed pods, because those pods would be immediately replaced by the daemon set controller, which ignores unschedulable markings. If there are any pods that are neither mirror pods nor managed by a replication controller, replica set, daemon set, stateful set, or job, then drain will not delete any pods unless you use --force. --force will also allow deletion to proceed if the managing resource of one or more pods is missing.'drain' waits for graceful termination. You should not operate on the machine until the command completes.When you are ready to put the node back into service, use kubectl uncordon, which will make the node schedulable again.https://kubernetes.io/images/docs/kubectl_drain.svg Workflowhttps://kubernetes.io/images/docs/kubectl_drain.svgkubectl drain NODE Examples # Drain node "foo", even if there are pods not managed by a replication controller, replica set, job, daemon set, or stateful set on it kubectl drain foo --force # As above, but abort if there are pods not managed by a replication controller, replica set, job, daemon set, or stateful set, and use a grace period of 15 minutes kubectl drain foo --grace-period=900 Options--chunk-size int Default: 500Return large lists in chunks rather than all at once. Pass 0 to disable. This flag is beta and may change in the future.--delete-emptydir-dataContinue even if there are pods using emptyDir (local data that will be deleted when the node is drained).--disable-evictionForce drain to use delete, even if eviction is supported. This will bypass checking PodDisruptionBudgets, use with caution.--dry-run string[="unchanged"] Default: "none"Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.--forceContinue even if there are pods that do not declare a controller.--grace-period int Default: -1Period of time in seconds given to each pod to terminate gracefully. If negative, the default value specified in the pod will be used.-h, --helphelp for drain--ignore-daemonsetsIgnore DaemonSet-managed pods.--pod-selector stringLabel selector to filter pods on the node-l, --selector stringSelector (label query) to filter on, supports '=', '==', '!=', 'in', 'notin'.(e.g. -l key1=value1,key2=value2,key3 in (value3)). Matching objec


Question: How does kubectl drain work?

Answer: kubectl drainSynopsisDrain node in preparation for maintenance.The given node will be marked unschedulable to prevent new pods from arriving. 'drain' evicts the pods if the API server supports https://kubernetes.io/docs/concepts/workloads/pods/disruptions/ eviction https://kubernetes.io/docs/concepts/workloads/pods/disruptions/ . Otherwise, it will use normal DELETE to delete the pods. The 'drain' evicts or deletes all pods except mirror pods (which cannot be deleted through the API server). If there are daemon set-managed pods, drain will not proceed without --ignore-daemonsets, and regardless it will not delete any daemon set-managed pods, because those pods would be immediately replaced by the daemon set controller, which ignores unschedulable markings. If there are any pods that are neither mirror pods nor managed by a replication controller, replica set, daemon set, stateful set, or job, then drain will not delete any pods unless you use --force. --force will also allow deletion to proceed if the managing resource of one or more pods is missing.'drain' waits for graceful termination. You should not operate on the machine until the command completes.When you are ready to put the node back into service, use kubectl uncordon, which will make the node schedulable again.https://kubernetes.io/images/docs/kubectl_drain.svg Workflowhttps://kubernetes.io/images/docs/kubectl_drain.svgkubectl drain NODE Examples # Drain node "foo", even if there are pods not managed by a replication controller, replica set, job, daemon set, or stateful set on it kubectl drain foo --force # As above, but abort if there are pods not managed by a replication controller, replica set, job, daemon set, or stateful set, and use a grace period of 15 minutes kubectl drain foo --grace-period=900 Options--chunk-size int Default: 500Return large lists in chunks rather than all at once. Pass 0 to disable. This flag is beta and may change in the future.--delete-emptydir-dataContinue even if there are pods using emptyDir (local data that will be deleted when the node is drained).--disable-evictionForce drain to use delete, even if eviction is supported. This will bypass checking PodDisruptionBudgets, use with caution.--dry-run string[="unchanged"] Default: "none"Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.--forceContinue even if there are pods that do not declare a controller.--grace-period int Default: -1Period of time in seconds given to each pod to terminate gracefully. If negative, the default value specified in the pod will be used.-h, --helphelp for drain--ignore-daemonsetsIgnore DaemonSet-managed pods.--pod-selector stringLabel selector to filter pods on the node-l, --selector stringSelector (label query) to filter on, supports '=', '==', '!=', 'in', 'notin'.(e.g. -l key1=value1,key2=value2,key3 in (value3)). Matching objec


Question: When would you use kubectl drain?

Answer: kubectl drainSynopsisDrain node in preparation for maintenance.The given node will be marked unschedulable to prevent new pods from arriving. 'drain' evicts the pods if the API server supports https://kubernetes.io/docs/concepts/workloads/pods/disruptions/ eviction https://kubernetes.io/docs/concepts/workloads/pods/disruptions/ . Otherwise, it will use normal DELETE to delete the pods. The 'drain' evicts or deletes all pods except mirror pods (which cannot be deleted through the API server). If there are daemon set-managed pods, drain will not proceed without --ignore-daemonsets, and regardless it will not delete any daemon set-managed pods, because those pods would be immediately replaced by the daemon set controller, which ignores unschedulable markings. If there are any pods that are neither mirror pods nor managed by a replication controller, replica set, daemon set, stateful set, or job, then drain will not delete any pods unless you use --force. --force will also allow deletion to proceed if the managing resource of one or more pods is missing.'drain' waits for graceful termination. You should not operate on the machine until the command completes.When you are ready to put the node back into service, use kubectl uncordon, which will make the node schedulable again.https://kubernetes.io/images/docs/kubectl_drain.svg Workflowhttps://kubernetes.io/images/docs/kubectl_drain.svgkubectl drain NODE Examples # Drain node "foo", even if there are pods not managed by a replication controller, replica set, job, daemon set, or stateful set on it kubectl drain foo --force # As above, but abort if there are pods not managed by a replication controller, replica set, job, daemon set, or stateful set, and use a grace period of 15 minutes kubectl drain foo --grace-period=900 Options--chunk-size int Default: 500Return large lists in chunks rather than all at once. Pass 0 to disable. This flag is beta and may change in the future.--delete-emptydir-dataContinue even if there are pods using emptyDir (local data that will be deleted when the node is drained).--disable-evictionForce drain to use delete, even if eviction is supported. This will bypass checking PodDisruptionBudgets, use with caution.--dry-run string[="unchanged"] Default: "none"Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.--forceContinue even if there are pods that do not declare a controller.--grace-period int Default: -1Period of time in seconds given to each pod to terminate gracefully. If negative, the default value specified in the pod will be used.-h, --helphelp for drain--ignore-daemonsetsIgnore DaemonSet-managed pods.--pod-selector stringLabel selector to filter pods on the node-l, --selector stringSelector (label query) to filter on, supports '=', '==', '!=', 'in', 'notin'.(e.g. -l key1=value1,key2=value2,key3 in (value3)). Matching objec


Question: What are the benefits of kubectl drain?

Answer: kubectl drainSynopsisDrain node in preparation for maintenance.The given node will be marked unschedulable to prevent new pods from arriving. 'drain' evicts the pods if the API server supports https://kubernetes.io/docs/concepts/workloads/pods/disruptions/ eviction https://kubernetes.io/docs/concepts/workloads/pods/disruptions/ . Otherwise, it will use normal DELETE to delete the pods. The 'drain' evicts or deletes all pods except mirror pods (which cannot be deleted through the API server). If there are daemon set-managed pods, drain will not proceed without --ignore-daemonsets, and regardless it will not delete any daemon set-managed pods, because those pods would be immediately replaced by the daemon set controller, which ignores unschedulable markings. If there are any pods that are neither mirror pods nor managed by a replication controller, replica set, daemon set, stateful set, or job, then drain will not delete any pods unless you use --force. --force will also allow deletion to proceed if the managing resource of one or more pods is missing.'drain' waits for graceful termination. You should not operate on the machine until the command completes.When you are ready to put the node back into service, use kubectl uncordon, which will make the node schedulable again.https://kubernetes.io/images/docs/kubectl_drain.svg Workflowhttps://kubernetes.io/images/docs/kubectl_drain.svgkubectl drain NODE Examples # Drain node "foo", even if there are pods not managed by a replication controller, replica set, job, daemon set, or stateful set on it kubectl drain foo --force # As above, but abort if there are pods not managed by a replication controller, replica set, job, daemon set, or stateful set, and use a grace period of 15 minutes kubectl drain foo --grace-period=900 Options--chunk-size int Default: 500Return large lists in chunks rather than all at once. Pass 0 to disable. This flag is beta and may change in the future.--delete-emptydir-dataContinue even if there are pods using emptyDir (local data that will be deleted when the node is drained).--disable-evictionForce drain to use delete, even if eviction is supported. This will bypass checking PodDisruptionBudgets, use with caution.--dry-run string[="unchanged"] Default: "none"Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.--forceContinue even if there are pods that do not declare a controller.--grace-period int Default: -1Period of time in seconds given to each pod to terminate gracefully. If negative, the default value specified in the pod will be used.-h, --helphelp for drain--ignore-daemonsetsIgnore DaemonSet-managed pods.--pod-selector stringLabel selector to filter pods on the node-l, --selector stringSelector (label query) to filter on, supports '=', '==', '!=', 'in', 'notin'.(e.g. -l key1=value1,key2=value2,key3 in (value3)). Matching objec


Question: What is Synopsis?

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


Question: What is Examples?

Answer: #   D r a i n   n o d e   " f o o " ,   e v e n   i f   t h e r e   a r e   p o d s   n o t   m a n a g e d   b y   a   r e p l i c a t i o n   c o n t r o l l e r ,   r e p l i c a   s e t ,   j o b ,   d a e m o n   s e t ,   o r   s t a t e f u l   s e t   o n   i t   k u b e c t l   d r a i n   f o o   - - f o r c e   #   A s   a b o v e ,   b u t   a b o r t   i f   t h e r e   a r e   p o d s   n o t   m a n a g e d   b y   a   r e p l i c a t i o n   c o n t r o l l e r ,   r e p l i c a   s e t ,   j o b ,   d a e m o n   s e t ,   o r   s t a t e f u l   s e t ,   a n d   u s e   a   g r a c e   p e r i o d   o f   1 5   m i n u t e s   k u b e c t l   d r a i n   f o o   - - g r a c e - p e r i o d = 9 0 0


Question: What is Options?

Answer: R e t u r n   l a r g e   l i s t s   i n   c h u n k s   r a t h e r   t h a n   a l l   a t   o n c e .   P a s s   0   t o   d i s a b l e .   T h i s   f l a g   i s   b e t a   a n d   m a y   c h a n g e   i n   t h e   f u t u r e .   C o n t i n u e   e v e n   i f   t h e r e   a r e   p o d s   u s i n g   e m p t y D i r   ( l o c a l   d a t a   t h a t   w i l l   b e   d e l e t e d   w h e n   t h e   n o d e   i s   d r a i n e d ) .   F o r c e   d r a i n   t o   u s e   d e l e t e ,   e v e n   i f   e v i c t i o n   i s   s u p p o r t e d .   T h i s   w i l l   b y p a s s   c h e c k i n g   P o d D i s r u p t i o n B u d g e t s ,   u s e   w i t h   c a u t i o n .   M u s t   b e   " n o n e " ,   " s e r v e r " ,   o r   " c l i e n t " .   I f   c l i e n t   s t r a t e g y ,   o n l y   p r i n t   t h e   o b j e c t   t h a t   w o u l d   b e   s e n t ,   w i t h o u t   s e n d i n g   i t .   I f   s e r v e r   s t r a t e g y ,   s u b m i t   s e r v e r - s i d e   r e q u e s t   w i t h o u t   p e r s i s t i n g   t h e   r e s o u r c e .   C o n t i n u e   e v e n   i f   t h e r e   a r e   p o d s   t h a t   d o   n o t   d e c l a r e   a   c o n t r o l l e r .   P e r i o d   o f   t i m e   i n   s e c o n d s   g i v e n   t o   e a c h   p o d   t o   t e r m i n a t e   g r a c e f u l l y .   I f   n e g a t i v e ,   t h e   d e f a u l t   v a l u e   s p e c i f i e d   i n   t h e   p o d   w i l l   b e   u s e d .   h e l p   f o r   d r a i n   I g n o r e   D a e m o n S e t - m a n a g e d   p o d s .   L a b e l   s e l e c t o r   t o   f i l t e r   p o d s   o n   t h e   n o d e   S e l e c t o r   ( l a b e l   q u e r y )   t o   f i l t e r   o n ,   s u p p o r t s   ' = ' ,   ' = = ' ,   ' ! = ' ,   ' i n ' ,   ' n o t i n ' . ( e . g .   - l   k e y 1 = v a l u e 1 , k e y 2 = v a l u e 2 , k e y 3   i n   ( v a l u e 3 ) ) .   M a t c h i n g   o b j e c t s   m u s t   s a t i s f y


Question: What is Parent Options Inherited?

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


Question: What is See Also?

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


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

Answer: Example: Deploying WordPress and MySQL with Persistent VolumesThis tutorial shows you how to deploy a WordPress site and a MySQL database using Minikube. Both applications use PersistentVolumes and PersistentVolumeClaims to store data.A PersistentVolume (PV) is a piece of storage in the cluster that has been manually provisioned by an administrator, or dynamically provisioned by Kubernetes using a StorageClass. A PersistentVolumeClaim (PVC) is a request for storage by a user that can be fulfilled by a PV. PersistentVolumes and PersistentVolumeClaims are independent from Pod lifecycles and preserve data through restarting, rescheduling, and even deleting Pods.Warning:This deployment is not suitable for production use cases, as it uses single instance WordPress and MySQL Pods. Consider using WordPress Helm Chart to deploy WordPress in production.Note:The files provided in this tutorial are using GA Deployment APIs and are specific to kubernetes version 1.9 and later. If you wish to use this tutorial with an earlier version of Kubernetes, please update the API version appropriately, or reference earlier versions of this tutorial.ObjectivesCreate PersistentVolumeClaims and PersistentVolumesCreate a kustomization.yaml witha Secret generatorMySQL resource configsWordPress resource configsApply the kustomization directory by kubectl apply -k ./Clean upBefore you beginYou need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster. It is recommended to run this tutorial on a cluster with at least two nodes that are not acting as control plane hosts. If you do not already have a cluster, you can create one by using minikube or you can use one of these Kubernetes playgrounds:iximiuz LabsKillercodaKodeKloudPlay with KubernetesTo check the version, enter kubectl version.The example shown on this page works with kubectl 1.27 and above.Download the following configuration files:mysql-deployment.yamlwordpress-deployment.yamlCreate PersistentVolumeClaims and PersistentVolumesMySQL and Wordpress each require a PersistentVolume to store data. Their PersistentVolumeClaims will be created at the deployment step.Many cluster environments have a default StorageClass installed. When a StorageClass is not specified in the PersistentVolumeClaim, the cluster's default StorageClass is used instead.When a PersistentVolumeClaim is created, a PersistentVolume is dynamically provisioned based on the StorageClass configuration.Warning:In local clusters, the default StorageClass uses the hostPath provisioner. hostPath volumes are only suitable for development and testing. With hostPath volumes, your data lives in /tmp on the node the Pod is scheduled onto and does not move between nodes. If a Pod dies and gets scheduled to another node in the cluster, or the node is rebooted, the data is lost.Note:If you are bringing up a cluster that needs to use the hostPath provisioner, the --enable-hostpath-provisioner flag must be


Question: How does Example: Deploying WordPress and MySQL with Persistent Volumes work?

Answer: Example: Deploying WordPress and MySQL with Persistent VolumesThis tutorial shows you how to deploy a WordPress site and a MySQL database using Minikube. Both applications use PersistentVolumes and PersistentVolumeClaims to store data.A PersistentVolume (PV) is a piece of storage in the cluster that has been manually provisioned by an administrator, or dynamically provisioned by Kubernetes using a StorageClass. A PersistentVolumeClaim (PVC) is a request for storage by a user that can be fulfilled by a PV. PersistentVolumes and PersistentVolumeClaims are independent from Pod lifecycles and preserve data through restarting, rescheduling, and even deleting Pods.Warning:This deployment is not suitable for production use cases, as it uses single instance WordPress and MySQL Pods. Consider using WordPress Helm Chart to deploy WordPress in production.Note:The files provided in this tutorial are using GA Deployment APIs and are specific to kubernetes version 1.9 and later. If you wish to use this tutorial with an earlier version of Kubernetes, please update the API version appropriately, or reference earlier versions of this tutorial.ObjectivesCreate PersistentVolumeClaims and PersistentVolumesCreate a kustomization.yaml witha Secret generatorMySQL resource configsWordPress resource configsApply the kustomization directory by kubectl apply -k ./Clean upBefore you beginYou need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster. It is recommended to run this tutorial on a cluster with at least two nodes that are not acting as control plane hosts. If you do not already have a cluster, you can create one by using minikube or you can use one of these Kubernetes playgrounds:iximiuz LabsKillercodaKodeKloudPlay with KubernetesTo check the version, enter kubectl version.The example shown on this page works with kubectl 1.27 and above.Download the following configuration files:mysql-deployment.yamlwordpress-deployment.yamlCreate PersistentVolumeClaims and PersistentVolumesMySQL and Wordpress each require a PersistentVolume to store data. Their PersistentVolumeClaims will be created at the deployment step.Many cluster environments have a default StorageClass installed. When a StorageClass is not specified in the PersistentVolumeClaim, the cluster's default StorageClass is used instead.When a PersistentVolumeClaim is created, a PersistentVolume is dynamically provisioned based on the StorageClass configuration.Warning:In local clusters, the default StorageClass uses the hostPath provisioner. hostPath volumes are only suitable for development and testing. With hostPath volumes, your data lives in /tmp on the node the Pod is scheduled onto and does not move between nodes. If a Pod dies and gets scheduled to another node in the cluster, or the node is rebooted, the data is lost.Note:If you are bringing up a cluster that needs to use the hostPath provisioner, the --enable-hostpath-provisioner flag must be


Question: When would you use Example: Deploying WordPress and MySQL with Persistent Volumes?

Answer: Example: Deploying WordPress and MySQL with Persistent VolumesThis tutorial shows you how to deploy a WordPress site and a MySQL database using Minikube. Both applications use PersistentVolumes and PersistentVolumeClaims to store data.A PersistentVolume (PV) is a piece of storage in the cluster that has been manually provisioned by an administrator, or dynamically provisioned by Kubernetes using a StorageClass. A PersistentVolumeClaim (PVC) is a request for storage by a user that can be fulfilled by a PV. PersistentVolumes and PersistentVolumeClaims are independent from Pod lifecycles and preserve data through restarting, rescheduling, and even deleting Pods.Warning:This deployment is not suitable for production use cases, as it uses single instance WordPress and MySQL Pods. Consider using WordPress Helm Chart to deploy WordPress in production.Note:The files provided in this tutorial are using GA Deployment APIs and are specific to kubernetes version 1.9 and later. If you wish to use this tutorial with an earlier version of Kubernetes, please update the API version appropriately, or reference earlier versions of this tutorial.ObjectivesCreate PersistentVolumeClaims and PersistentVolumesCreate a kustomization.yaml witha Secret generatorMySQL resource configsWordPress resource configsApply the kustomization directory by kubectl apply -k ./Clean upBefore you beginYou need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster. It is recommended to run this tutorial on a cluster with at least two nodes that are not acting as control plane hosts. If you do not already have a cluster, you can create one by using minikube or you can use one of these Kubernetes playgrounds:iximiuz LabsKillercodaKodeKloudPlay with KubernetesTo check the version, enter kubectl version.The example shown on this page works with kubectl 1.27 and above.Download the following configuration files:mysql-deployment.yamlwordpress-deployment.yamlCreate PersistentVolumeClaims and PersistentVolumesMySQL and Wordpress each require a PersistentVolume to store data. Their PersistentVolumeClaims will be created at the deployment step.Many cluster environments have a default StorageClass installed. When a StorageClass is not specified in the PersistentVolumeClaim, the cluster's default StorageClass is used instead.When a PersistentVolumeClaim is created, a PersistentVolume is dynamically provisioned based on the StorageClass configuration.Warning:In local clusters, the default StorageClass uses the hostPath provisioner. hostPath volumes are only suitable for development and testing. With hostPath volumes, your data lives in /tmp on the node the Pod is scheduled onto and does not move between nodes. If a Pod dies and gets scheduled to another node in the cluster, or the node is rebooted, the data is lost.Note:If you are bringing up a cluster that needs to use the hostPath provisioner, the --enable-hostpath-provisioner flag must be


Question: What are the benefits of Example: Deploying WordPress and MySQL with Persistent Volumes?

Answer: Example: Deploying WordPress and MySQL with Persistent VolumesThis tutorial shows you how to deploy a WordPress site and a MySQL database using Minikube. Both applications use PersistentVolumes and PersistentVolumeClaims to store data.A PersistentVolume (PV) is a piece of storage in the cluster that has been manually provisioned by an administrator, or dynamically provisioned by Kubernetes using a StorageClass. A PersistentVolumeClaim (PVC) is a request for storage by a user that can be fulfilled by a PV. PersistentVolumes and PersistentVolumeClaims are independent from Pod lifecycles and preserve data through restarting, rescheduling, and even deleting Pods.Warning:This deployment is not suitable for production use cases, as it uses single instance WordPress and MySQL Pods. Consider using WordPress Helm Chart to deploy WordPress in production.Note:The files provided in this tutorial are using GA Deployment APIs and are specific to kubernetes version 1.9 and later. If you wish to use this tutorial with an earlier version of Kubernetes, please update the API version appropriately, or reference earlier versions of this tutorial.ObjectivesCreate PersistentVolumeClaims and PersistentVolumesCreate a kustomization.yaml witha Secret generatorMySQL resource configsWordPress resource configsApply the kustomization directory by kubectl apply -k ./Clean upBefore you beginYou need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster. It is recommended to run this tutorial on a cluster with at least two nodes that are not acting as control plane hosts. If you do not already have a cluster, you can create one by using minikube or you can use one of these Kubernetes playgrounds:iximiuz LabsKillercodaKodeKloudPlay with KubernetesTo check the version, enter kubectl version.The example shown on this page works with kubectl 1.27 and above.Download the following configuration files:mysql-deployment.yamlwordpress-deployment.yamlCreate PersistentVolumeClaims and PersistentVolumesMySQL and Wordpress each require a PersistentVolume to store data. Their PersistentVolumeClaims will be created at the deployment step.Many cluster environments have a default StorageClass installed. When a StorageClass is not specified in the PersistentVolumeClaim, the cluster's default StorageClass is used instead.When a PersistentVolumeClaim is created, a PersistentVolume is dynamically provisioned based on the StorageClass configuration.Warning:In local clusters, the default StorageClass uses the hostPath provisioner. hostPath volumes are only suitable for development and testing. With hostPath volumes, your data lives in /tmp on the node the Pod is scheduled onto and does not move between nodes. If a Pod dies and gets scheduled to another node in the cluster, or the node is rebooted, the data is lost.Note:If you are bringing up a cluster that needs to use the hostPath provisioner, the --enable-hostpath-provisioner flag must be


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

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


Question: What is Objectives?

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


Question: What is Before you begin?

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


Question: What is Create PersistentVolumeClaims and PersistentVolumes?

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


Question: What is Add a Secret generator?

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


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

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


Question: What is Apply and Verify?

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


Question: What is Note:?

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


Question: What is Note:?

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


Question: What is Note:?

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


Question: What is Cleaning up?

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


Question: What is What's next?

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


Question: What is kubectl create token?

Answer: kubectl create tokenSynopsisRequest a service account token.kubectl create token SERVICE_ACCOUNT_NAME Examples # Request a token to authenticate to the kube-apiserver as the service account "myapp" in the current namespace kubectl create token myapp # Request a token for a service account in a custom namespace kubectl create token myapp --namespace myns # Request a token with a custom expiration kubectl create token myapp --duration 10m # Request a token with a custom audience kubectl create token myapp --audience https://example.com # Request a token bound to an instance of a Secret object kubectl create token myapp --bound-object-kind Secret --bound-object-name mysecret # Request a token bound to an instance of a Secret object with a specific UID kubectl create token myapp --bound-object-kind Secret --bound-object-name mysecret --bound-object-uid 0d4691ed-659b-4935-a832-355f77ee47cc Options--allow-missing-template-keys Default: trueIf true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.--audience stringsAudience of the requested token. If unset, defaults to requesting a token for use with the Kubernetes API server. May be repeated to request a token valid for multiple audiences.--bound-object-kind stringKind of an object to bind the token to. Supported kinds are Node, Pod, Secret. If set, --bound-object-name must be provided.--bound-object-name stringName of an object to bind the token to. The token will expire when the object is deleted. Requires --bound-object-kind.--bound-object-uid stringUID of an object to bind the token to. Requires --bound-object-kind and --bound-object-name. If unset, the UID of the existing object is used.--duration durationRequested lifetime of the issued token. If not set or if set to 0, the lifetime will be determined by the server automatically. The server may return a token with a longer or shorter lifetime.-h, --helphelp for token-o, --output stringOutput format. One of: (json, yaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file).--show-managed-fieldsIf true, keep the managedFields when printing objects in JSON or YAML format.--template stringTemplate string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].Parent Options Inherited--as stringUsername to impersonate for the operation. User could be a regular user or a service account in a namespace.--as-group stringsGroup to impersonate for the operation, this flag can be repeated to specify multiple groups.--as-uid stringUID to impersonate for the operation.--cache-dir string Default: "$HOME/.kube/cache"Default cache directory--certificate-authority stringPath to a cert file for the certificate authority--client-certificate stringPath to a client certificate file for TLS--client-key stringPath to a client k


Question: How does kubectl create token work?

Answer: kubectl create tokenSynopsisRequest a service account token.kubectl create token SERVICE_ACCOUNT_NAME Examples # Request a token to authenticate to the kube-apiserver as the service account "myapp" in the current namespace kubectl create token myapp # Request a token for a service account in a custom namespace kubectl create token myapp --namespace myns # Request a token with a custom expiration kubectl create token myapp --duration 10m # Request a token with a custom audience kubectl create token myapp --audience https://example.com # Request a token bound to an instance of a Secret object kubectl create token myapp --bound-object-kind Secret --bound-object-name mysecret # Request a token bound to an instance of a Secret object with a specific UID kubectl create token myapp --bound-object-kind Secret --bound-object-name mysecret --bound-object-uid 0d4691ed-659b-4935-a832-355f77ee47cc Options--allow-missing-template-keys Default: trueIf true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.--audience stringsAudience of the requested token. If unset, defaults to requesting a token for use with the Kubernetes API server. May be repeated to request a token valid for multiple audiences.--bound-object-kind stringKind of an object to bind the token to. Supported kinds are Node, Pod, Secret. If set, --bound-object-name must be provided.--bound-object-name stringName of an object to bind the token to. The token will expire when the object is deleted. Requires --bound-object-kind.--bound-object-uid stringUID of an object to bind the token to. Requires --bound-object-kind and --bound-object-name. If unset, the UID of the existing object is used.--duration durationRequested lifetime of the issued token. If not set or if set to 0, the lifetime will be determined by the server automatically. The server may return a token with a longer or shorter lifetime.-h, --helphelp for token-o, --output stringOutput format. One of: (json, yaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file).--show-managed-fieldsIf true, keep the managedFields when printing objects in JSON or YAML format.--template stringTemplate string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].Parent Options Inherited--as stringUsername to impersonate for the operation. User could be a regular user or a service account in a namespace.--as-group stringsGroup to impersonate for the operation, this flag can be repeated to specify multiple groups.--as-uid stringUID to impersonate for the operation.--cache-dir string Default: "$HOME/.kube/cache"Default cache directory--certificate-authority stringPath to a cert file for the certificate authority--client-certificate stringPath to a client certificate file for TLS--client-key stringPath to a client k


Question: When would you use kubectl create token?

Answer: kubectl create tokenSynopsisRequest a service account token.kubectl create token SERVICE_ACCOUNT_NAME Examples # Request a token to authenticate to the kube-apiserver as the service account "myapp" in the current namespace kubectl create token myapp # Request a token for a service account in a custom namespace kubectl create token myapp --namespace myns # Request a token with a custom expiration kubectl create token myapp --duration 10m # Request a token with a custom audience kubectl create token myapp --audience https://example.com # Request a token bound to an instance of a Secret object kubectl create token myapp --bound-object-kind Secret --bound-object-name mysecret # Request a token bound to an instance of a Secret object with a specific UID kubectl create token myapp --bound-object-kind Secret --bound-object-name mysecret --bound-object-uid 0d4691ed-659b-4935-a832-355f77ee47cc Options--allow-missing-template-keys Default: trueIf true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.--audience stringsAudience of the requested token. If unset, defaults to requesting a token for use with the Kubernetes API server. May be repeated to request a token valid for multiple audiences.--bound-object-kind stringKind of an object to bind the token to. Supported kinds are Node, Pod, Secret. If set, --bound-object-name must be provided.--bound-object-name stringName of an object to bind the token to. The token will expire when the object is deleted. Requires --bound-object-kind.--bound-object-uid stringUID of an object to bind the token to. Requires --bound-object-kind and --bound-object-name. If unset, the UID of the existing object is used.--duration durationRequested lifetime of the issued token. If not set or if set to 0, the lifetime will be determined by the server automatically. The server may return a token with a longer or shorter lifetime.-h, --helphelp for token-o, --output stringOutput format. One of: (json, yaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file).--show-managed-fieldsIf true, keep the managedFields when printing objects in JSON or YAML format.--template stringTemplate string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].Parent Options Inherited--as stringUsername to impersonate for the operation. User could be a regular user or a service account in a namespace.--as-group stringsGroup to impersonate for the operation, this flag can be repeated to specify multiple groups.--as-uid stringUID to impersonate for the operation.--cache-dir string Default: "$HOME/.kube/cache"Default cache directory--certificate-authority stringPath to a cert file for the certificate authority--client-certificate stringPath to a client certificate file for TLS--client-key stringPath to a client k


Question: What are the benefits of kubectl create token?

Answer: kubectl create tokenSynopsisRequest a service account token.kubectl create token SERVICE_ACCOUNT_NAME Examples # Request a token to authenticate to the kube-apiserver as the service account "myapp" in the current namespace kubectl create token myapp # Request a token for a service account in a custom namespace kubectl create token myapp --namespace myns # Request a token with a custom expiration kubectl create token myapp --duration 10m # Request a token with a custom audience kubectl create token myapp --audience https://example.com # Request a token bound to an instance of a Secret object kubectl create token myapp --bound-object-kind Secret --bound-object-name mysecret # Request a token bound to an instance of a Secret object with a specific UID kubectl create token myapp --bound-object-kind Secret --bound-object-name mysecret --bound-object-uid 0d4691ed-659b-4935-a832-355f77ee47cc Options--allow-missing-template-keys Default: trueIf true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.--audience stringsAudience of the requested token. If unset, defaults to requesting a token for use with the Kubernetes API server. May be repeated to request a token valid for multiple audiences.--bound-object-kind stringKind of an object to bind the token to. Supported kinds are Node, Pod, Secret. If set, --bound-object-name must be provided.--bound-object-name stringName of an object to bind the token to. The token will expire when the object is deleted. Requires --bound-object-kind.--bound-object-uid stringUID of an object to bind the token to. Requires --bound-object-kind and --bound-object-name. If unset, the UID of the existing object is used.--duration durationRequested lifetime of the issued token. If not set or if set to 0, the lifetime will be determined by the server automatically. The server may return a token with a longer or shorter lifetime.-h, --helphelp for token-o, --output stringOutput format. One of: (json, yaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file).--show-managed-fieldsIf true, keep the managedFields when printing objects in JSON or YAML format.--template stringTemplate string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].Parent Options Inherited--as stringUsername to impersonate for the operation. User could be a regular user or a service account in a namespace.--as-group stringsGroup to impersonate for the operation, this flag can be repeated to specify multiple groups.--as-uid stringUID to impersonate for the operation.--cache-dir string Default: "$HOME/.kube/cache"Default cache directory--certificate-authority stringPath to a cert file for the certificate authority--client-certificate stringPath to a client certificate file for TLS--client-key stringPath to a client k


Question: What is Synopsis?

Answer: R e q u e s t   a   s e r v i c e   a c c o u n t   t o k e n .   k u b e c t l   c r e a t e   t o k e n   S E R V I C E _ A C C O U N T _ N A M E


Question: What is Examples?

Answer: #   R e q u e s t   a   t o k e n   t o   a u t h e n t i c a t e   t o   t h e   k u b e - a p i s e r v e r   a s   t h e   s e r v i c e   a c c o u n t   " m y a p p "   i n   t h e   c u r r e n t   n a m e s p a c e   k u b e c t l   c r e a t e   t o k e n   m y a p p   #   R e q u e s t   a   t o k e n   f o r   a   s e r v i c e   a c c o u n t   i n   a   c u s t o m   n a m e s p a c e   k u b e c t l   c r e a t e   t o k e n   m y a p p   - - n a m e s p a c e   m y n s   #   R e q u e s t   a   t o k e n   w i t h   a   c u s t o m   e x p i r a t i o n   k u b e c t l   c r e a t e   t o k e n   m y a p p   - - d u r a t i o n   1 0 m   #   R e q u e s t   a   t o k e n   w i t h   a   c u s t o m   a u d i e n c e   k u b e c t l   c r e a t e   t o k e n   m y a p p   - - a u d i e n c e   h t t p s : / / e x a m p l e . c o m   #   R e q u e s t   a   t o k e n   b o u n d   t o   a n   i n s t a n c e   o f   a   S e c r e t   o b j e c t   k u b e c t l   c r e a t e   t o k e n   m y a p p   - - b o u n d - o b j e c t - k i n d   S e c r e t   - - b o u n d - o b j e c t - n a m e   m y s e c r e t   #   R e q u e s t   a   t o k e n   b o u n d   t o   a n   i n s t a n c e   o f   a   S e c r e t   o b j e c t   w i t h   a   s p e c i f i c   U I D   k u b e c t l   c r e a t e   t o k e n   m y a p p   - - b o u n d - o b j e c t - k i n d   S e c r e t   - - b o u n d - o b j e c t - n a m e   m y s e c r e t   - - b o u n d - o b j e c t - u i d   0 d 4 6 9 1 e d - 6 5 9 b - 4 9 3 5 - a 8 3 2 - 3 5 5 f 7 7 e e 4 7 c c


Question: What is Options?

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


Question: What is Parent Options Inherited?

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


Question: What is See Also?

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


Question: What is kubectl patch?

Answer: kubectl patchSynopsisUpdate fields of a resource using strategic merge patch, a JSON merge patch, or a JSON patch.JSON and YAML formats are accepted.Note: Strategic merge patch is not supported for custom resources.kubectl patch (-f FILENAME | TYPE NAME) [-p PATCH|--patch-file FILE] Examples # Partially update a node using a strategic merge patch, specifying the patch as JSON kubectl patch node k8s-node-1 -p '{"spec":{"unschedulable":true}}' # Partially update a node using a strategic merge patch, specifying the patch as YAML kubectl patch node k8s-node-1 -p $'spec:\n unschedulable: true' # Partially update a node identified by the type and name specified in "node.json" using strategic merge patch kubectl patch -f node.json -p '{"spec":{"unschedulable":true}}' # Update a container's image; spec.containers[*].name is required because it's a merge key kubectl patch pod valid-pod -p '{"spec":{"containers":[{"name":"kubernetes-serve-hostname","image":"new image"}]}}' # Update a container's image using a JSON patch with positional arrays kubectl patch pod valid-pod --type='json' -p='[{"op": "replace", "path": "/spec/containers/0/image", "value":"new image"}]' # Update a deployment's replicas through the 'scale' subresource using a merge patch kubectl patch deployment nginx-deployment --subresource='scale' --type='merge' -p '{"spec":{"replicas":2}}' Options--allow-missing-template-keys Default: trueIf true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.--dry-run string[="unchanged"] Default: "none"Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.--field-manager string Default: "kubectl-patch"Name of the manager used to track field ownership.-f, --filename stringsFilename, directory, or URL to files identifying the resource to update-h, --helphelp for patch-k, --kustomize stringProcess the kustomization directory. This flag can't be used together with -f or -R.--localIf true, patch will operate on the content of the file, not the server-side resource.-o, --output stringOutput format. One of: (json, yaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file).-p, --patch stringThe patch to be applied to the resource JSON file.--patch-file stringA file containing a patch to be applied to the resource.-R, --recursiveProcess the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.--show-managed-fieldsIf true, keep the managedFields when printing objects in JSON or YAML format.--subresource stringIf specified, patch will operate on the subresource of the requested object.--template stringTemplate string or path to template file to use when -o=go-template, -o=go-template-file. The template format is


Question: How does kubectl patch work?

Answer: kubectl patchSynopsisUpdate fields of a resource using strategic merge patch, a JSON merge patch, or a JSON patch.JSON and YAML formats are accepted.Note: Strategic merge patch is not supported for custom resources.kubectl patch (-f FILENAME | TYPE NAME) [-p PATCH|--patch-file FILE] Examples # Partially update a node using a strategic merge patch, specifying the patch as JSON kubectl patch node k8s-node-1 -p '{"spec":{"unschedulable":true}}' # Partially update a node using a strategic merge patch, specifying the patch as YAML kubectl patch node k8s-node-1 -p $'spec:\n unschedulable: true' # Partially update a node identified by the type and name specified in "node.json" using strategic merge patch kubectl patch -f node.json -p '{"spec":{"unschedulable":true}}' # Update a container's image; spec.containers[*].name is required because it's a merge key kubectl patch pod valid-pod -p '{"spec":{"containers":[{"name":"kubernetes-serve-hostname","image":"new image"}]}}' # Update a container's image using a JSON patch with positional arrays kubectl patch pod valid-pod --type='json' -p='[{"op": "replace", "path": "/spec/containers/0/image", "value":"new image"}]' # Update a deployment's replicas through the 'scale' subresource using a merge patch kubectl patch deployment nginx-deployment --subresource='scale' --type='merge' -p '{"spec":{"replicas":2}}' Options--allow-missing-template-keys Default: trueIf true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.--dry-run string[="unchanged"] Default: "none"Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.--field-manager string Default: "kubectl-patch"Name of the manager used to track field ownership.-f, --filename stringsFilename, directory, or URL to files identifying the resource to update-h, --helphelp for patch-k, --kustomize stringProcess the kustomization directory. This flag can't be used together with -f or -R.--localIf true, patch will operate on the content of the file, not the server-side resource.-o, --output stringOutput format. One of: (json, yaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file).-p, --patch stringThe patch to be applied to the resource JSON file.--patch-file stringA file containing a patch to be applied to the resource.-R, --recursiveProcess the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.--show-managed-fieldsIf true, keep the managedFields when printing objects in JSON or YAML format.--subresource stringIf specified, patch will operate on the subresource of the requested object.--template stringTemplate string or path to template file to use when -o=go-template, -o=go-template-file. The template format is


Question: When would you use kubectl patch?

Answer: kubectl patchSynopsisUpdate fields of a resource using strategic merge patch, a JSON merge patch, or a JSON patch.JSON and YAML formats are accepted.Note: Strategic merge patch is not supported for custom resources.kubectl patch (-f FILENAME | TYPE NAME) [-p PATCH|--patch-file FILE] Examples # Partially update a node using a strategic merge patch, specifying the patch as JSON kubectl patch node k8s-node-1 -p '{"spec":{"unschedulable":true}}' # Partially update a node using a strategic merge patch, specifying the patch as YAML kubectl patch node k8s-node-1 -p $'spec:\n unschedulable: true' # Partially update a node identified by the type and name specified in "node.json" using strategic merge patch kubectl patch -f node.json -p '{"spec":{"unschedulable":true}}' # Update a container's image; spec.containers[*].name is required because it's a merge key kubectl patch pod valid-pod -p '{"spec":{"containers":[{"name":"kubernetes-serve-hostname","image":"new image"}]}}' # Update a container's image using a JSON patch with positional arrays kubectl patch pod valid-pod --type='json' -p='[{"op": "replace", "path": "/spec/containers/0/image", "value":"new image"}]' # Update a deployment's replicas through the 'scale' subresource using a merge patch kubectl patch deployment nginx-deployment --subresource='scale' --type='merge' -p '{"spec":{"replicas":2}}' Options--allow-missing-template-keys Default: trueIf true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.--dry-run string[="unchanged"] Default: "none"Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.--field-manager string Default: "kubectl-patch"Name of the manager used to track field ownership.-f, --filename stringsFilename, directory, or URL to files identifying the resource to update-h, --helphelp for patch-k, --kustomize stringProcess the kustomization directory. This flag can't be used together with -f or -R.--localIf true, patch will operate on the content of the file, not the server-side resource.-o, --output stringOutput format. One of: (json, yaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file).-p, --patch stringThe patch to be applied to the resource JSON file.--patch-file stringA file containing a patch to be applied to the resource.-R, --recursiveProcess the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.--show-managed-fieldsIf true, keep the managedFields when printing objects in JSON or YAML format.--subresource stringIf specified, patch will operate on the subresource of the requested object.--template stringTemplate string or path to template file to use when -o=go-template, -o=go-template-file. The template format is


Question: What are the benefits of kubectl patch?

Answer: kubectl patchSynopsisUpdate fields of a resource using strategic merge patch, a JSON merge patch, or a JSON patch.JSON and YAML formats are accepted.Note: Strategic merge patch is not supported for custom resources.kubectl patch (-f FILENAME | TYPE NAME) [-p PATCH|--patch-file FILE] Examples # Partially update a node using a strategic merge patch, specifying the patch as JSON kubectl patch node k8s-node-1 -p '{"spec":{"unschedulable":true}}' # Partially update a node using a strategic merge patch, specifying the patch as YAML kubectl patch node k8s-node-1 -p $'spec:\n unschedulable: true' # Partially update a node identified by the type and name specified in "node.json" using strategic merge patch kubectl patch -f node.json -p '{"spec":{"unschedulable":true}}' # Update a container's image; spec.containers[*].name is required because it's a merge key kubectl patch pod valid-pod -p '{"spec":{"containers":[{"name":"kubernetes-serve-hostname","image":"new image"}]}}' # Update a container's image using a JSON patch with positional arrays kubectl patch pod valid-pod --type='json' -p='[{"op": "replace", "path": "/spec/containers/0/image", "value":"new image"}]' # Update a deployment's replicas through the 'scale' subresource using a merge patch kubectl patch deployment nginx-deployment --subresource='scale' --type='merge' -p '{"spec":{"replicas":2}}' Options--allow-missing-template-keys Default: trueIf true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.--dry-run string[="unchanged"] Default: "none"Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.--field-manager string Default: "kubectl-patch"Name of the manager used to track field ownership.-f, --filename stringsFilename, directory, or URL to files identifying the resource to update-h, --helphelp for patch-k, --kustomize stringProcess the kustomization directory. This flag can't be used together with -f or -R.--localIf true, patch will operate on the content of the file, not the server-side resource.-o, --output stringOutput format. One of: (json, yaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file).-p, --patch stringThe patch to be applied to the resource JSON file.--patch-file stringA file containing a patch to be applied to the resource.-R, --recursiveProcess the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.--show-managed-fieldsIf true, keep the managedFields when printing objects in JSON or YAML format.--subresource stringIf specified, patch will operate on the subresource of the requested object.--template stringTemplate string or path to template file to use when -o=go-template, -o=go-template-file. The template format is


Question: What is Synopsis?

Answer: U p d a t e   f i e l d s   o f   a   r e s o u r c e   u s i n g   s t r a t e g i c   m e r g e   p a t c h ,   a   J S O N   m e r g e   p a t c h ,   o r   a   J S O N   p a t c h .   J S O N   a n d   Y A M L   f o r m a t s   a r e   a c c e p t e d .   N o t e :   S t r a t e g i c   m e r g e   p a t c h   i s   n o t   s u p p o r t e d   f o r   c u s t o m   r e s o u r c e s .   k u b e c t l   p a t c h   ( - f   F I L E N A M E   |   T Y P E   N A M E )   [ - p   P A T C H | - - p a t c h - f i l e   F I L E ]


Question: What is Examples?

Answer: #   P a r t i a l l y   u p d a t e   a   n o d e   u s i n g   a   s t r a t e g i c   m e r g e   p a t c h ,   s p e c i f y i n g   t h e   p a t c h   a s   J S O N   k u b e c t l   p a t c h   n o d e   k 8 s - n o d e - 1   - p   ' { " s p e c " : { " u n s c h e d u l a b l e " : t r u e } } '   #   P a r t i a l l y   u p d a t e   a   n o d e   u s i n g   a   s t r a t e g i c   m e r g e   p a t c h ,   s p e c i f y i n g   t h e   p a t c h   a s   Y A M L   k u b e c t l   p a t c h   n o d e   k 8 s - n o d e - 1   - p   $ ' s p e c : \ n   u n s c h e d u l a b l e :   t r u e '   #   P a r t i a l l y   u p d a t e   a   n o d e   i d e n t i f i e d   b y   t h e   t y p e   a n d   n a m e   s p e c i f i e d   i n   " n o d e . j s o n "   u s i n g   s t r a t e g i c   m e r g e   p a t c h   k u b e c t l   p a t c h   - f   n o d e . j s o n   - p   ' { " s p e c " : { " u n s c h e d u l a b l e " : t r u e } } '   #   U p d a t e   a   c o n t a i n e r ' s   i m a g e ;   s p e c . c o n t a i n e r s [ * ] . n a m e   i s   r e q u i r e d   b e c a u s e   i t ' s   a   m e r g e   k e y   k u b e c t l   p a t c h   p o d   v a l i d - p o d   - p   ' { " s p e c " : { " c o n t a i n e r s " : [ { " n a m e " : " k u b e r n e t e s - s e r v e - h o s t n a m e " , " i m a g e " : " n e w   i m a g e " } ] } } '   #   U p d a t e   a   c o n t a i n e r ' s   i m a g e   u s i n g   a   J S O N   p a t c h   w i t h   p o s i t i o n a l   a r r a y s   k u b e c t l   p a t c h   p o d   v a l i d - p o d   - - t y p e = ' j s o n '   - p = ' [ { " o p " :   " r e p l a c e " ,   " p a t h " :   " / s p e c / c o n t a i n e r s / 0 / i m a g e " ,   " v a l u e " : " n e w   i m a g e " } ] '   #   U p d a t e   a   d e p l o y m e n t ' s   r e p l i c a s   t h r o u g h   t h e   ' s c a l e '   s u b r e s o u r c e   u s i n g   a   m e r g e   p a t c h   k u b e c t l   p a t c h   d e p l o y m e n t   n g i n x - d e p l


Question: What is Options?

Answer: I f   t r u e ,   i g n o r e   a n y   e r r o r s   i n   t e m p l a t e s   w h e n   a   f i e l d   o r   m a p   k e y   i s   m i s s i n g   i n   t h e   t e m p l a t e .   O n l y   a p p l i e s   t o   g o l a n g   a n d   j s o n p a t h   o u t p u t   f o r m a t s .   M u s t   b e   " n o n e " ,   " s e r v e r " ,   o r   " c l i e n t " .   I f   c l i e n t   s t r a t e g y ,   o n l y   p r i n t   t h e   o b j e c t   t h a t   w o u l d   b e   s e n t ,   w i t h o u t   s e n d i n g   i t .   I f   s e r v e r   s t r a t e g y ,   s u b m i t   s e r v e r - s i d e   r e q u e s t   w i t h o u t   p e r s i s t i n g   t h e   r e s o u r c e .   N a m e   o f   t h e   m a n a g e r   u s e d   t o   t r a c k   f i e l d   o w n e r s h i p .   F i l e n a m e ,   d i r e c t o r y ,   o r   U R L   t o   f i l e s   i d e n t i f y i n g   t h e   r e s o u r c e   t o   u p d a t e   h e l p   f o r   p a t c h   P r o c e s s   t h e   k u s t o m i z a t i o n   d i r e c t o r y .   T h i s   f l a g   c a n ' t   b e   u s e d   t o g e t h e r   w i t h   - f   o r   - R .   I f   t r u e ,   p a t c h   w i l l   o p e r a t e   o n   t h e   c o n t e n t   o f   t h e   f i l e ,   n o t   t h e   s e r v e r - s i d e   r e s o u r c e .   O u t p u t   f o r m a t .   O n e   o f :   ( j s o n ,   y a m l ,   n a m e ,   g o - t e m p l a t e ,   g o - t e m p l a t e - f i l e ,   t e m p l a t e ,   t e m p l a t e f i l e ,   j s o n p a t h ,   j s o n p a t h - a s - j s o n ,   j s o n p a t h - f i l e ) .   T h e   p a t c h   t o   b e   a p p l i e d   t o   t h e   r e s o u r c e   J S O N   f i l e .   A   f i l e   c o n t a i n i n g   a   p a t c h   t o   b e   a p p l i e d   t o   t h e   r e s o u r c e .   P r o c e s s   t h e   d i r e c t o r y   u s e d   i n   - f ,   - - f i l e n a m e   r e c u r s i v e l y .   U s e f u l   w h e n   y o u   w a n t   t o   m a n a g e   r e l a t e d


Question: What is Parent Options Inherited?

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


Question: What is See Also?

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


Question: What is Monitor Node Health?

Answer: Monitor Node HealthNode Problem Detector is a daemon for monitoring and reporting about a node's health. You can run Node Problem Detector as a DaemonSet or as a standalone daemon. Node Problem Detector collects information about node problems from various daemons and reports these conditions to the API server as Node Conditions or as Events.To learn how to install and use Node Problem Detector, see Node Problem Detector project documentation.Before you beginYou need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster. It is recommended to run this tutorial on a cluster with at least two nodes that are not acting as control plane hosts. If you do not already have a cluster, you can create one by using minikube or you can use one of these Kubernetes playgrounds:iximiuz LabsKillercodaKodeKloudPlay with KubernetesLimitationsNode Problem Detector uses the kernel log format for reporting kernel issues. To learn how to extend the kernel log format, see Add support for another log format.Enabling Node Problem DetectorSome cloud providers enable Node Problem Detector as an Addon. You can also enable Node Problem Detector with kubectl or by creating an Addon DaemonSet.Using kubectl to enable Node Problem Detectorkubectl provides the most flexible management of Node Problem Detector. You can overwrite the default configuration to fit it into your environment or to detect customized node problems. For example:Create a Node Problem Detector configuration similar to node-problem-detector.yaml:debug/node-problem-detector.yaml apiVersion: apps/v1 kind: DaemonSet metadata: name: node-problem-detector-v0.1 namespace: kube-system labels: k8s-app: node-problem-detector version: v0.1 kubernetes.io/cluster-service: "true" spec: selector: matchLabels: k8s-app: node-problem-detector version: v0.1 kubernetes.io/cluster-service: "true" template: metadata: labels: k8s-app: node-problem-detector version: v0.1 kubernetes.io/cluster-service: "true" spec: hostNetwork: true containers: - name: node-problem-detector image: registry.k8s.io/node-problem-detector:v0.1 securityContext: privileged: true resources: limits: cpu: "200m" memory: "100Mi" requests: cpu: "20m" memory: "20Mi" volumeMounts: - name: log mountPath: /log readOnly: true volumes: - name: log hostPath: path: /var/log/Note:You should verify that the system log directory is right for your operating system distribution.Start node problem detector with kubectl:kubectl apply -f https://k8s.io/examples/debug/node-problem-detector.yaml Using an Addon pod to enable Node Problem DetectorIf you are using a custom cluster bootstrap solution and don't need to overwrite the default configuration, you can leverage the Addon pod to further automate the deployment.Create node-problem-detector.yaml, and save the configuration in the Addon pod's directory /etc/kubernetes/addons/node-problem-detector on a control plane node.Overwrite the configurationThe default configu


Question: How does Monitor Node Health work?

Answer: Monitor Node HealthNode Problem Detector is a daemon for monitoring and reporting about a node's health. You can run Node Problem Detector as a DaemonSet or as a standalone daemon. Node Problem Detector collects information about node problems from various daemons and reports these conditions to the API server as Node Conditions or as Events.To learn how to install and use Node Problem Detector, see Node Problem Detector project documentation.Before you beginYou need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster. It is recommended to run this tutorial on a cluster with at least two nodes that are not acting as control plane hosts. If you do not already have a cluster, you can create one by using minikube or you can use one of these Kubernetes playgrounds:iximiuz LabsKillercodaKodeKloudPlay with KubernetesLimitationsNode Problem Detector uses the kernel log format for reporting kernel issues. To learn how to extend the kernel log format, see Add support for another log format.Enabling Node Problem DetectorSome cloud providers enable Node Problem Detector as an Addon. You can also enable Node Problem Detector with kubectl or by creating an Addon DaemonSet.Using kubectl to enable Node Problem Detectorkubectl provides the most flexible management of Node Problem Detector. You can overwrite the default configuration to fit it into your environment or to detect customized node problems. For example:Create a Node Problem Detector configuration similar to node-problem-detector.yaml:debug/node-problem-detector.yaml apiVersion: apps/v1 kind: DaemonSet metadata: name: node-problem-detector-v0.1 namespace: kube-system labels: k8s-app: node-problem-detector version: v0.1 kubernetes.io/cluster-service: "true" spec: selector: matchLabels: k8s-app: node-problem-detector version: v0.1 kubernetes.io/cluster-service: "true" template: metadata: labels: k8s-app: node-problem-detector version: v0.1 kubernetes.io/cluster-service: "true" spec: hostNetwork: true containers: - name: node-problem-detector image: registry.k8s.io/node-problem-detector:v0.1 securityContext: privileged: true resources: limits: cpu: "200m" memory: "100Mi" requests: cpu: "20m" memory: "20Mi" volumeMounts: - name: log mountPath: /log readOnly: true volumes: - name: log hostPath: path: /var/log/Note:You should verify that the system log directory is right for your operating system distribution.Start node problem detector with kubectl:kubectl apply -f https://k8s.io/examples/debug/node-problem-detector.yaml Using an Addon pod to enable Node Problem DetectorIf you are using a custom cluster bootstrap solution and don't need to overwrite the default configuration, you can leverage the Addon pod to further automate the deployment.Create node-problem-detector.yaml, and save the configuration in the Addon pod's directory /etc/kubernetes/addons/node-problem-detector on a control plane node.Overwrite the configurationThe default configu