Question: What are the benefits of CSIStorageCapacity?

Answer: CSIStorageCapacityCSIStorageCapacity stores the result of one CSI GetCapacity call.apiVersion: storage.k8s.io/v1import "k8s.io/api/storage/v1"CSIStorageCapacityCSIStorageCapacity stores the result of one CSI GetCapacity call. For a given StorageClass, this describes the available capacity in a particular topology segment. This can be used when considering where to instantiate new PersistentVolumes.For example this can express things like: - StorageClass "standard" has "1234 GiB" available in "topology.kubernetes.io/zone=us-east1" - StorageClass "localssd" has "10 GiB" available in "kubernetes.io/hostname=knode-abc123"The following three cases all imply that no capacity is available for a certain combination: - no object exists with suitable topology and storage class name - such an object exists, but the capacity is unset - such an object exists, but the capacity is zeroThe producer of these objects can decide which approach is more suitable.They are consumed by the kube-scheduler when a CSI driver opts into capacity-aware scheduling with CSIDriverSpec.StorageCapacity. The scheduler compares the MaximumVolumeSize against the requested size of pending volumes to filter out unsuitable nodes. If MaximumVolumeSize is unset, it falls back to a comparison against the less precise Capacity. If that is also unset, the scheduler assumes that capacity is insufficient and tries some other node.apiVersion: storage.k8s.io/v1kind: CSIStorageCapacitymetadata (ObjectMeta)Standard object's metadata. The name has no particular meaning. It must be a DNS subdomain (dots allowed, 253 characters). To ensure that there are no conflicts with other CSI drivers on the cluster, the recommendation is to use csisc-<uuid>, a generated name, or a reverse-domain name which ends with the unique CSI driver name.Objects are namespaced.More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadatastorageClassName (string), requiredstorageClassName represents the name of the StorageClass that the reported capacity applies to. It must meet the same requirements as the name of a StorageClass object (non-empty, DNS subdomain). If that object no longer exists, the CSIStorageCapacity object is obsolete and should be removed by its creator. This field is immutable.capacity (Quantity)capacity is the value reported by the CSI driver in its GetCapacityResponse for a GetCapacityRequest with topology and parameters that match the previous fields.The semantic is currently (CSI spec 1.2) defined as: The available capacity, in bytes, of the storage that can be used to provision volumes. If not set, that information is currently unavailable.maximumVolumeSize (Quantity)maximumVolumeSize is the value reported by the CSI driver in its GetCapacityResponse for a GetCapacityRequest with topology and parameters that match the previous fields.This is defined since CSI spec 1.4.0 as the largest size that may be used in a CreateVolumeRequest.capacity_range.required_b


Question: What is CSIStorageCapacity?

Answer: a p i V e r s i o n :   s t o r a g e . k 8 s . i o / v 1   i m p o r t   " k 8 s . i o / a p i / s t o r a g e / v 1 "


Question: What is CSIStorageCapacity?

Answer: C S I S t o r a g e C a p a c i t y   s t o r e s   t h e   r e s u l t   o f   o n e   C S I   G e t C a p a c i t y   c a l l .   F o r   a   g i v e n   S t o r a g e C l a s s ,   t h i s   d e s c r i b e s   t h e   a v a i l a b l e   c a p a c i t y   i n   a   p a r t i c u l a r   t o p o l o g y   s e g m e n t .   T h i s   c a n   b e   u s e d   w h e n   c o n s i d e r i n g   w h e r e   t o   i n s t a n t i a t e   n e w   P e r s i s t e n t V o l u m e s .   F o r   e x a m p l e   t h i s   c a n   e x p r e s s   t h i n g s   l i k e :   -   S t o r a g e C l a s s   " s t a n d a r d "   h a s   " 1 2 3 4   G i B "   a v a i l a b l e   i n   " t o p o l o g y . k u b e r n e t e s . i o / z o n e = u s - e a s t 1 "   -   S t o r a g e C l a s s   " l o c a l s s d "   h a s   " 1 0   G i B "   a v a i l a b l e   i n   " k u b e r n e t e s . i o / h o s t n a m e = k n o d e - a b c 1 2 3 "   T h e   f o l l o w i n g   t h r e e   c a s e s   a l l   i m p l y   t h a t   n o   c a p a c i t y   i s   a v a i l a b l e   f o r   a   c e r t a i n   c o m b i n a t i o n :   -   n o   o b j e c t   e x i s t s   w i t h   s u i t a b l e   t o p o l o g y   a n d   s t o r a g e   c l a s s   n a m e   -   s u c h   a n   o b j e c t   e x i s t s ,   b u t   t h e   c a p a c i t y   i s   u n s e t   -   s u c h   a n   o b j e c t   e x i s t s ,   b u t   t h e   c a p a c i t y   i s   z e r o   T h e   p r o d u c e r   o f   t h e s e   o b j e c t s   c a n   d e c i d e   w h i c h   a p p r o a c h   i s   m o r e   s u i t a b l e .   T h e y   a r e   c o n s u m e d   b y   t h e   k u b e - s c h e d u l e r   w h e n   a   C S I   d r i v e r   o p t s   i n t o   c a p a c i t y - a w a r e   s c h e d u l i n g   w i t h   C S I D r i v e r S p e c . S t o r a g e C a p a c i t y .   T h e   s c h e d u l e r   c o m p a r e s   t h e   M a x i m u m V o l u m e S i z e   a g a i n s t   t h e   r e q u e s t e d   s i z


Question: What is CSIStorageCapacityList?

Answer: C S I S t o r a g e C a p a c i t y L i s t   i s   a   c o l l e c t i o n   o f   C S I S t o r a g e C a p a c i t y   o b j e c t s .   a p i V e r s i o n :   s t o r a g e . k 8 s . i o / v 1 k i n d :   C S I S t o r a g e C a p a c i t y L i s t m e t a d a t a   ( L i s t M e t a ) S t a n d a r d   l i s t   m e t a d a t a   M o r e   i n f o :   h t t p s : / / g i t . k 8 s . i o / c o m m u n i t y / c o n t r i b u t o r s / d e v e l / s i g - a r c h i t e c t u r e / a p i - c o n v e n t i o n s . m d # m e t a d a t a i t e m s   ( [ ] C S I S t o r a g e C a p a c i t y ) ,   r e q u i r e d i t e m s   i s   t h e   l i s t   o f   C S I S t o r a g e C a p a c i t y   o b j e c t s .   a p i V e r s i o n :   s t o r a g e . k 8 s . i o / v 1   k i n d :   C S I S t o r a g e C a p a c i t y L i s t   m e t a d a t a   ( L i s t M e t a )   S t a n d a r d   l i s t   m e t a d a t a   M o r e   i n f o :   h t t p s : / / g i t . k 8 s . i o / c o m m u n i t y / c o n t r i b u t o r s / d e v e l / s i g - a r c h i t e c t u r e / a p i - c o n v e n t i o n s . m d # m e t a d a t a   i t e m s   ( [ ] C S I S t o r a g e C a p a c i t y ) ,   r e q u i r e d   i t e m s   i s   t h e   l i s t   o f   C S I S t o r a g e C a p a c i t y   o b j e c t s .


Question: What is HTTP Request?

Answer: G E T   / a p i s / s t o r a g e . k 8 s . i o / v 1 / n a m e s p a c e s / { n a m e s p a c e } / c s i s t o r a g e c a p a c i t i e s / { n a m e }


Question: What is Parameters?

Answer: n a m e   ( i n   p a t h ) :   s t r i n g ,   r e q u i r e d n a m e   o f   t h e   C S I S t o r a g e C a p a c i t y n a m e s p a c e   ( i n   p a t h ) :   s t r i n g ,   r e q u i r e d n a m e s p a c e p r e t t y   ( i n   q u e r y ) :   s t r i n g p r e t t y   n a m e   ( i n   p a t h ) :   s t r i n g ,   r e q u i r e d   n a m e   o f   t h e   C S I S t o r a g e C a p a c i t y   n a m e s p a c e   ( i n   p a t h ) :   s t r i n g ,   r e q u i r e d   n a m e s p a c e   p r e t t y   ( i n   q u e r y ) :   s t r i n g   p r e t t y


Question: What is Response?

Answer: 2 0 0   ( C S I S t o r a g e C a p a c i t y ) :   O K   4 0 1 :   U n a u t h o r i z e d


Question: What is HTTP Request?

Answer: G E T   / a p i s / s t o r a g e . k 8 s . i o / v 1 / n a m e s p a c e s / { n a m e s p a c e } / c s i s t o r a g e c a p a c i t i e s


Question: What is Parameters?

Answer: n a m e s p a c e   ( i n   p a t h ) :   s t r i n g ,   r e q u i r e d n a m e s p a c e a l l o w W a t c h B o o k m a r k s   ( i n   q u e r y ) :   b o o l e a n a l l o w W a t c h B o o k m a r k s c o n t i n u e   ( i n   q u e r y ) :   s t r i n g c o n t i n u e f i e l d S e l e c t o r   ( i n   q u e r y ) :   s t r i n g f i e l d S e l e c t o r l a b e l S e l e c t o r   ( i n   q u e r y ) :   s t r i n g l a b e l S e l e c t o r l i m i t   ( i n   q u e r y ) :   i n t e g e r l i m i t p r e t t y   ( i n   q u e r y ) :   s t r i n g p r e t t y r e s o u r c e V e r s i o n   ( i n   q u e r y ) :   s t r i n g r e s o u r c e V e r s i o n r e s o u r c e V e r s i o n M a t c h   ( i n   q u e r y ) :   s t r i n g r e s o u r c e V e r s i o n M a t c h s e n d I n i t i a l E v e n t s   ( i n   q u e r y ) :   b o o l e a n s e n d I n i t i a l E v e n t s t i m e o u t S e c o n d s   ( i n   q u e r y ) :   i n t e g e r t i m e o u t S e c o n d s w a t c h   ( i n   q u e r y ) :   b o o l e a n w a t c h   n a m e s p a c e   ( i n   p a t h ) :   s t r i n g ,   r e q u i r e d   n a m e s p a c e   a l l o w W a t c h B o o k m a r k s   ( i n   q u e r y ) :   b o o l e a n   a l l o w W a t c h B o o k m a r k s   c o n t i n u e   ( i n   q u e r y ) :   s t r i n g   c o n t i n u e   f i e l d S e l e c t o r   ( i n   q u e r y ) :   s t r i n g   f i e l d S e l e c t o r   l a b e l S e l e c t o r   ( i n   q u e r y ) :   s t r i n g   l a b e l S e l e c t o r   l i m i t   ( i n   q u e r y ) :   i n t e g e r   l i m i t   p r e t t y   ( i n   q u e r y ) :   s t r i n g   p r e t t y   r e s o u r c e V e r s i o n   ( i n   q u e r y ) :   s t r i n g   r e s o u r c e V e r s i o n   r e s o u r c e V e r s i o n M a t c h   ( i n   q u e r y ) :   s t r i n g   r e s o u r c e V e r s i o n M a t c h   s e n d I n i t i a l E v e n t s   ( i n   q u e r y ) :   b o o l e a n   s e n d I n i t i a l E v e n


