Question: When would you use kubectl certificate approve?

Answer: kubectl certificate approveSynopsisApprove a certificate signing request.kubectl certificate approve allows a cluster admin to approve a certificate signing request (CSR). This action tells a certificate signing controller to issue a certificate to the requester with the attributes requested in the CSR.SECURITY NOTICE: Depending on the requested attributes, the issued certificate can potentially grant a requester access to cluster resources or to authenticate as a requested identity. Before approving a CSR, ensure you understand what the signed certificate can do.kubectl certificate approve (-f FILENAME | NAME) Examples # Approve CSR 'csr-sqgzp' kubectl certificate approve csr-sqgzp Options--allow-missing-template-keys Default: trueIf true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.-f, --filename stringsFilename, directory, or URL to files identifying the resource to update--forceUpdate the CSR even if it is already approved.-h, --helphelp for approve-k, --kustomize stringProcess the kustomization directory. This flag can't be used together with -f or -R.-o, --output stringOutput format. One of: (json, yaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file).-R, --recursiveProcess the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.--show-managed-fieldsIf true, keep the managedFields when printing objects in JSON or YAML format.--template stringTemplate string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].Parent Options Inherited--as stringUsername to impersonate for the operation. User could be a regular user or a service account in a namespace.--as-group stringsGroup to impersonate for the operation, this flag can be repeated to specify multiple groups.--as-uid stringUID to impersonate for the operation.--cache-dir string Default: "$HOME/.kube/cache"Default cache directory--certificate-authority stringPath to a cert file for the certificate authority--client-certificate stringPath to a client certificate file for TLS--client-key stringPath to a client 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 stringPath to the kubeconfig file to use for CLI requests.--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 v


Question: What are the benefits of kubectl certificate approve?

Answer: kubectl certificate approveSynopsisApprove a certificate signing request.kubectl certificate approve allows a cluster admin to approve a certificate signing request (CSR). This action tells a certificate signing controller to issue a certificate to the requester with the attributes requested in the CSR.SECURITY NOTICE: Depending on the requested attributes, the issued certificate can potentially grant a requester access to cluster resources or to authenticate as a requested identity. Before approving a CSR, ensure you understand what the signed certificate can do.kubectl certificate approve (-f FILENAME | NAME) Examples # Approve CSR 'csr-sqgzp' kubectl certificate approve csr-sqgzp Options--allow-missing-template-keys Default: trueIf true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.-f, --filename stringsFilename, directory, or URL to files identifying the resource to update--forceUpdate the CSR even if it is already approved.-h, --helphelp for approve-k, --kustomize stringProcess the kustomization directory. This flag can't be used together with -f or -R.-o, --output stringOutput format. One of: (json, yaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file).-R, --recursiveProcess the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.--show-managed-fieldsIf true, keep the managedFields when printing objects in JSON or YAML format.--template stringTemplate string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].Parent Options Inherited--as stringUsername to impersonate for the operation. User could be a regular user or a service account in a namespace.--as-group stringsGroup to impersonate for the operation, this flag can be repeated to specify multiple groups.--as-uid stringUID to impersonate for the operation.--cache-dir string Default: "$HOME/.kube/cache"Default cache directory--certificate-authority stringPath to a cert file for the certificate authority--client-certificate stringPath to a client certificate file for TLS--client-key stringPath to a client 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 stringPath to the kubeconfig file to use for CLI requests.--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 v


Question: What is Synopsis?

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


Question: What is Examples?

Answer: #   A p p r o v e   C S R   ' c s r - s q g z p '   k u b e c t l   c e r t i f i c a t e   a p p r o v e   c s r - s q g z p


Question: What is Options?

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


Question: What is Parent Options Inherited?

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


Question: What is See Also?

Answer: k u b e c t l   c e r t i f i c a t e   -   M o d i f y   c e r t i f i c a t e   r e s o u r c e s   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 Custom Resources?

Answer: Custom ResourcesCustom resources are extensions of the Kubernetes API. This page discusses when to add a custom resource to your Kubernetes cluster and when to use a standalone service. It describes the two methods for adding custom resources and how to choose between them.Custom resourcesA resource is an endpoint in the Kubernetes API that stores a collection of API objects of a certain kind; for example, the built-in pods resource contains a collection of Pod objects.A custom resource is an extension of the Kubernetes API that is not necessarily available in a default Kubernetes installation. It represents a customization of a particular Kubernetes installation. However, many core Kubernetes functions are now built using custom resources, making Kubernetes more modular.Custom resources can appear and disappear in a running cluster through dynamic registration, and cluster admins can update custom resources independently of the cluster itself. Once a custom resource is installed, users can create and access its objects using kubectl, just as they do for built-in resources like Pods.Custom controllersOn their own, custom resources let you store and retrieve structured data. When you combine a custom resource with a custom controller, custom resources provide a true declarative API.The Kubernetes declarative API enforces a separation of responsibilities. You declare the desired state of your resource. The Kubernetes controller keeps the current state of Kubernetes objects in sync with your declared desired state. This is in contrast to an imperative API, where you instruct a server what to do.You can deploy and update a custom controller on a running cluster, independently of the cluster's lifecycle. Custom controllers can work with any kind of resource, but they are especially effective when combined with custom resources. The Operator pattern combines custom resources and custom controllers. You can use custom controllers to encode domain knowledge for specific applications into an extension of the Kubernetes API.Should I add a custom resource to my Kubernetes cluster?When creating a new API, consider whether to aggregate your API with the Kubernetes cluster APIs or let your API stand alone.Consider API aggregation if:Prefer a stand-alone API if:Your API is Declarative.Your API does not fit the Declarative model.You want your new types to be readable and writable using kubectl.kubectl support is not requiredYou want to view your new types in a Kubernetes UI, such as dashboard, alongside built-in types.Kubernetes UI support is not required.You are developing a new API.You already have a program that serves your API and works well.You are willing to accept the format restriction that Kubernetes puts on REST resource paths, such as API Groups and Namespaces. (See the API Overview.)You need to have specific REST paths to be compatible with an already defined REST API.Your resources are naturally scoped to a cluster or namespaces of a cluster.Cluster


Question: How does Custom Resources work?