Question: What is Response?

Answer: 2 0 0   ( C S I S t o r a g e C a p a c i t y L i s t ) :   O K   4 0 1 :   U n a u t h o r i z e d


Question: What is HTTP Request?

Answer: G E T   / a p i s / s t o r a g e . k 8 s . i o / v 1 / c s i s t o r a g e c a p a c i t i e s


Question: What is Parameters?

Answer: a l l o w W a t c h B o o k m a r k s   ( i n   q u e r y ) :   b o o l e a n a l l o w W a t c h B o o k m a r k s c o n t i n u e   ( i n   q u e r y ) :   s t r i n g c o n t i n u e f i e l d S e l e c t o r   ( i n   q u e r y ) :   s t r i n g f i e l d S e l e c t o r l a b e l S e l e c t o r   ( i n   q u e r y ) :   s t r i n g l a b e l S e l e c t o r l i m i t   ( i n   q u e r y ) :   i n t e g e r l i m i t p r e t t y   ( i n   q u e r y ) :   s t r i n g p r e t t y r e s o u r c e V e r s i o n   ( i n   q u e r y ) :   s t r i n g r e s o u r c e V e r s i o n r e s o u r c e V e r s i o n M a t c h   ( i n   q u e r y ) :   s t r i n g r e s o u r c e V e r s i o n M a t c h s e n d I n i t i a l E v e n t s   ( i n   q u e r y ) :   b o o l e a n s e n d I n i t i a l E v e n t s t i m e o u t S e c o n d s   ( i n   q u e r y ) :   i n t e g e r t i m e o u t S e c o n d s w a t c h   ( i n   q u e r y ) :   b o o l e a n w a t c h   a l l o w W a t c h B o o k m a r k s   ( i n   q u e r y ) :   b o o l e a n   a l l o w W a t c h B o o k m a r k s   c o n t i n u e   ( i n   q u e r y ) :   s t r i n g   c o n t i n u e   f i e l d S e l e c t o r   ( i n   q u e r y ) :   s t r i n g   f i e l d S e l e c t o r   l a b e l S e l e c t o r   ( i n   q u e r y ) :   s t r i n g   l a b e l S e l e c t o r   l i m i t   ( i n   q u e r y ) :   i n t e g e r   l i m i t   p r e t t y   ( i n   q u e r y ) :   s t r i n g   p r e t t y   r e s o u r c e V e r s i o n   ( i n   q u e r y ) :   s t r i n g   r e s o u r c e V e r s i o n   r e s o u r c e V e r s i o n M a t c h   ( i n   q u e r y ) :   s t r i n g   r e s o u r c e V e r s i o n M a t c h   s e n d I n i t i a l E v e n t s   ( i n   q u e r y ) :   b o o l e a n   s e n d I n i t i a l E v e n t s   t i m e o u t S e c o n d s   ( i n   q u e r y ) :   i n t e g e r   t i m e o u t S e c o n d s   w a t c h   ( i n   q u e r y ) :   b o o l e a n   w a t c h


Question: What is Response?

Answer: 2 0 0   ( C S I S t o r a g e C a p a c i t y L i s t ) :   O K   4 0 1 :   U n a u t h o r i z e d


Question: What is HTTP Request?

Answer: P O S T   / a p i s / s t o r a g e . k 8 s . i o / v 1 / n a m e s p a c e s / { n a m e s p a c e } / c s i s t o r a g e c a p a c i t i e s


Question: What is Parameters?

Answer: n a m e s p a c e   ( i n   p a t h ) :   s t r i n g ,   r e q u i r e d n a m e s p a c e b o d y :   C S I S t o r a g e C a p a c i t y ,   r e q u i r e d d r y R u n   ( i n   q u e r y ) :   s t r i n g d r y R u n f i e l d M a n a g e r   ( i n   q u e r y ) :   s t r i n g f i e l d M a n a g e r f i e l d V a l i d a t i o n   ( i n   q u e r y ) :   s t r i n g f i e l d V a l i d a t i o n p r e t t y   ( i n   q u e r y ) :   s t r i n g p r e t t y   n a m e s p a c e   ( i n   p a t h ) :   s t r i n g ,   r e q u i r e d   n a m e s p a c e   b o d y :   C S I S t o r a g e C a p a c i t y ,   r e q u i r e d   d r y R u n   ( i n   q u e r y ) :   s t r i n g   d r y R u n   f i e l d M a n a g e r   ( i n   q u e r y ) :   s t r i n g   f i e l d M a n a g e r   f i e l d V a l i d a t i o n   ( i n   q u e r y ) :   s t r i n g   f i e l d V a l i d a t i o n   p r e t t y   ( i n   q u e r y ) :   s t r i n g   p r e t t y


Question: What is Response?

Answer: 2 0 0   ( C S I S t o r a g e C a p a c i t y ) :   O K   2 0 1   ( C S I S t o r a g e C a p a c i t y ) :   C r e a t e d   2 0 2   ( C S I S t o r a g e C a p a c i t y ) :   A c c e p t e d   4 0 1 :   U n a u t h o r i z e d


Question: What is HTTP Request?

Answer: P U T   / a p i s / s t o r a g e . k 8 s . i o / v 1 / n a m e s p a c e s / { n a m e s p a c e } / c s i s t o r a g e c a p a c i t i e s / { n a m e }


Question: What is Parameters?

Answer: n a m e   ( i n   p a t h ) :   s t r i n g ,   r e q u i r e d n a m e   o f   t h e   C S I S t o r a g e C a p a c i t y n a m e s p a c e   ( i n   p a t h ) :   s t r i n g ,   r e q u i r e d n a m e s p a c e b o d y :   C S I S t o r a g e C a p a c i t y ,   r e q u i r e d d r y R u n   ( i n   q u e r y ) :   s t r i n g d r y R u n f i e l d M a n a g e r   ( i n   q u e r y ) :   s t r i n g f i e l d M a n a g e r f i e l d V a l i d a t i o n   ( i n   q u e r y ) :   s t r i n g f i e l d V a l i d a t i o n p r e t t y   ( i n   q u e r y ) :   s t r i n g p r e t t y   n a m e   ( i n   p a t h ) :   s t r i n g ,   r e q u i r e d   n a m e   o f   t h e   C S I S t o r a g e C a p a c i t y   n a m e s p a c e   ( i n   p a t h ) :   s t r i n g ,   r e q u i r e d   n a m e s p a c e   b o d y :   C S I S t o r a g e C a p a c i t y ,   r e q u i r e d   d r y R u n   ( i n   q u e r y ) :   s t r i n g   d r y R u n   f i e l d M a n a g e r   ( i n   q u e r y ) :   s t r i n g   f i e l d M a n a g e r   f i e l d V a l i d a t i o n   ( i n   q u e r y ) :   s t r i n g   f i e l d V a l i d a t i o n   p r e t t y   ( i n   q u e r y ) :   s t r i n g   p r e t t y


Question: What is Response?

Answer: 2 0 0   ( C S I S t o r a g e C a p a c i t y ) :   O K   2 0 1   ( C S I S t o r a g e C a p a c i t y ) :   C r e a t e d   4 0 1 :   U n a u t h o r i z e d


Question: What is HTTP Request?

Answer: P A T C H   / a p i s / s t o r a g e . k 8 s . i o / v 1 / n a m e s p a c e s / { n a m e s p a c e } / c s i s t o r a g e c a p a c i t i e s / { n a m e }


Question: What is Parameters?

Answer: n a m e   ( i n   p a t h ) :   s t r i n g ,   r e q u i r e d n a m e   o f   t h e   C S I S t o r a g e C a p a c i t y n a m e s p a c e   ( i n   p a t h ) :   s t r i n g ,   r e q u i r e d n a m e s p a c e b o d y :   P a t c h ,   r e q u i r e d d r y R u n   ( i n   q u e r y ) :   s t r i n g d r y R u n f i e l d M a n a g e r   ( i n   q u e r y ) :   s t r i n g f i e l d M a n a g e r f i e l d V a l i d a t i o n   ( i n   q u e r y ) :   s t r i n g f i e l d V a l i d a t i o n f o r c e   ( i n   q u e r y ) :   b o o l e a n f o r c e p r e t t y   ( i n   q u e r y ) :   s t r i n g p r e t t y   n a m e   ( i n   p a t h ) :   s t r i n g ,   r e q u i r e d   n a m e   o f   t h e   C S I S t o r a g e C a p a c i t y   n a m e s p a c e   ( i n   p a t h ) :   s t r i n g ,   r e q u i r e d   n a m e s p a c e   b o d y :   P a t c h ,   r e q u i r e d   d r y R u n   ( i n   q u e r y ) :   s t r i n g   d r y R u n   f i e l d M a n a g e r   ( i n   q u e r y ) :   s t r i n g   f i e l d M a n a g e r   f i e l d V a l i d a t i o n   ( i n   q u e r y ) :   s t r i n g   f i e l d V a l i d a t i o n   f o r c e   ( i n   q u e r y ) :   b o o l e a n   f o r c e   p r e t t y   ( i n   q u e r y ) :   s t r i n g   p r e t t y


Question: What is Response?

Answer: 2 0 0   ( C S I S t o r a g e C a p a c i t y ) :   O K   2 0 1   ( C S I S t o r a g e C a p a c i t y ) :   C r e a t e d   4 0 1 :   U n a u t h o r i z e d


Question: What is HTTP Request?

Answer: D E L E T E   / a p i s / s t o r a g e . k 8 s . i o / v 1 / n a m e s p a c e s / { n a m e s p a c e } / c s i s t o r a g e c a p a c i t i e s / { n a m e }


Question: What is Parameters?

Answer: n a m e   ( i n   p a t h ) :   s t r i n g ,   r e q u i r e d n a m e   o f   t h e   C S I S t o r a g e C a p a c i t y n a m e s p a c e   ( i n   p a t h ) :   s t r i n g ,   r e q u i r e d n a m e s p a c e b o d y :   D e l e t e O p t i o n s d r y R u n   ( i n   q u e r y ) :   s t r i n g d r y R u n g r a c e P e r i o d S e c o n d s   ( i n   q u e r y ) :   i n t e g e r g r a c e P e r i o d S e c o n d s i g n o r e S t o r e R e a d E r r o r W i t h C l u s t e r B r e a k i n g P o t e n t i a l   ( i n   q u e r y ) :   b o o l e a n i g n o r e S t o r e R e a d E r r o r W i t h C l u s t e r B r e a k i n g P o t e n t i a l p r e t t y   ( i n   q u e r y ) :   s t r i n g p r e t t y p r o p a g a t i o n P o l i c y   ( i n   q u e r y ) :   s t r i n g p r o p a g a t i o n P o l i c y   n a m e   ( i n   p a t h ) :   s t r i n g ,   r e q u i r e d   n a m e   o f   t h e   C S I S t o r a g e C a p a c i t y   n a m e s p a c e   ( i n   p a t h ) :   s t r i n g ,   r e q u i r e d   n a m e s p a c e   b o d y :   D e l e t e O p t i o n s   d r y R u n   ( i n   q u e r y ) :   s t r i n g   d r y R u n   g r a c e P e r i o d S e c o n d s   ( i n   q u e r y ) :   i n t e g e r   g r a c e P e r i o d S e c o n d s   i g n o r e S t o r e R e a d E r r o r W i t h C l u s t e r B r e a k i n g P o t e n t i a l   ( i n   q u e r y ) :   b o o l e a n   i g n o r e S t o r e R e a d E r r o r W i t h C l u s t e r B r e a k i n g P o t e n t i a l   p r e t t y   ( i n   q u e r y ) :   s t r i n g   p r e t t y   p r o p a g a t i o n P o l i c y   ( i n   q u e r y ) :   s t r i n g   p r o p a g a t i o n P o l i c y


Question: What is Response?

Answer: 2 0 0   ( S t a t u s ) :   O K   2 0 2   ( S t a t u s ) :   A c c e p t e d   4 0 1 :   U n a u t h o r i z e d


Question: What is HTTP Request?

Answer: D E L E T E   / a p i s / s t o r a g e . k 8 s . i o / v 1 / n a m e s p a c e s / { n a m e s p a c e } / c s i s t o r a g e c a p a c i t i e s


Question: What is Parameters?

Answer: n a m e s p a c e   ( i n   p a t h ) :   s t r i n g ,   r e q u i r e d n a m e s p a c e b o d y :   D e l e t e O p t i o n s c o n t i n u e   ( i n   q u e r y ) :   s t r i n g c o n t i n u e d r y R u n   ( i n   q u e r y ) :   s t r i n g d r y R u n f i e l d S e l e c t o r   ( i n   q u e r y ) :   s t r i n g f i e l d S e l e c t o r g r a c e P e r i o d S e c o n d s   ( i n   q u e r y ) :   i n t e g e r g r a c e P e r i o d S e c o n d s i g n o r e S t o r e R e a d E r r o r W i t h C l u s t e r B r e a k i n g P o t e n t i a l   ( i n   q u e r y ) :   b o o l e a n i g n o r e S t o r e R e a d E r r o r W i t h C l u s t e r B r e a k i n g P o t e n t i a l l a b e l S e l e c t o r   ( i n   q u e r y ) :   s t r i n g l a b e l S e l e c t o r l i m i t   ( i n   q u e r y ) :   i n t e g e r l i m i t p r e t t y   ( i n   q u e r y ) :   s t r i n g p r e t t y p r o p a g a t i o n P o l i c y   ( i n   q u e r y ) :   s t r i n g p r o p a g a t i o n P o l i c y r e s o u r c e V e r s i o n   ( i n   q u e r y ) :   s t r i n g r e s o u r c e V e r s i o n r e s o u r c e V e r s i o n M a t c h   ( i n   q u e r y ) :   s t r i n g r e s o u r c e V e r s i o n M a t c h s e n d I n i t i a l E v e n t s   ( i n   q u e r y ) :   b o o l e a n s e n d I n i t i a l E v e n t s t i m e o u t S e c o n d s   ( i n   q u e r y ) :   i n t e g e r t i m e o u t S e c o n d s   n a m e s p a c e   ( i n   p a t h ) :   s t r i n g ,   r e q u i r e d   n a m e s p a c e   b o d y :   D e l e t e O p t i o n s   c o n t i n u e   ( i n   q u e r y ) :   s t r i n g   c o n t i n u e   d r y R u n   ( i n   q u e r y ) :   s t r i n g   d r y R u n   f i e l d S e l e c t o r   ( i n   q u e r y ) :   s t r i n g   f i e l d S e l e c t o r   g r a c e P e r i o d S e c o n d s   ( i n   q u e r y ) :   i n t e g e r   g r a c e P e r i o d S e c o n d s   i g n o r e S t o r e R e a d E r r o r W i t h C l u s t e r B r e a k i n g


Question: What is Response?

Answer: 2 0 0   ( S t a t u s ) :   O K   4 0 1 :   U n a u t h o r i z e d   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 Run a Single-Instance Stateful Application?

Answer: Run a Single-Instance Stateful ApplicationThis page shows you how to run a single-instance stateful application in Kubernetes using a PersistentVolume and a Deployment. The application is MySQL.ObjectivesCreate a PersistentVolume referencing a disk in your environment.Create a MySQL Deployment.Expose MySQL to other pods in the cluster at a known DNS name.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 KubernetesTo check the version, enter kubectl version.You need to either have a dynamic PersistentVolume provisioner with a default StorageClass, or statically provision PersistentVolumes yourself to satisfy the PersistentVolumeClaims used here.Deploy MySQLYou can run a stateful application by creating a Kubernetes Deployment and connecting it to an existing PersistentVolume using a PersistentVolumeClaim. For example, this YAML file describes a Deployment that runs MySQL and references the PersistentVolumeClaim. The file defines a volume mount for /var/lib/mysql, and then creates a PersistentVolumeClaim that looks for a 20G volume. This claim is satisfied by any existing volume that meets the requirements, or by a dynamic provisioner.Note: The password is defined in the config yaml, and this is insecure. See Kubernetes Secrets for a secure solution.application/mysql/mysql-deployment.yaml apiVersion: v1 kind: Service metadata: name: mysql spec: ports: - port: 3306 selector: app: mysql clusterIP: None --- apiVersion: apps/v1 kind: Deployment metadata: name: mysql spec: selector: matchLabels: app: mysql strategy: type: Recreate template: metadata: labels: app: mysql spec: containers: - image: mysql:9 name: mysql env: # Use secret in real usage - name: MYSQL_ROOT_PASSWORD value: password ports: - containerPort: 3306 name: mysql volumeMounts: - name: mysql-persistent-storage mountPath: /var/lib/mysql volumes: - name: mysql-persistent-storage persistentVolumeClaim: claimName: mysql-pv-claim application/mysql/mysql-pv.yaml apiVersion: v1 kind: PersistentVolume metadata: name: mysql-pv-volume labels: type: local spec: storageClassName: manual capacity: storage: 20Gi accessModes: - ReadWriteOnce hostPath: path: "/mnt/data" --- apiVersion: v1 kind: PersistentVolumeClaim metadata: name: mysql-pv-claim spec: storageClassName: manual accessModes: - ReadWriteOnce resources: requests: storage: 20Gi Deploy the PV and PVC of the YAML file:kubectl apply -f https://k8s.io/examples/application/mysql/mysql-pv.yaml Deploy the contents of the YAML file:kubectl apply -f https://k8s.io/examples/application/mysql/mysql-deployment.yaml Display information about the Deployment:kubectl describe deploymen


Question: How does Run a Single-Instance Stateful Application work?

Answer: Run a Single-Instance Stateful ApplicationThis page shows you how to run a single-instance stateful application in Kubernetes using a PersistentVolume and a Deployment. The application is MySQL.ObjectivesCreate a PersistentVolume referencing a disk in your environment.Create a MySQL Deployment.Expose MySQL to other pods in the cluster at a known DNS name.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 KubernetesTo check the version, enter kubectl version.You need to either have a dynamic PersistentVolume provisioner with a default StorageClass, or statically provision PersistentVolumes yourself to satisfy the PersistentVolumeClaims used here.Deploy MySQLYou can run a stateful application by creating a Kubernetes Deployment and connecting it to an existing PersistentVolume using a PersistentVolumeClaim. For example, this YAML file describes a Deployment that runs MySQL and references the PersistentVolumeClaim. The file defines a volume mount for /var/lib/mysql, and then creates a PersistentVolumeClaim that looks for a 20G volume. This claim is satisfied by any existing volume that meets the requirements, or by a dynamic provisioner.Note: The password is defined in the config yaml, and this is insecure. See Kubernetes Secrets for a secure solution.application/mysql/mysql-deployment.yaml apiVersion: v1 kind: Service metadata: name: mysql spec: ports: - port: 3306 selector: app: mysql clusterIP: None --- apiVersion: apps/v1 kind: Deployment metadata: name: mysql spec: selector: matchLabels: app: mysql strategy: type: Recreate template: metadata: labels: app: mysql spec: containers: - image: mysql:9 name: mysql env: # Use secret in real usage - name: MYSQL_ROOT_PASSWORD value: password ports: - containerPort: 3306 name: mysql volumeMounts: - name: mysql-persistent-storage mountPath: /var/lib/mysql volumes: - name: mysql-persistent-storage persistentVolumeClaim: claimName: mysql-pv-claim application/mysql/mysql-pv.yaml apiVersion: v1 kind: PersistentVolume metadata: name: mysql-pv-volume labels: type: local spec: storageClassName: manual capacity: storage: 20Gi accessModes: - ReadWriteOnce hostPath: path: "/mnt/data" --- apiVersion: v1 kind: PersistentVolumeClaim metadata: name: mysql-pv-claim spec: storageClassName: manual accessModes: - ReadWriteOnce resources: requests: storage: 20Gi Deploy the PV and PVC of the YAML file:kubectl apply -f https://k8s.io/examples/application/mysql/mysql-pv.yaml Deploy the contents of the YAML file:kubectl apply -f https://k8s.io/examples/application/mysql/mysql-deployment.yaml Display information about the Deployment:kubectl describe deploymen