Answer: Custom ResourcesCustom resources are extensions of the Kubernetes API. This page discusses when to add a custom resource to your Kubernetes cluster and when to use a standalone service. It describes the two methods for adding custom resources and how to choose between them.Custom resourcesA resource is an endpoint in the Kubernetes API that stores a collection of API objects of a certain kind; for example, the built-in pods resource contains a collection of Pod objects.A custom resource is an extension of the Kubernetes API that is not necessarily available in a default Kubernetes installation. It represents a customization of a particular Kubernetes installation. However, many core Kubernetes functions are now built using custom resources, making Kubernetes more modular.Custom resources can appear and disappear in a running cluster through dynamic registration, and cluster admins can update custom resources independently of the cluster itself. Once a custom resource is installed, users can create and access its objects using kubectl, just as they do for built-in resources like Pods.Custom controllersOn their own, custom resources let you store and retrieve structured data. When you combine a custom resource with a custom controller, custom resources provide a true declarative API.The Kubernetes declarative API enforces a separation of responsibilities. You declare the desired state of your resource. The Kubernetes controller keeps the current state of Kubernetes objects in sync with your declared desired state. This is in contrast to an imperative API, where you instruct a server what to do.You can deploy and update a custom controller on a running cluster, independently of the cluster's lifecycle. Custom controllers can work with any kind of resource, but they are especially effective when combined with custom resources. The Operator pattern combines custom resources and custom controllers. You can use custom controllers to encode domain knowledge for specific applications into an extension of the Kubernetes API.Should I add a custom resource to my Kubernetes cluster?When creating a new API, consider whether to aggregate your API with the Kubernetes cluster APIs or let your API stand alone.Consider API aggregation if:Prefer a stand-alone API if:Your API is Declarative.Your API does not fit the Declarative model.You want your new types to be readable and writable using kubectl.kubectl support is not requiredYou want to view your new types in a Kubernetes UI, such as dashboard, alongside built-in types.Kubernetes UI support is not required.You are developing a new API.You already have a program that serves your API and works well.You are willing to accept the format restriction that Kubernetes puts on REST resource paths, such as API Groups and Namespaces. (See the API Overview.)You need to have specific REST paths to be compatible with an already defined REST API.Your resources are naturally scoped to a cluster or namespaces of a cluster.Cluster


Question: When would you use Custom Resources?

Answer: Custom ResourcesCustom resources are extensions of the Kubernetes API. This page discusses when to add a custom resource to your Kubernetes cluster and when to use a standalone service. It describes the two methods for adding custom resources and how to choose between them.Custom resourcesA resource is an endpoint in the Kubernetes API that stores a collection of API objects of a certain kind; for example, the built-in pods resource contains a collection of Pod objects.A custom resource is an extension of the Kubernetes API that is not necessarily available in a default Kubernetes installation. It represents a customization of a particular Kubernetes installation. However, many core Kubernetes functions are now built using custom resources, making Kubernetes more modular.Custom resources can appear and disappear in a running cluster through dynamic registration, and cluster admins can update custom resources independently of the cluster itself. Once a custom resource is installed, users can create and access its objects using kubectl, just as they do for built-in resources like Pods.Custom controllersOn their own, custom resources let you store and retrieve structured data. When you combine a custom resource with a custom controller, custom resources provide a true declarative API.The Kubernetes declarative API enforces a separation of responsibilities. You declare the desired state of your resource. The Kubernetes controller keeps the current state of Kubernetes objects in sync with your declared desired state. This is in contrast to an imperative API, where you instruct a server what to do.You can deploy and update a custom controller on a running cluster, independently of the cluster's lifecycle. Custom controllers can work with any kind of resource, but they are especially effective when combined with custom resources. The Operator pattern combines custom resources and custom controllers. You can use custom controllers to encode domain knowledge for specific applications into an extension of the Kubernetes API.Should I add a custom resource to my Kubernetes cluster?When creating a new API, consider whether to aggregate your API with the Kubernetes cluster APIs or let your API stand alone.Consider API aggregation if:Prefer a stand-alone API if:Your API is Declarative.Your API does not fit the Declarative model.You want your new types to be readable and writable using kubectl.kubectl support is not requiredYou want to view your new types in a Kubernetes UI, such as dashboard, alongside built-in types.Kubernetes UI support is not required.You are developing a new API.You already have a program that serves your API and works well.You are willing to accept the format restriction that Kubernetes puts on REST resource paths, such as API Groups and Namespaces. (See the API Overview.)You need to have specific REST paths to be compatible with an already defined REST API.Your resources are naturally scoped to a cluster or namespaces of a cluster.Cluster


Question: What are the benefits of Custom Resources?

Answer: Custom ResourcesCustom resources are extensions of the Kubernetes API. This page discusses when to add a custom resource to your Kubernetes cluster and when to use a standalone service. It describes the two methods for adding custom resources and how to choose between them.Custom resourcesA resource is an endpoint in the Kubernetes API that stores a collection of API objects of a certain kind; for example, the built-in pods resource contains a collection of Pod objects.A custom resource is an extension of the Kubernetes API that is not necessarily available in a default Kubernetes installation. It represents a customization of a particular Kubernetes installation. However, many core Kubernetes functions are now built using custom resources, making Kubernetes more modular.Custom resources can appear and disappear in a running cluster through dynamic registration, and cluster admins can update custom resources independently of the cluster itself. Once a custom resource is installed, users can create and access its objects using kubectl, just as they do for built-in resources like Pods.Custom controllersOn their own, custom resources let you store and retrieve structured data. When you combine a custom resource with a custom controller, custom resources provide a true declarative API.The Kubernetes declarative API enforces a separation of responsibilities. You declare the desired state of your resource. The Kubernetes controller keeps the current state of Kubernetes objects in sync with your declared desired state. This is in contrast to an imperative API, where you instruct a server what to do.You can deploy and update a custom controller on a running cluster, independently of the cluster's lifecycle. Custom controllers can work with any kind of resource, but they are especially effective when combined with custom resources. The Operator pattern combines custom resources and custom controllers. You can use custom controllers to encode domain knowledge for specific applications into an extension of the Kubernetes API.Should I add a custom resource to my Kubernetes cluster?When creating a new API, consider whether to aggregate your API with the Kubernetes cluster APIs or let your API stand alone.Consider API aggregation if:Prefer a stand-alone API if:Your API is Declarative.Your API does not fit the Declarative model.You want your new types to be readable and writable using kubectl.kubectl support is not requiredYou want to view your new types in a Kubernetes UI, such as dashboard, alongside built-in types.Kubernetes UI support is not required.You are developing a new API.You already have a program that serves your API and works well.You are willing to accept the format restriction that Kubernetes puts on REST resource paths, such as API Groups and Namespaces. (See the API Overview.)You need to have specific REST paths to be compatible with an already defined REST API.Your resources are naturally scoped to a cluster or namespaces of a cluster.Cluster


Question: What is Custom Resources?

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


Question: What is Custom resources?

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


Question: What is Custom controllers?

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


Question: What is Should I add a custom resource to my Kubernetes cluster??

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


Question: What is Declarative APIs?