Question: When would you use Run a Single-Instance Stateful Application?

Answer: Run a Single-Instance Stateful ApplicationThis page shows you how to run a single-instance stateful application in Kubernetes using a PersistentVolume and a Deployment. The application is MySQL.ObjectivesCreate a PersistentVolume referencing a disk in your environment.Create a MySQL Deployment.Expose MySQL to other pods in the cluster at a known DNS name.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 KubernetesTo check the version, enter kubectl version.You need to either have a dynamic PersistentVolume provisioner with a default StorageClass, or statically provision PersistentVolumes yourself to satisfy the PersistentVolumeClaims used here.Deploy MySQLYou can run a stateful application by creating a Kubernetes Deployment and connecting it to an existing PersistentVolume using a PersistentVolumeClaim. For example, this YAML file describes a Deployment that runs MySQL and references the PersistentVolumeClaim. The file defines a volume mount for /var/lib/mysql, and then creates a PersistentVolumeClaim that looks for a 20G volume. This claim is satisfied by any existing volume that meets the requirements, or by a dynamic provisioner.Note: The password is defined in the config yaml, and this is insecure. See Kubernetes Secrets for a secure solution.application/mysql/mysql-deployment.yaml apiVersion: v1 kind: Service metadata: name: mysql spec: ports: - port: 3306 selector: app: mysql clusterIP: None --- apiVersion: apps/v1 kind: Deployment metadata: name: mysql spec: selector: matchLabels: app: mysql strategy: type: Recreate template: metadata: labels: app: mysql spec: containers: - image: mysql:9 name: mysql env: # Use secret in real usage - name: MYSQL_ROOT_PASSWORD value: password ports: - containerPort: 3306 name: mysql volumeMounts: - name: mysql-persistent-storage mountPath: /var/lib/mysql volumes: - name: mysql-persistent-storage persistentVolumeClaim: claimName: mysql-pv-claim application/mysql/mysql-pv.yaml apiVersion: v1 kind: PersistentVolume metadata: name: mysql-pv-volume labels: type: local spec: storageClassName: manual capacity: storage: 20Gi accessModes: - ReadWriteOnce hostPath: path: "/mnt/data" --- apiVersion: v1 kind: PersistentVolumeClaim metadata: name: mysql-pv-claim spec: storageClassName: manual accessModes: - ReadWriteOnce resources: requests: storage: 20Gi Deploy the PV and PVC of the YAML file:kubectl apply -f https://k8s.io/examples/application/mysql/mysql-pv.yaml Deploy the contents of the YAML file:kubectl apply -f https://k8s.io/examples/application/mysql/mysql-deployment.yaml Display information about the Deployment:kubectl describe deploymen


Question: What are the benefits of Run a Single-Instance Stateful Application?

Answer: Run a Single-Instance Stateful ApplicationThis page shows you how to run a single-instance stateful application in Kubernetes using a PersistentVolume and a Deployment. The application is MySQL.ObjectivesCreate a PersistentVolume referencing a disk in your environment.Create a MySQL Deployment.Expose MySQL to other pods in the cluster at a known DNS name.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 KubernetesTo check the version, enter kubectl version.You need to either have a dynamic PersistentVolume provisioner with a default StorageClass, or statically provision PersistentVolumes yourself to satisfy the PersistentVolumeClaims used here.Deploy MySQLYou can run a stateful application by creating a Kubernetes Deployment and connecting it to an existing PersistentVolume using a PersistentVolumeClaim. For example, this YAML file describes a Deployment that runs MySQL and references the PersistentVolumeClaim. The file defines a volume mount for /var/lib/mysql, and then creates a PersistentVolumeClaim that looks for a 20G volume. This claim is satisfied by any existing volume that meets the requirements, or by a dynamic provisioner.Note: The password is defined in the config yaml, and this is insecure. See Kubernetes Secrets for a secure solution.application/mysql/mysql-deployment.yaml apiVersion: v1 kind: Service metadata: name: mysql spec: ports: - port: 3306 selector: app: mysql clusterIP: None --- apiVersion: apps/v1 kind: Deployment metadata: name: mysql spec: selector: matchLabels: app: mysql strategy: type: Recreate template: metadata: labels: app: mysql spec: containers: - image: mysql:9 name: mysql env: # Use secret in real usage - name: MYSQL_ROOT_PASSWORD value: password ports: - containerPort: 3306 name: mysql volumeMounts: - name: mysql-persistent-storage mountPath: /var/lib/mysql volumes: - name: mysql-persistent-storage persistentVolumeClaim: claimName: mysql-pv-claim application/mysql/mysql-pv.yaml apiVersion: v1 kind: PersistentVolume metadata: name: mysql-pv-volume labels: type: local spec: storageClassName: manual capacity: storage: 20Gi accessModes: - ReadWriteOnce hostPath: path: "/mnt/data" --- apiVersion: v1 kind: PersistentVolumeClaim metadata: name: mysql-pv-claim spec: storageClassName: manual accessModes: - ReadWriteOnce resources: requests: storage: 20Gi Deploy the PV and PVC of the YAML file:kubectl apply -f https://k8s.io/examples/application/mysql/mysql-pv.yaml Deploy the contents of the YAML file:kubectl apply -f https://k8s.io/examples/application/mysql/mysql-deployment.yaml Display information about the Deployment:kubectl describe deploymen


Question: What is Run a Single-Instance Stateful Application?

Answer: T h i s   p a g e   s h o w s   y o u   h o w   t o   r u n   a   s i n g l e - i n s t a n c e   s t a t e f u l   a p p l i c a t i o n   i n   K u b e r n e t e s   u s i n g   a   P e r s i s t e n t V o l u m e   a n d   a   D e p l o y m e n t .   T h e   a p p l i c a t i o n   i s   M y S Q L .


Question: What is Objectives?

Answer: C r e a t e   a   P e r s i s t e n t V o l u m e   r e f e r e n c i n g   a   d i s k   i n   y o u r   e n v i r o n m e n t . C r e a t e   a   M y S Q L   D e p l o y m e n t . E x p o s e   M y S Q L   t o   o t h e r   p o d s   i n   t h e   c l u s t e r   a t   a   k n o w n   D N S   n a m e .


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   e i t h e r   h a v e   a   d y n a m i c   P e r s i s t e n t V o l u m e   p r o v i s i o n e r   w i t h   a   d e f a u l t   S t o r a g e C l a s s ,   o r   s t a t i c a l l y   p r o v i s i o n   P e r s i s t e n t V o l u m e s   y o u r s e l f   t o   s a t i s f y   t h e   P e r s i s t e n t V o l u m e C l a i m s   u s e d   h e r e .   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


Question: What is Deploy MySQL?

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


Question: What is Accessing the MySQL instance?

Answer: T h e   p r e c e d i n g   Y A M L   f i l e   c r e a t e s   a   s e r v i c e   t h a t   a l l o w s   o t h e r   P o d s   i n   t h e   c l u s t e r   t o   a c c e s s   t h e   d a t a b a s e .   T h e   S e r v i c e   o p t i o n   c l u s t e r I P :   N o n e   l e t s   t h e   S e r v i c e   D N S   n a m e   r e s o l v e   d i r e c t l y   t o   t h e   P o d ' s   I P   a d d r e s s .   T h i s   i s   o p t i m a l   w h e n   y o u   h a v e   o n l y   o n e   P o d   b e h i n d   a   S e r v i c e   a n d   y o u   d o n ' t   i n t e n d   t o   i n c r e a s e   t h e   n u m b e r   o f   P o d s .   R u n   a   M y S Q L   c l i e n t   t o   c o n n e c t   t o   t h e   s e r v e r :   k u b e c t l   r u n   - i t   - - r m   - - i m a g e = m y s q l : 9   - - r e s t a r t = N e v e r   m y s q l - c l i e n t   - -   m y s q l   - h   m y s q l   - p p a s s w o r d   T h i s   c o m m a n d   c r e a t e s   a   n e w   P o d   i n   t h e   c l u s t e r   r u n n i n g   a   M y S Q L   c l i e n t   a n d   c o n n e c t s   i t   t o   t h e   s e r v e r   t h r o u g h   t h e   S e r v i c e .   I f   i t   c o n n e c t s ,   y o u   k n o w   y o u r   s t a t e f u l   M y S Q L   d a t a b a s e   i s   u p   a n d   r u n n i n g .   W a i t i n g   f o r   p o d   d e f a u l t / m y s q l - c l i e n t - 2 7 4 4 4 2 4 3 9 - z y p 6 i   t o   b e   r u n n i n g ,   s t a t u s   i s   P e n d i n g ,   p o d   r e a d y :   f a l s e   I f   y o u   d o n ' t   s e e   a   c o m m a n d   p r o m p t ,   t r y   p r e s s i n g   e n t e r .   m y s q l >


Question: What is Updating?

Answer: T h e   i m a g e   o r   a n y   o t h e r   p a r t   o f   t h e   D e p l o y m e n t   c a n   b e   u p d a t e d   a s   u s u a l   w i t h   t h e   k u b e c t l   a p p l y   c o m m a n d .   H e r e   a r e   s o m e   p r e c a u t i o n s   t h a t   a r e   s p e c i f i c   t o   s t a t e f u l   a p p s :   D o n ' t   s c a l e   t h e   a p p .   T h i s   s e t u p   i s   f o r   s i n g l e - i n s t a n c e   a p p s   o n l y .   T h e   u n d e r l y i n g   P e r s i s t e n t V o l u m e   c a n   o n l y   b e   m o u n t e d   t o   o n e   P o d .   F o r   c l u s t e r e d   s t a t e f u l   a p p s ,   s e e   t h e   S t a t e f u l S e t   d o c u m e n t a t i o n . U s e   s t r a t e g y :   t y p e :   R e c r e a t e   i n   t h e   D e p l o y m e n t   c o n f i g u r a t i o n   Y A M L   f i l e .   T h i s   i n s t r u c t s   K u b e r n e t e s   t o   n o t   u s e   r o l l i n g   u p d a t e s .   R o l l i n g   u p d a t e s   w i l l   n o t   w o r k ,   a s   y o u   c a n n o t   h a v e   m o r e   t h a n   o n e   P o d   r u n n i n g   a t   a   t i m e .   T h e   R e c r e a t e   s t r a t e g y   w i l l   s t o p   t h e   f i r s t   p o d   b e f o r e   c r e a t i n g   a   n e w   o n e   w i t h   t h e   u p d a t e d   c o n f i g u r a t i o n .