Answer: I n   a   D e c l a r a t i v e   A P I ,   t y p i c a l l y :   Y o u r   A P I   c o n s i s t s   o f   a   r e l a t i v e l y   s m a l l   n u m b e r   o f   r e l a t i v e l y   s m a l l   o b j e c t s   ( r e s o u r c e s ) . T h e   o b j e c t s   d e f i n e   c o n f i g u r a t i o n   o f   a p p l i c a t i o n s   o r   i n f r a s t r u c t u r e . T h e   o b j e c t s   a r e   u p d a t e d   r e l a t i v e l y   i n f r e q u e n t l y . H u m a n s   o f t e n   n e e d   t o   r e a d   a n d   w r i t e   t h e   o b j e c t s . T h e   m a i n   o p e r a t i o n s   o n   t h e   o b j e c t s   a r e   C R U D - y   ( c r e a t i n g ,   r e a d i n g ,   u p d a t i n g   a n d   d e l e t i n g ) . T r a n s a c t i o n s   a c r o s s   o b j e c t s   a r e   n o t   r e q u i r e d :   t h e   A P I   r e p r e s e n t s   a   d e s i r e d   s t a t e ,   n o t   a n   e x a c t   s t a t e .   I m p e r a t i v e   A P I s   a r e   n o t   d e c l a r a t i v e .   S i g n s   t h a t   y o u r   A P I   m i g h t   n o t   b e   d e c l a r a t i v e   i n c l u d e :   T h e   c l i e n t   s a y s   " d o   t h i s " ,   a n d   t h e n   g e t s   a   s y n c h r o n o u s   r e s p o n s e   b a c k   w h e n   i t   i s   d o n e . T h e   c l i e n t   s a y s   " d o   t h i s " ,   a n d   t h e n   g e t s   a n   o p e r a t i o n   I D   b a c k ,   a n d   h a s   t o   c h e c k   a   s e p a r a t e   O p e r a t i o n   o b j e c t   t o   d e t e r m i n e   c o m p l e t i o n   o f   t h e   r e q u e s t . Y o u   t a l k   a b o u t   R e m o t e   P r o c e d u r e   C a l l s   ( R P C s ) . D i r e c t l y   s t o r i n g   l a r g e   a m o u n t s   o f   d a t a ;   f o r   e x a m p l e ,   >   a   f e w   k B   p e r   o b j e c t ,   o r   >   1 0 0 0 s   o f   o b j e c t s . H i g h   b a n d w i d t h   a c c e s s   ( 1 0 s   o f   r e q u e s t s   p e r   s e c o n d   s u s t a i n e d )


Question: What is Should I use a ConfigMap or a custom resource??

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


Question: What is Note:?

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


Question: What is Adding custom resources?

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


Question: What is Note:?

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


Question: What is CustomResourceDefinitions?

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


Question: What is API server aggregation?

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


Question: What is Choosing a method for adding custom resources?

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


Question: What is Comparing ease of use?

Answer: C R D s   a r e   e a s i e r   t o   c r e a t e   t h a n   A g g r e g a t e d   A P I s .


Question: What is Advanced features and flexibility?

Answer: A g g r e g a t e d   A P I s   o f f e r   m o r e   a d v a n c e d   A P I   f e a t u r e s   a n d   c u s t o m i z a t i o n   o f   o t h e r   f e a t u r e s ;   f o r   e x a m p l e ,   t h e   s t o r a g e   l a y e r .


Question: What is Common Features?

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


Question: What is Preparing to install a custom resource?

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


Question: What is Third party code and new points of failure?

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


Question: What is Storage?

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


Question: What is Authentication, authorization, and auditing?

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


Question: What is Accessing a custom resource?

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


Question: What is Custom resource field selectors?

Answer: F i e l d   S e l e c t o r s   l e t   c l i e n t s   s e l e c t   c u s t o m   r e s o u r c e s   b a s e d   o n   t h e   v a l u e   o f   o n e   o r   m o r e   r e s o u r c e   f i e l d s .   A l l   c u s t o m   r e s o u r c e s   s u p p o r t   t h e   m e t a d a t a . n a m e   a n d   m e t a d a t a . n a m e s p a c e   f i e l d   s e l e c t o r s .   F i e l d s   d e c l a r e d   i n   a   C u s t o m R e s o u r c e D e f i n i t i o n   m a y   a l s o   b e   u s e d   w i t h   f i e l d   s e l e c t o r s   w h e n   i n c l u d e d   i n   t h e   s p e c . v e r s i o n s [ * ] . s e l e c t a b l e F i e l d s   f i e l d   o f   t h e   C u s t o m R e s o u r c e D e f i n i t i o n .


Question: What is Selectable fields for custom resources?

Answer: T h e   s p e c . v e r s i o n s [ * ] . s e l e c t a b l e F i e l d s   f i e l d   o f   a   C u s t o m R e s o u r c e D e f i n i t i o n   m a y   b e   u s e d   t o   d e c l a r e   w h i c h   o t h e r   f i e l d s   i n   a   c u s t o m   r e s o u r c e   m a y   b e   u s e d   i n   f i e l d   s e l e c t o r s .   T h e   f o l l o w i n g   e x a m p l e   a d d s   t h e   . s p e c . c o l o r   a n d   . s p e c . s i z e   f i e l d s   a s   s e l e c t a b l e   f i e l d s .   a p i V e r s i o n :   a p i e x t e n s i o n s . k 8 s . i o / v 1   k i n d :   C u s t o m R e s o u r c e D e f i n i t i o n   m e t a d a t a :   n a m e :   s h i r t s . s t a b l e . e x a m p l e . c o m   s p e c :   g r o u p :   s t a b l e . e x a m p l e . c o m   s c o p e :   N a m e s p a c e d   n a m e s :   p l u r a l :   s h i r t s   s i n g u l a r :   s h i r t   k i n d :   S h i r t   v e r s i o n s :   -   n a m e :   v 1   s e r v e d :   t r u e   s t o r a g e :   t r u e   s c h e m a :   o p e n A P I V 3 S c h e m a :   t y p e :   o b j e c t   p r o p e r t i e s :   s p e c :   t y p e :   o b j e c t   p r o p e r t i e s :   c o l o r :   t y p e :   s t r i n g   s i z e :   t y p e :   s t r i n g   s e l e c t a b l e F i e l d s :   -   j s o n P a t h :   . s p e c . c o l o r   -   j s o n P a t h :   . s p e c . s i z e   a d d i t i o n a l P r i n t e r C o l u m n s :   -   j s o n P a t h :   . s p e c . c o l o r   n a m e :   C o l o r   t y p e :   s t r i n g   -   j s o n P a t h :   . s p e c . s i z e   n a m e :   S i z e   t y p e :   s t r i n g   F i e l d   s e l e c t o r s   c a n   t h e n   b e   u s e d   t o   g e t   o n l y   r e s o u r c e s   w i t h   a   c o l o r   o f   b l u e :   k u b e c t l   g e t   s h i r t s . s t a b l e . e x a m p l e . c o m   - - f i e l d - s e l e c t o r   s p e c . c o l o r = b l u e   T h e   o u t p u t   s h o u l d   b e :   N A M E   C O L O R


Question: What is What's next?

Answer: L e a r n   h o w   t o   E x t e n d   t h e   K u b e r n e t e s   A P I   w i t h   t h e   a g g r e g a t i o n   l a y e r . L e a r n   h o w   t o   E x t e n d   t h e   K u b e r n e t e s   A P I   w i t h   C u s t o m R e s o u r c e D e f i n i t i o n .


Question: What is Delete a StatefulSet?