Question: What is Deleting a deployment?

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


Question: What is What's next?

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


Question: What is Node Labels Populated By The Kubelet?

Answer: Node Labels Populated By The KubeletKubernetes nodes come pre-populated with a standard set of labels.You can also set your own labels on nodes, either through the kubelet configuration or using the Kubernetes API.Preset labelsThe preset labels that Kubernetes sets on nodes are:kubernetes.io/archkubernetes.io/hostnamekubernetes.io/osnode.kubernetes.io/instance-type (if known to the kubelet – Kubernetes may not have this information to set the label)topology.kubernetes.io/region (if known to the kubelet – Kubernetes may not have this information to set the label)topology.kubernetes.io/zone (if known to the kubelet – Kubernetes may not have this information to set the label)Note:The value of these labels is cloud provider specific and is not guaranteed to be reliable. For example, the value of kubernetes.io/hostname may be the same as the node name in some environments and a different value in other environments.What's nextSee Well-Known Labels, Annotations and Taints for a list of common labels.Learn how to add a label to a node.


Question: How does Node Labels Populated By The Kubelet work?

Answer: Node Labels Populated By The KubeletKubernetes nodes come pre-populated with a standard set of labels.You can also set your own labels on nodes, either through the kubelet configuration or using the Kubernetes API.Preset labelsThe preset labels that Kubernetes sets on nodes are:kubernetes.io/archkubernetes.io/hostnamekubernetes.io/osnode.kubernetes.io/instance-type (if known to the kubelet – Kubernetes may not have this information to set the label)topology.kubernetes.io/region (if known to the kubelet – Kubernetes may not have this information to set the label)topology.kubernetes.io/zone (if known to the kubelet – Kubernetes may not have this information to set the label)Note:The value of these labels is cloud provider specific and is not guaranteed to be reliable. For example, the value of kubernetes.io/hostname may be the same as the node name in some environments and a different value in other environments.What's nextSee Well-Known Labels, Annotations and Taints for a list of common labels.Learn how to add a label to a node.


Question: When would you use Node Labels Populated By The Kubelet?

Answer: Node Labels Populated By The KubeletKubernetes nodes come pre-populated with a standard set of labels.You can also set your own labels on nodes, either through the kubelet configuration or using the Kubernetes API.Preset labelsThe preset labels that Kubernetes sets on nodes are:kubernetes.io/archkubernetes.io/hostnamekubernetes.io/osnode.kubernetes.io/instance-type (if known to the kubelet – Kubernetes may not have this information to set the label)topology.kubernetes.io/region (if known to the kubelet – Kubernetes may not have this information to set the label)topology.kubernetes.io/zone (if known to the kubelet – Kubernetes may not have this information to set the label)Note:The value of these labels is cloud provider specific and is not guaranteed to be reliable. For example, the value of kubernetes.io/hostname may be the same as the node name in some environments and a different value in other environments.What's nextSee Well-Known Labels, Annotations and Taints for a list of common labels.Learn how to add a label to a node.


Question: What are the benefits of Node Labels Populated By The Kubelet?

Answer: Node Labels Populated By The KubeletKubernetes nodes come pre-populated with a standard set of labels.You can also set your own labels on nodes, either through the kubelet configuration or using the Kubernetes API.Preset labelsThe preset labels that Kubernetes sets on nodes are:kubernetes.io/archkubernetes.io/hostnamekubernetes.io/osnode.kubernetes.io/instance-type (if known to the kubelet – Kubernetes may not have this information to set the label)topology.kubernetes.io/region (if known to the kubelet – Kubernetes may not have this information to set the label)topology.kubernetes.io/zone (if known to the kubelet – Kubernetes may not have this information to set the label)Note:The value of these labels is cloud provider specific and is not guaranteed to be reliable. For example, the value of kubernetes.io/hostname may be the same as the node name in some environments and a different value in other environments.What's nextSee Well-Known Labels, Annotations and Taints for a list of common labels.Learn how to add a label to a node.


Question: What is Node Labels Populated By The Kubelet?

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


Question: What is Preset labels?

Answer: T h e   p r e s e t   l a b e l s   t h a t   K u b e r n e t e s   s e t s   o n   n o d e s   a r e :   k u b e r n e t e s . i o / a r c h k u b e r n e t e s . i o / h o s t n a m e k u b e r n e t e s . i o / o s n o d e . k u b e r n e t e s . i o / i n s t a n c e - t y p e   ( i f   k n o w n   t o   t h e   k u b e l e t   –   K u b e r n e t e s   m a y   n o t   h a v e   t h i s   i n f o r m a t i o n   t o   s e t   t h e   l a b e l ) t o p o l o g y . k u b e r n e t e s . i o / r e g i o n   ( i f   k n o w n   t o   t h e   k u b e l e t   –   K u b e r n e t e s   m a y   n o t   h a v e   t h i s   i n f o r m a t i o n   t o   s e t   t h e   l a b e l ) t o p o l o g y . k u b e r n e t e s . i o / z o n e   ( i f   k n o w n   t o   t h e   k u b e l e t   –   K u b e r n e t e s   m a y   n o t   h a v e   t h i s   i n f o r m a t i o n   t o   s e t   t h e   l a b e l )


Question: What is What's next?

Answer: S e e   W e l l - K n o w n   L a b e l s ,   A n n o t a t i o n s   a n d   T a i n t s   f o r   a   l i s t   o f   c o m m o n   l a b e l s . L e a r n   h o w   t o   a d d   a   l a b e l   t o   a   n o d e .


Question: What is Swap memory management?

Answer: Swap memory managementKubernetes can be configured to use swap memory on a node, allowing the kernel to free up physical memory by swapping out pages to backing storage. This is useful for multiple use-cases. For example, nodes running workloads that can benefit from using swap, such as those that have large memory footprints but only access a portion of that memory at any given time. It also helps prevent Pods from being terminated during memory pressure spikes, shields nodes from system-level memory spikes that might compromise its stability, allows for more flexible memory management on the node, and much more.To learn about configuring swap in your cluster, read Configuring swap memory on Kubernetes nodes.Operating system supportLinux nodes support swap; you need to configure each node to enable it. By default, the kubelet will not start on a Linux node that has swap enabled.Windows nodes require swap space. By default, the kubelet does not start on a Windows node that has swap disabled.How does it work?There are a number of possible ways that one could envision swap use on a node. If kubelet is already running on a node, it would need to be restarted after swap is provisioned in order to identify it.When kubelet starts on a node in which swap is provisioned and available (with the failSwapOn: false configuration), kubelet will:Be able to start on this swap-enabled node.Direct the Container Runtime Interface (CRI) implementation, often referred to as the container runtime, to allocate zero swap memory to Kubernetes workloads by default.Swap configuration on a node is exposed to a cluster admin via the memorySwap in the KubeletConfiguration. As a cluster administrator, you can specify the node's behaviour in the presence of swap memory by setting memorySwap.swapBehavior.Swap behaviorsYou need to pick a swap behavior to use. Different nodes in your cluster can use different swap behaviors.The swap behaviors you can choose for Linux nodes are:NoSwap (default)Workloads running as Pods on this node do not and cannot use swap.LimitedSwapKubernetes workloads can utilize swap memory.Note:If you choose the NoSwap behavior, and you configure the kubelet to tolerate swap space (failSwapOn: false), then your workloads don't use any swap.However, processes outside of Kubernetes-managed containers, such as systemi services (and even the kubelet itself!) can utilize swap.You can read configuring swap memory on Kubernetes nodes to learn about enabling swap for your cluster.Container runtime integrationThe kubelet uses the container runtime API, and directs the container runtime to apply specific configuration (for example, in the cgroup v2 case, memory.swap.max) in a manner that will enable the desired swap configuration for a container. For runtimes that use control groups, or cgroups, the container runtime is then responsible for writing these settings to the container-level cgroup.Observability for swap useNode and container level metric statisticsKubelet


Question: How does Swap memory management work?

Answer: Swap memory managementKubernetes can be configured to use swap memory on a node, allowing the kernel to free up physical memory by swapping out pages to backing storage. This is useful for multiple use-cases. For example, nodes running workloads that can benefit from using swap, such as those that have large memory footprints but only access a portion of that memory at any given time. It also helps prevent Pods from being terminated during memory pressure spikes, shields nodes from system-level memory spikes that might compromise its stability, allows for more flexible memory management on the node, and much more.To learn about configuring swap in your cluster, read Configuring swap memory on Kubernetes nodes.Operating system supportLinux nodes support swap; you need to configure each node to enable it. By default, the kubelet will not start on a Linux node that has swap enabled.Windows nodes require swap space. By default, the kubelet does not start on a Windows node that has swap disabled.How does it work?There are a number of possible ways that one could envision swap use on a node. If kubelet is already running on a node, it would need to be restarted after swap is provisioned in order to identify it.When kubelet starts on a node in which swap is provisioned and available (with the failSwapOn: false configuration), kubelet will:Be able to start on this swap-enabled node.Direct the Container Runtime Interface (CRI) implementation, often referred to as the container runtime, to allocate zero swap memory to Kubernetes workloads by default.Swap configuration on a node is exposed to a cluster admin via the memorySwap in the KubeletConfiguration. As a cluster administrator, you can specify the node's behaviour in the presence of swap memory by setting memorySwap.swapBehavior.Swap behaviorsYou need to pick a swap behavior to use. Different nodes in your cluster can use different swap behaviors.The swap behaviors you can choose for Linux nodes are:NoSwap (default)Workloads running as Pods on this node do not and cannot use swap.LimitedSwapKubernetes workloads can utilize swap memory.Note:If you choose the NoSwap behavior, and you configure the kubelet to tolerate swap space (failSwapOn: false), then your workloads don't use any swap.However, processes outside of Kubernetes-managed containers, such as systemi services (and even the kubelet itself!) can utilize swap.You can read configuring swap memory on Kubernetes nodes to learn about enabling swap for your cluster.Container runtime integrationThe kubelet uses the container runtime API, and directs the container runtime to apply specific configuration (for example, in the cgroup v2 case, memory.swap.max) in a manner that will enable the desired swap configuration for a container. For runtimes that use control groups, or cgroups, the container runtime is then responsible for writing these settings to the container-level cgroup.Observability for swap useNode and container level metric statisticsKubelet