Answer: Delete a StatefulSetThis task shows you how to delete a StatefulSet.Before you beginThis task assumes you have an application running on your cluster represented by a StatefulSet.Deleting a StatefulSetYou can delete a StatefulSet in the same way you delete other resources in Kubernetes: use the kubectl delete command, and specify the StatefulSet either by file or by name.kubectl delete -f <file.yaml> kubectl delete statefulsets <statefulset-name> You may need to delete the associated headless service separately after the StatefulSet itself is deleted.kubectl delete service <service-name> When deleting a StatefulSet through kubectl, the StatefulSet scales down to 0. All Pods that are part of this workload are also deleted. If you want to delete only the StatefulSet and not the Pods, use --cascade=orphan. For example:kubectl delete -f <file.yaml> --cascade=orphan By passing --cascade=orphan to kubectl delete, the Pods managed by the StatefulSet are left behind even after the StatefulSet object itself is deleted. If the pods have a label app.kubernetes.io/name=MyApp, you can then delete them as follows:kubectl delete pods -l app.kubernetes.io/name=MyApp Persistent VolumesDeleting the Pods in a StatefulSet will not delete the associated volumes. This is to ensure that you have the chance to copy data off the volume before deleting it. Deleting the PVC after the pods have terminated might trigger deletion of the backing Persistent Volumes depending on the storage class and reclaim policy. You should never assume ability to access a volume after claim deletion.Note:Use caution when deleting a PVC, as it may lead to data loss.Complete deletion of a StatefulSetTo delete everything in a StatefulSet, including the associated pods, you can run a series of commands similar to the following:grace=$(kubectl get pods <stateful-set-pod> --template '{{.spec.terminationGracePeriodSeconds}}') kubectl delete statefulset -l app.kubernetes.io/name=MyApp sleep $grace kubectl delete pvc -l app.kubernetes.io/name=MyApp In the example above, the Pods have the label app.kubernetes.io/name=MyApp; substitute your own label as appropriate.Force deletion of StatefulSet podsIf you find that some pods in your StatefulSet are stuck in the 'Terminating' or 'Unknown' states for an extended period of time, you may need to manually intervene to forcefully delete the pods from the apiserver. This is a potentially dangerous task. Refer to Force Delete StatefulSet Pods for details.What's nextLearn more about force deleting StatefulSet Pods.


Question: How does Delete a StatefulSet work?

Answer: Delete a StatefulSetThis task shows you how to delete a StatefulSet.Before you beginThis task assumes you have an application running on your cluster represented by a StatefulSet.Deleting a StatefulSetYou can delete a StatefulSet in the same way you delete other resources in Kubernetes: use the kubectl delete command, and specify the StatefulSet either by file or by name.kubectl delete -f <file.yaml> kubectl delete statefulsets <statefulset-name> You may need to delete the associated headless service separately after the StatefulSet itself is deleted.kubectl delete service <service-name> When deleting a StatefulSet through kubectl, the StatefulSet scales down to 0. All Pods that are part of this workload are also deleted. If you want to delete only the StatefulSet and not the Pods, use --cascade=orphan. For example:kubectl delete -f <file.yaml> --cascade=orphan By passing --cascade=orphan to kubectl delete, the Pods managed by the StatefulSet are left behind even after the StatefulSet object itself is deleted. If the pods have a label app.kubernetes.io/name=MyApp, you can then delete them as follows:kubectl delete pods -l app.kubernetes.io/name=MyApp Persistent VolumesDeleting the Pods in a StatefulSet will not delete the associated volumes. This is to ensure that you have the chance to copy data off the volume before deleting it. Deleting the PVC after the pods have terminated might trigger deletion of the backing Persistent Volumes depending on the storage class and reclaim policy. You should never assume ability to access a volume after claim deletion.Note:Use caution when deleting a PVC, as it may lead to data loss.Complete deletion of a StatefulSetTo delete everything in a StatefulSet, including the associated pods, you can run a series of commands similar to the following:grace=$(kubectl get pods <stateful-set-pod> --template '{{.spec.terminationGracePeriodSeconds}}') kubectl delete statefulset -l app.kubernetes.io/name=MyApp sleep $grace kubectl delete pvc -l app.kubernetes.io/name=MyApp In the example above, the Pods have the label app.kubernetes.io/name=MyApp; substitute your own label as appropriate.Force deletion of StatefulSet podsIf you find that some pods in your StatefulSet are stuck in the 'Terminating' or 'Unknown' states for an extended period of time, you may need to manually intervene to forcefully delete the pods from the apiserver. This is a potentially dangerous task. Refer to Force Delete StatefulSet Pods for details.What's nextLearn more about force deleting StatefulSet Pods.


Question: When would you use Delete a StatefulSet?

Answer: Delete a StatefulSetThis task shows you how to delete a StatefulSet.Before you beginThis task assumes you have an application running on your cluster represented by a StatefulSet.Deleting a StatefulSetYou can delete a StatefulSet in the same way you delete other resources in Kubernetes: use the kubectl delete command, and specify the StatefulSet either by file or by name.kubectl delete -f <file.yaml> kubectl delete statefulsets <statefulset-name> You may need to delete the associated headless service separately after the StatefulSet itself is deleted.kubectl delete service <service-name> When deleting a StatefulSet through kubectl, the StatefulSet scales down to 0. All Pods that are part of this workload are also deleted. If you want to delete only the StatefulSet and not the Pods, use --cascade=orphan. For example:kubectl delete -f <file.yaml> --cascade=orphan By passing --cascade=orphan to kubectl delete, the Pods managed by the StatefulSet are left behind even after the StatefulSet object itself is deleted. If the pods have a label app.kubernetes.io/name=MyApp, you can then delete them as follows:kubectl delete pods -l app.kubernetes.io/name=MyApp Persistent VolumesDeleting the Pods in a StatefulSet will not delete the associated volumes. This is to ensure that you have the chance to copy data off the volume before deleting it. Deleting the PVC after the pods have terminated might trigger deletion of the backing Persistent Volumes depending on the storage class and reclaim policy. You should never assume ability to access a volume after claim deletion.Note:Use caution when deleting a PVC, as it may lead to data loss.Complete deletion of a StatefulSetTo delete everything in a StatefulSet, including the associated pods, you can run a series of commands similar to the following:grace=$(kubectl get pods <stateful-set-pod> --template '{{.spec.terminationGracePeriodSeconds}}') kubectl delete statefulset -l app.kubernetes.io/name=MyApp sleep $grace kubectl delete pvc -l app.kubernetes.io/name=MyApp In the example above, the Pods have the label app.kubernetes.io/name=MyApp; substitute your own label as appropriate.Force deletion of StatefulSet podsIf you find that some pods in your StatefulSet are stuck in the 'Terminating' or 'Unknown' states for an extended period of time, you may need to manually intervene to forcefully delete the pods from the apiserver. This is a potentially dangerous task. Refer to Force Delete StatefulSet Pods for details.What's nextLearn more about force deleting StatefulSet Pods.


Question: What are the benefits of Delete a StatefulSet?