Question: When would you use Swap memory management?

Answer: Swap memory managementKubernetes can be configured to use swap memory on a node, allowing the kernel to free up physical memory by swapping out pages to backing storage. This is useful for multiple use-cases. For example, nodes running workloads that can benefit from using swap, such as those that have large memory footprints but only access a portion of that memory at any given time. It also helps prevent Pods from being terminated during memory pressure spikes, shields nodes from system-level memory spikes that might compromise its stability, allows for more flexible memory management on the node, and much more.To learn about configuring swap in your cluster, read Configuring swap memory on Kubernetes nodes.Operating system supportLinux nodes support swap; you need to configure each node to enable it. By default, the kubelet will not start on a Linux node that has swap enabled.Windows nodes require swap space. By default, the kubelet does not start on a Windows node that has swap disabled.How does it work?There are a number of possible ways that one could envision swap use on a node. If kubelet is already running on a node, it would need to be restarted after swap is provisioned in order to identify it.When kubelet starts on a node in which swap is provisioned and available (with the failSwapOn: false configuration), kubelet will:Be able to start on this swap-enabled node.Direct the Container Runtime Interface (CRI) implementation, often referred to as the container runtime, to allocate zero swap memory to Kubernetes workloads by default.Swap configuration on a node is exposed to a cluster admin via the memorySwap in the KubeletConfiguration. As a cluster administrator, you can specify the node's behaviour in the presence of swap memory by setting memorySwap.swapBehavior.Swap behaviorsYou need to pick a swap behavior to use. Different nodes in your cluster can use different swap behaviors.The swap behaviors you can choose for Linux nodes are:NoSwap (default)Workloads running as Pods on this node do not and cannot use swap.LimitedSwapKubernetes workloads can utilize swap memory.Note:If you choose the NoSwap behavior, and you configure the kubelet to tolerate swap space (failSwapOn: false), then your workloads don't use any swap.However, processes outside of Kubernetes-managed containers, such as systemi services (and even the kubelet itself!) can utilize swap.You can read configuring swap memory on Kubernetes nodes to learn about enabling swap for your cluster.Container runtime integrationThe kubelet uses the container runtime API, and directs the container runtime to apply specific configuration (for example, in the cgroup v2 case, memory.swap.max) in a manner that will enable the desired swap configuration for a container. For runtimes that use control groups, or cgroups, the container runtime is then responsible for writing these settings to the container-level cgroup.Observability for swap useNode and container level metric statisticsKubelet


Question: What are the benefits of Swap memory management?

Answer: Swap memory managementKubernetes can be configured to use swap memory on a node, allowing the kernel to free up physical memory by swapping out pages to backing storage. This is useful for multiple use-cases. For example, nodes running workloads that can benefit from using swap, such as those that have large memory footprints but only access a portion of that memory at any given time. It also helps prevent Pods from being terminated during memory pressure spikes, shields nodes from system-level memory spikes that might compromise its stability, allows for more flexible memory management on the node, and much more.To learn about configuring swap in your cluster, read Configuring swap memory on Kubernetes nodes.Operating system supportLinux nodes support swap; you need to configure each node to enable it. By default, the kubelet will not start on a Linux node that has swap enabled.Windows nodes require swap space. By default, the kubelet does not start on a Windows node that has swap disabled.How does it work?There are a number of possible ways that one could envision swap use on a node. If kubelet is already running on a node, it would need to be restarted after swap is provisioned in order to identify it.When kubelet starts on a node in which swap is provisioned and available (with the failSwapOn: false configuration), kubelet will:Be able to start on this swap-enabled node.Direct the Container Runtime Interface (CRI) implementation, often referred to as the container runtime, to allocate zero swap memory to Kubernetes workloads by default.Swap configuration on a node is exposed to a cluster admin via the memorySwap in the KubeletConfiguration. As a cluster administrator, you can specify the node's behaviour in the presence of swap memory by setting memorySwap.swapBehavior.Swap behaviorsYou need to pick a swap behavior to use. Different nodes in your cluster can use different swap behaviors.The swap behaviors you can choose for Linux nodes are:NoSwap (default)Workloads running as Pods on this node do not and cannot use swap.LimitedSwapKubernetes workloads can utilize swap memory.Note:If you choose the NoSwap behavior, and you configure the kubelet to tolerate swap space (failSwapOn: false), then your workloads don't use any swap.However, processes outside of Kubernetes-managed containers, such as systemi services (and even the kubelet itself!) can utilize swap.You can read configuring swap memory on Kubernetes nodes to learn about enabling swap for your cluster.Container runtime integrationThe kubelet uses the container runtime API, and directs the container runtime to apply specific configuration (for example, in the cgroup v2 case, memory.swap.max) in a manner that will enable the desired swap configuration for a container. For runtimes that use control groups, or cgroups, the container runtime is then responsible for writing these settings to the container-level cgroup.Observability for swap useNode and container level metric statisticsKubelet


Question: What is Swap memory management?

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


Question: What is Operating system support?

Answer: L i n u x   n o d e s   s u p p o r t   s w a p ;   y o u   n e e d   t o   c o n f i g u r e   e a c h   n o d e   t o   e n a b l e   i t .   B y   d e f a u l t ,   t h e   k u b e l e t   w i l l   n o t   s t a r t   o n   a   L i n u x   n o d e   t h a t   h a s   s w a p   e n a b l e d . W i n d o w s   n o d e s   r e q u i r e   s w a p   s p a c e .   B y   d e f a u l t ,   t h e   k u b e l e t   d o e s   n o t   s t a r t   o n   a   W i n d o w s   n o d e   t h a t   h a s   s w a p   d i s a b l e d .


Question: What is How does it work??

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


Question: What is Swap behaviors?

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


Question: What is Note:?

Answer: I f   y o u   c h o o s e   t h e   N o S w a p   b e h a v i o r ,   a n d   y o u   c o n f i g u r e   t h e   k u b e l e t   t o   t o l e r a t e   s w a p   s p a c e   ( f a i l S w a p O n :   f a l s e ) ,   t h e n   y o u r   w o r k l o a d s   d o n ' t   u s e   a n y   s w a p .   H o w e v e r ,   p r o c e s s e s   o u t s i d e   o f   K u b e r n e t e s - m a n a g e d   c o n t a i n e r s ,   s u c h   a s   s y s t e m i   s e r v i c e s   ( a n d   e v e n   t h e   k u b e l e t   i t s e l f ! )   c a n   u t i l i z e   s w a p .   Y o u   c a n   r e a d   c o n f i g u r i n g   s w a p   m e m o r y   o n   K u b e r n e t e s   n o d e s   t o   l e a r n   a b o u t   e n a b l i n g   s w a p   f o r   y o u r   c l u s t e r .


Question: What is Container runtime integration?

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


Question: What is Node and container level metric statistics?

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


Question: What is Using kubectl top --show-swap?

Answer: Q u e r y i n g   m e t r i c s   i s   v a l u a b l e ,   b u t   s o m e w h a t   c u m b e r s o m e ,   a s   t h e s e   m e t r i c s   a r e   d e s i g n e d   t o   b e   u s e d   b y   s o f t w a r e   r a t h e r   t h a n   h u m a n s .   I n   o r d e r   t o   c o n s u m e   t h i s   d a t a   i n   a   m o r e   u s e r - f r i e n d l y   w a y ,   t h e   k u b e c t l   t o p   c o m m a n d   h a s   b e e n   e x t e n d e d   t o   s u p p o r t   s w a p   m e t r i c s ,   u s i n g   t h e   - - s h o w - s w a p   f l a g .   I n   o r d e r   t o   r e c e i v e   i n f o r m a t i o n   a b o u t   s w a p   u s a g e   o n   n o d e s ,   k u b e c t l   t o p   n o d e s   - - s h o w - s w a p   c a n   b e   u s e d :   k u b e c t l   t o p   n o d e s   - - s h o w - s w a p   T h i s   w i l l   r e s u l t   i n   a n   o u t p u t   s i m i l a r   t o :   N A M E   C P U ( c o r e s )   C P U ( % )   M E M O R Y ( b y t e s )   M E M O R Y ( % )   S W A P ( b y t e s )   S W A P ( % )   n o d e 1   1 m   1 0 %   2 M i   1 0 %   1 M i   0 %   n o d e 2   5 m   1 0 %   6 M i   1 0 %   2 M i   0 %   n o d e 3   3 m   1 0 %   4 M i   1 0 %   < u n k n o w n >   < u n k n o w n >   I n   o r d e r   t o   r e c e i v e   i n f o r m a t i o n   a b o u t   s w a p   u s a g e   b y   p o d s ,   k u b e c t l   t o p   n o d e s   - - s h o w - s w a p   c a n   b e   u s e d :   k u b e c t l   t o p   p o d   - n   k u b e - s y s t e m   - - s h o w - s w a p   T h i s   w i l l   r e s u l t   i n   a n   o u t p u t   s i m i l a r   t o :   N A M E   C P U ( c o r e s )   M E M O R Y ( b y t e s )   S W A P ( b y t e s )   c o r e d n s - 5 8 d 5 b c 5 c d b - 5 n b k 4   2 m   1 9 M i   0 M i   c o r e d n s - 5 8 d 5 b c 5 c d b - j s h 2 6   3 m   3 7 M i   0 M i   e t c d - n o d e 0 1   5 1 m   1 4 3 M i   5 M i   k u b e - a p i s e r v e r - n o d e 0 1   9 8 m   8 2 4 M i   1 6 M i   k u b e - c o n t r o l l e r


Question: What is Nodes to report swap capacity as part of node status?

Answer: A   n e w   n o d e   s t a t u s   f i e l d   i s   n o w   a d d e d ,   n o d e . s t a t u s . n o d e I n f o . s w a p . c a p a c i t y ,   t o   r e p o r t   t h e   s w a p   c a p a c i t y   o f   a   n o d e .   A s   a n   e x a m p l e ,   t h e   f o l l o w i n g   c o m m a n d   c a n   b e   u s e d   t o   r e t r i e v e   t h e   s w a p   c a p a c i t y   o f   t h e   n o d e s   i n   a   c l u s t e r :   k u b e c t l   g e t   n o d e s   - o   g o - t e m p l a t e = ' { { r a n g e   . i t e m s } } { { . m e t a d a t a . n a m e } } :   { { i f   . s t a t u s . n o d e I n f o . s w a p . c a p a c i t y } } { { . s t a t u s . n o d e I n f o . s w a p . c a p a c i t y } } { { e l s e } } < u n k n o w n > { { e n d } } { { " \ n " } } { { e n d } } '   T h i s   w i l l   r e s u l t   i n   a n   o u t p u t   s i m i l a r   t o :   n o d e 1 :   2 1 4 7 4 8 3 6 4 8 0   n o d e 2 :   4 2 9 4 9 6 6 4 7 6 8   n o d e 3 :   < u n k n o w n >


Question: What is Swap discovery using Node Feature Discovery (NFD)?

Answer: N o d e   F e a t u r e   D i s c o v e r y   i s   a   K u b e r n e t e s   a d d o n   f o r   d e t e c t i n g   h a r d w a r e   f e a t u r e s   a n d   c o n f i g u r a t i o n .   I t   c a n   b e   u t i l i z e d   t o   d i s c o v e r   w h i c h   n o d e s   a r e   p r o v i s i o n e d   w i t h   s w a p .   A s   a n   e x a m p l e ,   t o   f i g u r e   o u t   w h i c h   n o d e s   a r e   p r o v i s i o n e d   w i t h   s w a p ,   u s e   t h e   f o l l o w i n g   c o m m a n d :   k u b e c t l   g e t   n o d e s   - o   j s o n p a t h = ' { r a n g e   . i t e m s [ ? ( @ . m e t a d a t a . l a b e l s . f e a t u r e \ . n o d e \ . k u b e r n e t e s \ . i o / m e m o r y - s w a p ) ] } { . m e t a d a t a . n a m e } { " \ t " } { . m e t a d a t a . l a b e l s . f e a t u r e \ . n o d e \ . k u b e r n e t e s \ . i o / m e m o r y - s w a p } { " \ n " } { e n d } '   T h i s   w i l l   r e s u l t   i n   a n   o u t p u t   s i m i l a r   t o :   k 8 s - w o r k e r 1 :   t r u e   k 8 s - w o r k e r 2 :   t r u e   k 8 s - w o r k e r 3 :   f a l s e   I n   t h i s   e x a m p l e ,   s w a p   i s   p r o v i s i o n e d   o n   n o d e s   k 8 s - w o r k e r 1   a n d   k 8 s - w o r k e r 2 ,   b u t   n o t   o n   k 8 s - w o r k e r 3 .


Question: What is Caution:?

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


Question: What is Memory-backed volumes?

Answer: O n   L i n u x   n o d e s ,   m e m o r y - b a c k e d   v o l u m e s   ( s u c h   a s   s e c r e t   v o l u m e   m o u n t s ,   o r   e m p t y D i r   w i t h   m e d i u m :   M e m o r y )   a r e   i m p l e m e n t e d   w i t h   a   t m p f s   f i l e s y s t e m .   T h e   c o n t e n t s   o f   s u c h   v o l u m e s   s h o u l d   r e m a i n   i n   m e m o r y   a t   a l l   t i m e s ,   h e n c e   s h o u l d   n o t   b e   s w a p p e d   t o   d i s k .   T o   e n s u r e   t h e   c o n t e n t s   o f   s u c h   v o l u m e s   r e m a i n   i n   m e m o r y ,   t h e   n o s w a p   t m p f s   o p t i o n   i s   b e i n g   u s e d .   T h e   L i n u x   k e r n e l   o f f i c i a l l y   s u p p o r t s   t h e   n o s w a p   o p t i o n   f r o m   v e r s i o n   6 . 3   ( m o r e   i n f o   c a n   b e   f o u n d   i n   L i n u x   K e r n e l   V e r s i o n   R e q u i r e m e n t s ) .   H o w e v e r ,   t h e   d i f f e r e n t   d i s t r i b u t i o n s   o f t e n   c h o o s e   t o   b a c k p o r t   t h i s   m o u n t   o p t i o n   t o   o l d e r   L i n u x   v e r s i o n s   a s   w e l l .   I n   o r d e r   t o   v e r i f y   w h e t h e r   t h e   n o d e   s u p p o r t s   t h e   n o s w a p   o p t i o n ,   t h e   k u b e l e t   w i l l   d o   t h e   f o l l o w i n g :   I f   t h e   k e r n e l ' s   v e r s i o n   i s   a b o v e   6 . 3   t h e n   t h e   n o s w a p   o p t i o n   w i l l   b e   a s s u m e d   t o   b e   s u p p o r t e d . O t h e r w i s e ,   k u b e l e t   w o u l d   t r y   t o   m o u n t   a   d u m m y   t m p f s   w i t h   t h e   n o s w a p   o p t i o n   a t   s t a r t u p .   I f   k u b e l e t   f a i l s   w i t h   a n   e r r o r   i n d i c a t i n g   o f   a n   u n k n o w n   o p t i o n ,   n o s w a p   w i l l   b e   a s s u m e d   t o   n o t   b e   s u p p o r t e d ,   h e n c e   w i l l   n o t   b e   u s e d .


Question: What is Evictions?

Answer: C o n f i g u r i n g   m e m o r y   e v i c t i o n   t h r e s h o l d s   f o r   s w a p - e n a b l e d   n o d e s   c a n   b e   t r i c k y .   W i t h   s w a p   b e i n g   d i s a b l e d ,   i t   i s   r e a s o n a b l e   t o   c o n f i g u r e   k u b e l e t ' s   e v i c t i o n   t h r e s h o l d s   t o   b e   a   b i t   l o w e r   t h a n   t h e   n o d e ' s   m e m o r y   c a p a c i t y .   T h e   r a t i o n a l e   i s   t h a t   w e   w a n t   K u b e r n e t e s   t o   s t a r t   e v i c t i n g   P o d s   b e f o r e   t h e   n o d e   r u n s   o u t   o f   m e m o r y   a n d   i n v o k e s   t h e   O u t   O f   M e m o r y   ( O O M )   k i l l e r ,   s i n c e   t h e   O O M   k i l l e r   i s   n o t   K u b e r n e t e s - a w a r e ,   t h e r e f o r e   d o e s   n o t   c o n s i d e r   t h i n g s   l i k e   Q o S ,   p o d   p r i o r i t y ,   o r   o t h e r   K u b e r n e t e s - s p e c i f i c   f a c t o r s .   W i t h   s w a p   e n a b l e d ,   t h e   s i t u a t i o n   i s   m o r e   c o m p l e x .   I n   L i n u x ,   t h e   v m . m i n _ f r e e _ k b y t e s   p a r a m e t e r   d e f i n e s   t h e   m e m o r y   t h r e s h o l d   f o r   t h e   k e r n e l   t o   s t a r t   a g g r e s s i v e l y   r e c l a i m i n g   m e m o r y ,   w h i c h   i n c l u d e s   s w a p p i n g   o u t   p a g e s .   I f   t h e   k u b e l e t ' s   e v i c t i o n   t h r e s h o l d s   a r e   s e t   i n   a   w a y   t h a t   e v i c t i o n   w o u l d   t a k e   p l a c e   b e f o r e   t h e   k e r n e l   s t a r t s   r e c l a i m i n g   m e m o r y ,   i t   c o u l d   l e a d   t o   w o r k l o a d s   n e v e r   b e i n g   a b l e   t o   s w a p   o u t   d u r i n g   n o d e   m e m o r y   p r e s s u r e .   H o w e v e r ,   s e t t i n g   t h e   e v i c t i o n   t h r e s h o l d s   t o o   h i g h   c o u l d   r e s u l t   i n   t h e   n o d


Question: What is Unutilized swap space?

Answer: U n d e r   t h e   L i m i t e d S w a p   b e h a v i o r ,   t h e   a m o u n t   o f   s w a p   a v a i l a b l e   t o   a   P o d   i s   d e t e r m i n e d   a u t o m a t i c a l l y ,   b a s e d   o n   t h e   p r o p o r t i o n   o f   t h e   m e m o r y   r e q u e s t e d   r e l a t i v e   t o   t h e   n o d e ' s   t o t a l   m e m o r y   ( F o r   m o r e   d e t a i l s ,   s e e   t h e   s e c t i o n   b e l o w ) .   T h i s   d e s i g n   m e a n s   t h a t   u s u a l l y   t h e r e   w o u l d   b e   s o m e   p o r t i o n   o f   s w a p   t h a t   w i l l   r e m a i n   r e s t r i c t e d   f o r   K u b e r n e t e s   w o r k l o a d s .   F o r   e x a m p l e ,   s i n c e   K u b e r n e t e s   1 . 3 4   d o e s   n o t   p e r m i t   s w a p   u s e   f o r   P o d s   i n   t h e   G u a r a n t e e d   Q o S   c l a s s ,   t h e   a m o u n t   o f   s w a p   t h a t ' s   p r o p o r t i o n a l   t o   t h e   m e m o r y   r e q u e s t   f o r   G u a r a n t e e d   p o d s   w o u l d   r e m a i n   u n u s e d   b y   K u b e r n e t e s   w o r k l o a d s .   T h i s   b e h a v i o r   c a r r i e s   s o m e   r i s k   i n   a   s i t u a t i o n   w h e r e   m a n y   p o d s   a r e   n o t   e l i g i b l e   f o r   s w a p p i n g .   O n   t h e   o t h e r   h a n d ,   i t   e f f e c t i v e l y   k e e p s   s o m e   s y s t e m - r e s e r v e d   a m o u n t   o f   s w a p   m e m o r y   t h a t   c a n   b e   u s e d   b y   p r o c e s s e s   o u t s i d e   o f   K u b e r n e t e s '   s c o p e ,   s u c h   a s   s y s t e m   d a e m o n s   a n d   e v e n   k u b e l e t   i t s e l f .


Question: What is Disable swap for system-critical daemons?

Answer: D u r i n g   t h e   t e s t i n g   p h a s e   a n d   b a s e d   o n   u s e r