Answer: Delete a StatefulSetThis task shows you how to delete a StatefulSet.Before you beginThis task assumes you have an application running on your cluster represented by a StatefulSet.Deleting a StatefulSetYou can delete a StatefulSet in the same way you delete other resources in Kubernetes: use the kubectl delete command, and specify the StatefulSet either by file or by name.kubectl delete -f <file.yaml> kubectl delete statefulsets <statefulset-name> You may need to delete the associated headless service separately after the StatefulSet itself is deleted.kubectl delete service <service-name> When deleting a StatefulSet through kubectl, the StatefulSet scales down to 0. All Pods that are part of this workload are also deleted. If you want to delete only the StatefulSet and not the Pods, use --cascade=orphan. For example:kubectl delete -f <file.yaml> --cascade=orphan By passing --cascade=orphan to kubectl delete, the Pods managed by the StatefulSet are left behind even after the StatefulSet object itself is deleted. If the pods have a label app.kubernetes.io/name=MyApp, you can then delete them as follows:kubectl delete pods -l app.kubernetes.io/name=MyApp Persistent VolumesDeleting the Pods in a StatefulSet will not delete the associated volumes. This is to ensure that you have the chance to copy data off the volume before deleting it. Deleting the PVC after the pods have terminated might trigger deletion of the backing Persistent Volumes depending on the storage class and reclaim policy. You should never assume ability to access a volume after claim deletion.Note:Use caution when deleting a PVC, as it may lead to data loss.Complete deletion of a StatefulSetTo delete everything in a StatefulSet, including the associated pods, you can run a series of commands similar to the following:grace=$(kubectl get pods <stateful-set-pod> --template '{{.spec.terminationGracePeriodSeconds}}') kubectl delete statefulset -l app.kubernetes.io/name=MyApp sleep $grace kubectl delete pvc -l app.kubernetes.io/name=MyApp In the example above, the Pods have the label app.kubernetes.io/name=MyApp; substitute your own label as appropriate.Force deletion of StatefulSet podsIf you find that some pods in your StatefulSet are stuck in the 'Terminating' or 'Unknown' states for an extended period of time, you may need to manually intervene to forcefully delete the pods from the apiserver. This is a potentially dangerous task. Refer to Force Delete StatefulSet Pods for details.What's nextLearn more about force deleting StatefulSet Pods.


Question: What is Delete a StatefulSet?

Answer: T h i s   t a s k   s h o w s   y o u   h o w   t o   d e l e t e   a   S t a t e f u l S e t .


Question: What is Before you begin?

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


Question: What is Deleting a StatefulSet?

Answer: Y o u   c a n   d e l e t e   a   S t a t e f u l S e t   i n   t h e   s a m e   w a y   y o u   d e l e t e   o t h e r   r e s o u r c e s   i n   K u b e r n e t e s :   u s e   t h e   k u b e c t l   d e l e t e   c o m m a n d ,   a n d   s p e c i f y   t h e   S t a t e f u l S e t   e i t h e r   b y   f i l e   o r   b y   n a m e .   k u b e c t l   d e l e t e   - f   < f i l e . y a m l >   k u b e c t l   d e l e t e   s t a t e f u l s e t s   < s t a t e f u l s e t - n a m e >   Y o u   m a y   n e e d   t o   d e l e t e   t h e   a s s o c i a t e d   h e a d l e s s   s e r v i c e   s e p a r a t e l y   a f t e r   t h e   S t a t e f u l S e t   i t s e l f   i s   d e l e t e d .   k u b e c t l   d e l e t e   s e r v i c e   < s e r v i c e - n a m e >   W h e n   d e l e t i n g   a   S t a t e f u l S e t   t h r o u g h   k u b e c t l ,   t h e   S t a t e f u l S e t   s c a l e s   d o w n   t o   0 .   A l l   P o d s   t h a t   a r e   p a r t   o f   t h i s   w o r k l o a d   a r e   a l s o   d e l e t e d .   I f   y o u   w a n t   t o   d e l e t e   o n l y   t h e   S t a t e f u l S e t   a n d   n o t   t h e   P o d s ,   u s e   - - c a s c a d e = o r p h a n .   F o r   e x a m p l e :   k u b e c t l   d e l e t e   - f   < f i l e . y a m l >   - - c a s c a d e = o r p h a n   B y   p a s s i n g   - - c a s c a d e = o r p h a n   t o   k u b e c t l   d e l e t e ,   t h e   P o d s   m a n a g e d   b y   t h e   S t a t e f u l S e t   a r e   l e f t   b e h i n d   e v e n   a f t e r   t h e   S t a t e f u l S e t   o b j e c t   i t s e l f   i s   d e l e t e d .   I f   t h e   p o d s   h a v e   a   l a b e l   a p p . k u b e r n e t e s . i o / n a m e = M y A p p ,   y o u   c a n   t h e n   d e l e t e   t h e m   a s   f o l l o w s :   k u b e c t l   d e l e t e   p o d s   - l   a p p . k u b e r n e t e s . i o / n a m e = M y A p p


Question: What is Persistent Volumes?

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


Question: What is Complete deletion of a StatefulSet?

Answer: T o   d e l e t e   e v e r y t h i n g   i n   a   S t a t e f u l S e t ,   i n c l u d i n g   t h e   a s s o c i a t e d   p o d s ,   y o u   c a n   r u n   a   s e r i e s   o f   c o m m a n d s   s i m i l a r   t o   t h e   f o l l o w i n g :   g r a c e = $ ( k u b e c t l   g e t   p o d s   < s t a t e f u l - s e t - p o d >   - - t e m p l a t e   ' { { . s p e c . t e r m i n a t i o n G r a c e P e r i o d S e c o n d s } } ' )   k u b e c t l   d e l e t e   s t a t e f u l s e t   - l   a p p . k u b e r n e t e s . i o / n a m e = M y A p p   s l e e p   $ g r a c e   k u b e c t l   d e l e t e   p v c   - l   a p p . k u b e r n e t e s . i o / n a m e = M y A p p   I n   t h e   e x a m p l e   a b o v e ,   t h e   P o d s   h a v e   t h e   l a b e l   a p p . k u b e r n e t e s . i o / n a m e = M y A p p ;   s u b s t i t u t e   y o u r   o w n   l a b e l   a s   a p p r o p r i a t e .


Question: What is Force deletion of StatefulSet pods?

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


Question: What is What's next?

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


Question: What is Install Tools?

Answer: Install ToolsSet up Kubernetes tools on your computer.kubectlThe Kubernetes command-line tool, kubectl, allows you to run commands against Kubernetes clusters. You can use kubectl to deploy applications, inspect and manage cluster resources, and view logs. For more information including a complete list of kubectl operations, see the kubectl reference documentation.kubectl is installable on a variety of Linux platforms, macOS and Windows. Find your preferred operating system below.Install kubectl on LinuxInstall kubectl on macOSInstall kubectl on Windowskindkind lets you run Kubernetes on your local computer. This tool requires that you have either Docker or Podman installed.The kind Quick Start page shows you what you need to do to get up and running with kind.View kind Quick Start GuideminikubeLike kind, minikube is a tool that lets you run Kubernetes locally. minikube runs an all-in-one or a multi-node local Kubernetes cluster on your personal computer (including Windows, macOS and Linux PCs) so that you can try out Kubernetes, or for daily development work.You can follow the official Get Started! guide if your focus is on getting the tool installed.View minikube Get Started! GuideOnce you have minikube working, you can use it to run a sample application.kubeadmYou can use the kubeadm tool to create and manage Kubernetes clusters. It performs the actions necessary to get a minimum viable, secure cluster up and running in a user friendly way.Installing kubeadm shows you how to install kubeadm. Once installed, you can use it to create a cluster.View kubeadm Install Guide


Question: How does Install Tools work?

Answer: Install ToolsSet up Kubernetes tools on your computer.kubectlThe Kubernetes command-line tool, kubectl, allows you to run commands against Kubernetes clusters. You can use kubectl to deploy applications, inspect and manage cluster resources, and view logs. For more information including a complete list of kubectl operations, see the kubectl reference documentation.kubectl is installable on a variety of Linux platforms, macOS and Windows. Find your preferred operating system below.Install kubectl on LinuxInstall kubectl on macOSInstall kubectl on Windowskindkind lets you run Kubernetes on your local computer. This tool requires that you have either Docker or Podman installed.The kind Quick Start page shows you what you need to do to get up and running with kind.View kind Quick Start GuideminikubeLike kind, minikube is a tool that lets you run Kubernetes locally. minikube runs an all-in-one or a multi-node local Kubernetes cluster on your personal computer (including Windows, macOS and Linux PCs) so that you can try out Kubernetes, or for daily development work.You can follow the official Get Started! guide if your focus is on getting the tool installed.View minikube Get Started! GuideOnce you have minikube working, you can use it to run a sample application.kubeadmYou can use the kubeadm tool to create and manage Kubernetes clusters. It performs the actions necessary to get a minimum viable, secure cluster up and running in a user friendly way.Installing kubeadm shows you how to install kubeadm. Once installed, you can use it to create a cluster.View kubeadm Install Guide


Question: When would you use Install Tools?

Answer: Install ToolsSet up Kubernetes tools on your computer.kubectlThe Kubernetes command-line tool, kubectl, allows you to run commands against Kubernetes clusters. You can use kubectl to deploy applications, inspect and manage cluster resources, and view logs. For more information including a complete list of kubectl operations, see the kubectl reference documentation.kubectl is installable on a variety of Linux platforms, macOS and Windows. Find your preferred operating system below.Install kubectl on LinuxInstall kubectl on macOSInstall kubectl on Windowskindkind lets you run Kubernetes on your local computer. This tool requires that you have either Docker or Podman installed.The kind Quick Start page shows you what you need to do to get up and running with kind.View kind Quick Start GuideminikubeLike kind, minikube is a tool that lets you run Kubernetes locally. minikube runs an all-in-one or a multi-node local Kubernetes cluster on your personal computer (including Windows, macOS and Linux PCs) so that you can try out Kubernetes, or for daily development work.You can follow the official Get Started! guide if your focus is on getting the tool installed.View minikube Get Started! GuideOnce you have minikube working, you can use it to run a sample application.kubeadmYou can use the kubeadm tool to create and manage Kubernetes clusters. It performs the actions necessary to get a minimum viable, secure cluster up and running in a user friendly way.Installing kubeadm shows you how to install kubeadm. Once installed, you can use it to create a cluster.View kubeadm Install Guide


Question: What are the benefits of Install Tools?

Answer: Install ToolsSet up Kubernetes tools on your computer.kubectlThe Kubernetes command-line tool, kubectl, allows you to run commands against Kubernetes clusters. You can use kubectl to deploy applications, inspect and manage cluster resources, and view logs. For more information including a complete list of kubectl operations, see the kubectl reference documentation.kubectl is installable on a variety of Linux platforms, macOS and Windows. Find your preferred operating system below.Install kubectl on LinuxInstall kubectl on macOSInstall kubectl on Windowskindkind lets you run Kubernetes on your local computer. This tool requires that you have either Docker or Podman installed.The kind Quick Start page shows you what you need to do to get up and running with kind.View kind Quick Start GuideminikubeLike kind, minikube is a tool that lets you run Kubernetes locally. minikube runs an all-in-one or a multi-node local Kubernetes cluster on your personal computer (including Windows, macOS and Linux PCs) so that you can try out Kubernetes, or for daily development work.You can follow the official Get Started! guide if your focus is on getting the tool installed.View minikube Get Started! GuideOnce you have minikube working, you can use it to run a sample application.kubeadmYou can use the kubeadm tool to create and manage Kubernetes clusters. It performs the actions necessary to get a minimum viable, secure cluster up and running in a user friendly way.Installing kubeadm shows you how to install kubeadm. Once installed, you can use it to create a cluster.View kubeadm Install Guide


Question: What is kubectl?

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


Question: What is kind?

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


Question: What is minikube?

Answer: L i k e   k i n d ,   m i n i k u b e   i s   a   t o o l   t h a t   l e t s   y o u   r u n   K u b e r n e t e s   l o c a l l y .   m i n i k u b e   r u n s   a n   a l l - i n - o n e   o r   a   m u l t i - n o d e   l o c a l   K u b e r n e t e s   c l u s t e r   o n   y o u r   p e r s o n a l   c o m p u t e r   ( i n c l u d i n g   W i n d o w s ,   m a c O S   a n d   L i n u x   P C s )   s o   t h a t   y o u   c a n   t r y   o u t   K u b e r n e t e s ,   o r   f o r   d a i l y   d e v e l o p m e n t   w o r k .   Y o u   c a n   f o l l o w   t h e   o f f i c i a l   G e t   S t a r t e d !   g u i d e   i f   y o u r   f o c u s   i s   o n   g e t t i n g   t h e   t o o l   i n s t a l l e d .   V i e w   m i n i k u b e   G e t   S t a r t e d !   G u i d e   O n c e   y o u   h a v e   m i n i k u b e   w o r k i n g ,   y o u   c a n   u s e   i t   t o   r u n   a   s a m p l e   a p p l i c a t i o n .


Question: What is kubeadm?

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


Question: What is kubectl scale?

Answer: kubectl scaleSynopsisSet a new size for a deployment, replica set, replication controller, or stateful set.Scale also allows users to specify one or more preconditions for the scale action.If --current-replicas or --resource-version is specified, it is validated before the scale is attempted, and it is guaranteed that the precondition holds true when the scale is sent to the server.kubectl scale [--resource-version=version] [--current-replicas=count] --replicas=COUNT (-f FILENAME | TYPE NAME) Examples # Scale a replica set named 'foo' to 3 kubectl scale --replicas=3 rs/foo # Scale a resource identified by type and name specified in "foo.yaml" to 3 kubectl scale --replicas=3 -f foo.yaml # If the deployment named mysql's current size is 2, scale mysql to 3 kubectl scale --current-replicas=2 --replicas=3 deployment/mysql # Scale multiple replication controllers kubectl scale --replicas=5 rc/example1 rc/example2 rc/example3 # Scale stateful set named 'web' to 3 kubectl scale --replicas=3 statefulset/web Options--allSelect all resources in the namespace of the specified resource types--allow-missing-template-keys Default: trueIf true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.--current-replicas int Default: -1Precondition for current size. Requires that the current size of the resource match this value in order to scale. -1 (default) for no condition.--dry-run string[="unchanged"] Default: "none"Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.-f, --filename stringsFilename, directory, or URL to files identifying the resource to set a new size-h, --helphelp for scale-k, --kustomize stringProcess the kustomization directory. This flag can't be used together with -f or -R.-o, --output stringOutput format. One of: (json, yaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file).-R, --recursiveProcess the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.--replicas intThe new desired number of replicas. Required.--resource-version stringPrecondition for resource version. Requires that the current resource version match this value in order to scale.-l, --selector stringSelector (label query) to filter on, supports '=', '==', '!=', 'in', 'notin'.(e.g. -l key1=value1,key2=value2,key3 in (value3)). Matching objects must satisfy all of the specified label constraints.--show-managed-fieldsIf true, keep the managedFields when printing objects in JSON or YAML format.--template stringTemplate string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].--timeout durationThe length of t