Question: What is Protect system-critical daemons for I/O latency?

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


Question: What is Swap and control plane nodes?

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


Question: What is Use of a dedicated disk for swap?

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


Question: What is Swap-aware scheduling?

Answer: K u b e r n e t e s   1 . 3 4   d o e s   n o t   s u p p o r t   a l l o c a t i n g   P o d s   t o   n o d e s   i n   a   w a y   t h a t   a c c o u n t s   f o r   s w a p   m e m o r y   u s a g e .   T h e   s c h e d u l e r   t y p i c a l l y   u s e s   r e q u e s t s   f o r   i n f r a s t r u c t u r e   r e s o u r c e s   t o   g u i d e   P o d   p l a c e m e n t ,   a n d   P o d s   d o   n o t   r e q u e s t   s w a p   s p a c e ;   t h e y   j u s t   r e q u e s t   m e m o r y .   T h i s   m e a n s   t h a t   t h e   s c h e d u l e r   d o e s   n o t   c o n s i d e r   s w a p   m e m o r y   w h e n   m a k i n g   s c h e d u l i n g   d e c i s i o n s .   W h i l e   t h i s   i s   s o m e t h i n g   w e   a r e   a c t i v e l y   w o r k i n g   o n ,   i t   i s   n o t   y e t   i m p l e m e n t e d .   I n   o r d e r   f o r   a d m i n i s t r a t o r s   t o   e n s u r e   t h a t   P o d s   a r e   n o t   s c h e d u l e d   o n   n o d e s   w i t h   s w a p   m e m o r y   u n l e s s   t h e y   a r e   s p e c i f i c a l l y   i n t e n d e d   t o   u s e   i t ,   A d m i n i s t r a t o r s   c a n   t a i n t   n o d e s   w i t h   s w a p   a v a i l a b l e   t o   p r o t e c t   a g a i n s t   t h i s   p r o b l e m .   T a i n t s   w i l l   e n s u r e   t h a t   w o r k l o a d s   w h i c h   t o l e r a t e   s w a p   w i l l   n o t   s p i l l   o n t o   n o d e s   w i t h o u t   s w a p   u n d e r   l o a d .


Question: What is Selecting storage for optimal performance?

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


Question: What is How is the swap limit being determined with LimitedSwap??

Answer: T h e   c o n f i g u r a t i o n   o f   s w a p   m e m o r y ,   i n c l u d i n g   i t s   l i m i t a t i o n s ,   p r e s e n t s   a   s i g n i f i c a n t   c h a l l e n g e .   N o t   o n l y   i s   i t   p r o n e   t o   m i s c o n f i g u r a t i o n ,   b u t   a s   a   s y s t e m - l e v e l   p r o p e r t y ,   a n y   m i s c o n f i g u r a t i o n   c o u l d   p o t e n t i a l l y   c o m p r o m i s e   t h e   e n t i r e   n o d e   r a t h e r   t h a n   j u s t   a   s p e c i f i c   w o r k l o a d .   T o   m i t i g a t e   t h i s   r i s k   a n d   e n s u r e   t h e   h e a l t h   o f   t h e   n o d e ,   w e   h a v e   i m p l e m e n t e d   S w a p   w i t h   a u t o m a t i c   c o n f i g u r a t i o n   o f   l i m i t a t i o n s .   W i t h   L i m i t e d S w a p ,   P o d s   t h a t   d o   n o t   f a l l   u n d e r   t h e   B u r s t a b l e   Q o S   c l a s s i f i c a t i o n   ( i . e .   B e s t E f f o r t / G u a r a n t e e d   Q o S   P o d s )   a r e   p r o h i b i t e d   f r o m   u t i l i z i n g   s w a p   m e m o r y .   B e s t E f f o r t   Q o S   P o d s   e x h i b i t   u n p r e d i c t a b l e   m e m o r y   c o n s u m p t i o n   p a t t e r n s   a n d   l a c k   i n f o r m a t i o n   r e g a r d i n g   t h e i r   m e m o r y   u s a g e ,   m a k i n g   i t   d i f f i c u l t   t o   d e t e r m i n e   a   s a f e   a l l o c a t i o n   o f   s w a p   m e m o r y .   C o n v e r s e l y ,   G u a r a n t e e d   Q o S   P o d s   a r e   t y p i c a l l y   e m p l o y e d   f o r   a p p l i c a t i o n s   t h a t   r e l y   o n   t h e   p r e c i s e   a l l o c a t i o n   o f   r e s o u r c e s   s p e c i f i e d   b y   t h e   w o r k l o a d ,   w i t h   m e m o r y   b e i n g   i m m e d i a t e l y   a v a i l a b l e .   T o   m a i n t a i n   t h e   a f o r e m e n t i o n e d   s e c u r i t y   a n d   n o d e   h e a l t h   g u a r a n t


Question: What is What's next?

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


Question: What is kubectl config get-contexts?

Answer: kubectl config get-contextsSynopsisDisplay one or many contexts from the kubeconfig file.kubectl config get-contexts [(-o|--output=)name)] Examples # List all the contexts in your kubeconfig file kubectl config get-contexts # Describe one context in your kubeconfig file kubectl config get-contexts my-context Options-h, --helphelp for get-contexts--no-headersWhen using the default or custom-column output format, don't print headers (default print headers).-o, --output stringOutput format. One of: (name).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 key file for TLS--cluster stringThe name of the kubeconfig cluster to use--context stringThe name of the kubeconfig context to use--disable-compressionIf true, opt-out of response compression for all requests to the server--insecure-skip-tls-verifyIf true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure--kubeconfig stringuse a particular kubeconfig file--kuberc stringPath to the kuberc file to use for preferences. This can be disabled by exporting KUBECTL_KUBERC=false feature gate or turning off the feature KUBERC=off.--match-server-versionRequire server version to match client version-n, --namespace stringIf present, the namespace scope for this CLI request--password stringPassword for basic authentication to the API server--profile string Default: "none"Name of profile to capture. One of (none|cpu|heap|goroutine|threadcreate|block|mutex)--profile-output string Default: "profile.pprof"Name of the file to write the profile to--request-timeout string Default: "0"The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests.-s, --server stringThe address and port of the Kubernetes API server--storage-driver-buffer-duration duration Default: 1m0sWrites in the storage driver will be buffered for this duration, and committed to the non memory backends as a single transaction--storage-driver-db string Default: "cadvisor"database name--storage-driver-host string Default: "localhost:8086"database host:port--storage-driver-password string Default: "root"database password--storage-driver-secureuse secure connection with database--storage-driver-table string Default: "stats"table name--storage-driver-user string Default: "root"database username--tls-server-name stringServer name to use for server certificate validation. If it


Question: How does kubectl config get-contexts work?

Answer: kubectl config get-contextsSynopsisDisplay one or many contexts from the kubeconfig file.kubectl config get-contexts [(-o|--output=)name)] Examples # List all the contexts in your kubeconfig file kubectl config get-contexts # Describe one context in your kubeconfig file kubectl config get-contexts my-context Options-h, --helphelp for get-contexts--no-headersWhen using the default or custom-column output format, don't print headers (default print headers).-o, --output stringOutput format. One of: (name).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 key file for TLS--cluster stringThe name of the kubeconfig cluster to use--context stringThe name of the kubeconfig context to use--disable-compressionIf true, opt-out of response compression for all requests to the server--insecure-skip-tls-verifyIf true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure--kubeconfig stringuse a particular kubeconfig file--kuberc stringPath to the kuberc file to use for preferences. This can be disabled by exporting KUBECTL_KUBERC=false feature gate or turning off the feature KUBERC=off.--match-server-versionRequire server version to match client version-n, --namespace stringIf present, the namespace scope for this CLI request--password stringPassword for basic authentication to the API server--profile string Default: "none"Name of profile to capture. One of (none|cpu|heap|goroutine|threadcreate|block|mutex)--profile-output string Default: "profile.pprof"Name of the file to write the profile to--request-timeout string Default: "0"The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests.-s, --server stringThe address and port of the Kubernetes API server--storage-driver-buffer-duration duration Default: 1m0sWrites in the storage driver will be buffered for this duration, and committed to the non memory backends as a single transaction--storage-driver-db string Default: "cadvisor"database name--storage-driver-host string Default: "localhost:8086"database host:port--storage-driver-password string Default: "root"database password--storage-driver-secureuse secure connection with database--storage-driver-table string Default: "stats"table name--storage-driver-user string Default: "root"database username--tls-server-name stringServer name to use for server certificate validation. If it


Question: When would you use kubectl config get-contexts?

Answer: kubectl config get-contextsSynopsisDisplay one or many contexts from the kubeconfig file.kubectl config get-contexts [(-o|--output=)name)] Examples # List all the contexts in your kubeconfig file kubectl config get-contexts # Describe one context in your kubeconfig file kubectl config get-contexts my-context Options-h, --helphelp for get-contexts--no-headersWhen using the default or custom-column output format, don't print headers (default print headers).-o, --output stringOutput format. One of: (name).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 key file for TLS--cluster stringThe name of the kubeconfig cluster to use--context stringThe name of the kubeconfig context to use--disable-compressionIf true, opt-out of response compression for all requests to the server--insecure-skip-tls-verifyIf true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure--kubeconfig stringuse a particular kubeconfig file--kuberc stringPath to the kuberc file to use for preferences. This can be disabled by exporting KUBECTL_KUBERC=false feature gate or turning off the feature KUBERC=off.--match-server-versionRequire server version to match client version-n, --namespace stringIf present, the namespace scope for this CLI request--password stringPassword for basic authentication to the API server--profile string Default: "none"Name of profile to capture. One of (none|cpu|heap|goroutine|threadcreate|block|mutex)--profile-output string Default: "profile.pprof"Name of the file to write the profile to--request-timeout string Default: "0"The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests.-s, --server stringThe address and port of the Kubernetes API server--storage-driver-buffer-duration duration Default: 1m0sWrites in the storage driver will be buffered for this duration, and committed to the non memory backends as a single transaction--storage-driver-db string Default: "cadvisor"database name--storage-driver-host string Default: "localhost:8086"database host:port--storage-driver-password string Default: "root"database password--storage-driver-secureuse secure connection with database--storage-driver-table string Default: "stats"table name--storage-driver-user string Default: "root"database username--tls-server-name stringServer name to use for server certificate validation. If it