Question: How does kubectl scale work?

Answer: kubectl scaleSynopsisSet a new size for a deployment, replica set, replication controller, or stateful set.Scale also allows users to specify one or more preconditions for the scale action.If --current-replicas or --resource-version is specified, it is validated before the scale is attempted, and it is guaranteed that the precondition holds true when the scale is sent to the server.kubectl scale [--resource-version=version] [--current-replicas=count] --replicas=COUNT (-f FILENAME | TYPE NAME) Examples # Scale a replica set named 'foo' to 3 kubectl scale --replicas=3 rs/foo # Scale a resource identified by type and name specified in "foo.yaml" to 3 kubectl scale --replicas=3 -f foo.yaml # If the deployment named mysql's current size is 2, scale mysql to 3 kubectl scale --current-replicas=2 --replicas=3 deployment/mysql # Scale multiple replication controllers kubectl scale --replicas=5 rc/example1 rc/example2 rc/example3 # Scale stateful set named 'web' to 3 kubectl scale --replicas=3 statefulset/web Options--allSelect all resources in the namespace of the specified resource types--allow-missing-template-keys Default: trueIf true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.--current-replicas int Default: -1Precondition for current size. Requires that the current size of the resource match this value in order to scale. -1 (default) for no condition.--dry-run string[="unchanged"] Default: "none"Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.-f, --filename stringsFilename, directory, or URL to files identifying the resource to set a new size-h, --helphelp for scale-k, --kustomize stringProcess the kustomization directory. This flag can't be used together with -f or -R.-o, --output stringOutput format. One of: (json, yaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file).-R, --recursiveProcess the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.--replicas intThe new desired number of replicas. Required.--resource-version stringPrecondition for resource version. Requires that the current resource version match this value in order to scale.-l, --selector stringSelector (label query) to filter on, supports '=', '==', '!=', 'in', 'notin'.(e.g. -l key1=value1,key2=value2,key3 in (value3)). Matching objects must satisfy all of the specified label constraints.--show-managed-fieldsIf true, keep the managedFields when printing objects in JSON or YAML format.--template stringTemplate string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].--timeout durationThe length of t


Question: When would you use kubectl scale?

Answer: kubectl scaleSynopsisSet a new size for a deployment, replica set, replication controller, or stateful set.Scale also allows users to specify one or more preconditions for the scale action.If --current-replicas or --resource-version is specified, it is validated before the scale is attempted, and it is guaranteed that the precondition holds true when the scale is sent to the server.kubectl scale [--resource-version=version] [--current-replicas=count] --replicas=COUNT (-f FILENAME | TYPE NAME) Examples # Scale a replica set named 'foo' to 3 kubectl scale --replicas=3 rs/foo # Scale a resource identified by type and name specified in "foo.yaml" to 3 kubectl scale --replicas=3 -f foo.yaml # If the deployment named mysql's current size is 2, scale mysql to 3 kubectl scale --current-replicas=2 --replicas=3 deployment/mysql # Scale multiple replication controllers kubectl scale --replicas=5 rc/example1 rc/example2 rc/example3 # Scale stateful set named 'web' to 3 kubectl scale --replicas=3 statefulset/web Options--allSelect all resources in the namespace of the specified resource types--allow-missing-template-keys Default: trueIf true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.--current-replicas int Default: -1Precondition for current size. Requires that the current size of the resource match this value in order to scale. -1 (default) for no condition.--dry-run string[="unchanged"] Default: "none"Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.-f, --filename stringsFilename, directory, or URL to files identifying the resource to set a new size-h, --helphelp for scale-k, --kustomize stringProcess the kustomization directory. This flag can't be used together with -f or -R.-o, --output stringOutput format. One of: (json, yaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file).-R, --recursiveProcess the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.--replicas intThe new desired number of replicas. Required.--resource-version stringPrecondition for resource version. Requires that the current resource version match this value in order to scale.-l, --selector stringSelector (label query) to filter on, supports '=', '==', '!=', 'in', 'notin'.(e.g. -l key1=value1,key2=value2,key3 in (value3)). Matching objects must satisfy all of the specified label constraints.--show-managed-fieldsIf true, keep the managedFields when printing objects in JSON or YAML format.--template stringTemplate string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].--timeout durationThe length of t


Question: What are the benefits of kubectl scale?

Answer: kubectl scaleSynopsisSet a new size for a deployment, replica set, replication controller, or stateful set.Scale also allows users to specify one or more preconditions for the scale action.If --current-replicas or --resource-version is specified, it is validated before the scale is attempted, and it is guaranteed that the precondition holds true when the scale is sent to the server.kubectl scale [--resource-version=version] [--current-replicas=count] --replicas=COUNT (-f FILENAME | TYPE NAME) Examples # Scale a replica set named 'foo' to 3 kubectl scale --replicas=3 rs/foo # Scale a resource identified by type and name specified in "foo.yaml" to 3 kubectl scale --replicas=3 -f foo.yaml # If the deployment named mysql's current size is 2, scale mysql to 3 kubectl scale --current-replicas=2 --replicas=3 deployment/mysql # Scale multiple replication controllers kubectl scale --replicas=5 rc/example1 rc/example2 rc/example3 # Scale stateful set named 'web' to 3 kubectl scale --replicas=3 statefulset/web Options--allSelect all resources in the namespace of the specified resource types--allow-missing-template-keys Default: trueIf true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.--current-replicas int Default: -1Precondition for current size. Requires that the current size of the resource match this value in order to scale. -1 (default) for no condition.--dry-run string[="unchanged"] Default: "none"Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.-f, --filename stringsFilename, directory, or URL to files identifying the resource to set a new size-h, --helphelp for scale-k, --kustomize stringProcess the kustomization directory. This flag can't be used together with -f or -R.-o, --output stringOutput format. One of: (json, yaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file).-R, --recursiveProcess the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.--replicas intThe new desired number of replicas. Required.--resource-version stringPrecondition for resource version. Requires that the current resource version match this value in order to scale.-l, --selector stringSelector (label query) to filter on, supports '=', '==', '!=', 'in', 'notin'.(e.g. -l key1=value1,key2=value2,key3 in (value3)). Matching objects must satisfy all of the specified label constraints.--show-managed-fieldsIf true, keep the managedFields when printing objects in JSON or YAML format.--template stringTemplate string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].--timeout durationThe length of t


Question: What is Synopsis?

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


Question: What is Examples?

Answer: #   S c a l e   a   r e p l i c a   s e t   n a m e d   ' f o o '   t o   3   k u b e c t l   s c a l e   - - r e p l i c a s = 3   r s / f o o   #   S c a l e   a   r e s o u r c e   i d e n t i f i e d   b y   t y p e   a n d   n a m e   s p e c i f i e d   i n   " f o o . y a m l "   t o   3   k u b e c t l   s c a l e   - - r e p l i c a s = 3   - f   f o o . y a m l   #   I f   t h e   d e p l o y m e n t   n a m e d   m y s q l ' s   c u r r e n t   s i z e   i s   2 ,   s c a l e   m y s q l   t o   3   k u b e c t l   s c a l e   - - c u r r e n t - r e p l i c a s = 2   - - r e p l i c a s = 3   d e p l o y m e n t / m y s q l   #   S c a l e   m u l t i p l e   r e p l i c a t i o n   c o n t r o l l e r s   k u b e c t l   s c a l e   - - r e p l i c a s = 5   r c / e x a m p l e 1   r c / e x a m p l e 2   r c / e x a m p l e 3   #   S c a l e   s t a t e f u l   s e t   n a m e d   ' w e b '   t o   3   k u b e c t l   s c a l e   - - r e p l i c a s = 3   s t a t e f u l s e t / w e b


Question: What is Options?

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


Question: What is Parent Options Inherited?

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


Question: What is See Also?

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


Question: What is Upgrading Linux nodes?

Answer: Upgrading Linux nodesThis page explains how to upgrade a Linux Worker Nodes created with kubeadm.Before you beginYou need to have shell access to all the nodes, 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.To check the version, enter kubectl version.Familiarize yourself with the process for upgrading the rest of your kubeadm cluster. You will want to upgrade the control plane nodes before upgrading your Linux Worker nodes.Changing the package repositoryIf you're using the community-owned package repositories (pkgs.k8s.io), you need to enable the package repository for the desired Kubernetes minor release. This is explained in Changing the Kubernetes package repository document.Note: The legacy package repositories (apt.kubernetes.io and yum.kubernetes.io) have been deprecated and frozen starting from September 13, 2023. Using the new package repositories hosted at pkgs.k8s.io is strongly recommended and required in order to install Kubernetes versions released after September 13, 2023. The deprecated legacy repositories, and their contents, might be removed at any time in the future and without a further notice period. The new package repositories provide downloads for Kubernetes versions starting with v1.24.0.Upgrading worker nodesUpgrade kubeadmUpgrade kubeadm:# replace x in 1.34.x-* with the latest patch version sudo apt-mark unhold kubeadm && \ sudo apt-get update && sudo apt-get install -y kubeadm='1.34.x-*' && \ sudo apt-mark hold kubeadm For systems with DNF:# replace x in 1.34.x-* with the latest patch version sudo yum install -y kubeadm-'1.34.x-*' --disableexcludes=kubernetes For systems with DNF5:# replace x in 1.34.x-* with the latest patch version sudo yum install -y kubeadm-'1.34.x-*' --setopt=disable_excludes=kubernetes Call "kubeadm upgrade"For worker nodes this upgrades the local kubelet configuration:sudo kubeadm upgrade node Drain the nodePrepare the node for maintenance by marking it unschedulable and evicting the workloads:# execute this command on a control plane node # replace <node-to-drain> with the name of your node you are draining kubectl drain <node-to-drain> --ignore-daemonsets Upgrade kubelet and kubectlUpgrade the kubelet and kubectl:# replace x in 1.34.x-* with the latest patch version sudo apt-mark unhold kubelet kubectl && \ sudo apt-get update && sudo apt-get install -y kubelet='1.34.x-*' kubectl='1.34.x-*' && \ sudo apt-mark hold kubelet kubectl For systems with DNF:# replace x in 1.34.x-* with the latest patch version sudo yum install -y kubelet-'1.34.x-*' kubectl-'1.34.x-*' --disableexcludes=kubernetes For systems with DNF5:# replace x in 1.34.x-* with the latest patch version sudo yum install -y kubelet-'1.34.x-*' kubectl-'1.34.x-*' --setopt=disable_excludes=kubernetes Restart the kubelet:sudo systemctl daemon-reload sudo systemctl restart kubelet Un


Question: How does Upgrading Linux nodes work?

Answer: Upgrading Linux nodesThis page explains how to upgrade a Linux Worker Nodes created with kubeadm.Before you beginYou need to have shell access to all the nodes, 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.To check the version, enter kubectl version.Familiarize yourself with the process for upgrading the rest of your kubeadm cluster. You will want to upgrade the control plane nodes before upgrading your Linux Worker nodes.Changing the package repositoryIf you're using the community-owned package repositories (pkgs.k8s.io), you need to enable the package repository for the desired Kubernetes minor release. This is explained in Changing the Kubernetes package repository document.Note: The legacy package repositories (apt.kubernetes.io and yum.kubernetes.io) have been deprecated and frozen starting from September 13, 2023. Using the new package repositories hosted at pkgs.k8s.io is strongly recommended and required in order to install Kubernetes versions released after September 13, 2023. The deprecated legacy repositories, and their contents, might be removed at any time in the future and without a further notice period. The new package repositories provide downloads for Kubernetes versions starting with v1.24.0.Upgrading worker nodesUpgrade kubeadmUpgrade kubeadm:# replace x in 1.34.x-* with the latest patch version sudo apt-mark unhold kubeadm && \ sudo apt-get update && sudo apt-get install -y kubeadm='1.34.x-*' && \ sudo apt-mark hold kubeadm For systems with DNF:# replace x in 1.34.x-* with the latest patch version sudo yum install -y kubeadm-'1.34.x-*' --disableexcludes=kubernetes For systems with DNF5:# replace x in 1.34.x-* with the latest patch version sudo yum install -y kubeadm-'1.34.x-*' --setopt=disable_excludes=kubernetes Call "kubeadm upgrade"For worker nodes this upgrades the local kubelet configuration:sudo kubeadm upgrade node Drain the nodePrepare the node for maintenance by marking it unschedulable and evicting the workloads:# execute this command on a control plane node # replace <node-to-drain> with the name of your node you are draining kubectl drain <node-to-drain> --ignore-daemonsets Upgrade kubelet and kubectlUpgrade the kubelet and kubectl:# replace x in 1.34.x-* with the latest patch version sudo apt-mark unhold kubelet kubectl && \ sudo apt-get update && sudo apt-get install -y kubelet='1.34.x-*' kubectl='1.34.x-*' && \ sudo apt-mark hold kubelet kubectl For systems with DNF:# replace x in 1.34.x-* with the latest patch version sudo yum install -y kubelet-'1.34.x-*' kubectl-'1.34.x-*' --disableexcludes=kubernetes For systems with DNF5:# replace x in 1.34.x-* with the latest patch version sudo yum install -y kubelet-'1.34.x-*' kubectl-'1.34.x-*' --setopt=disable_excludes=kubernetes Restart the kubelet:sudo systemctl daemon-reload sudo systemctl restart kubelet Un