Question: How does Get a Shell to a Running Container work?

Answer: Get a Shell to a Running ContainerThis page shows how to use kubectl exec to get a shell to a running container.Before you beginYou need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster. It is recommended to run this tutorial on a cluster with at least two nodes that are not acting as control plane hosts. If you do not already have a cluster, you can create one by using minikube or you can use one of these Kubernetes playgrounds:iximiuz LabsKillercodaKodeKloudPlay with KubernetesGetting a shell to a containerIn this exercise, you create a Pod that has one container. The container runs the nginx image. Here is the configuration file for the Pod:application/shell-demo.yaml apiVersion: v1 kind: Pod metadata: name: shell-demo spec: volumes: - name: shared-data emptyDir: {} containers: - name: nginx image: nginx volumeMounts: - name: shared-data mountPath: /usr/share/nginx/html hostNetwork: true dnsPolicy: Default Create the Pod:kubectl apply -f https://k8s.io/examples/application/shell-demo.yaml Verify that the container is running:kubectl get pod shell-demo Get a shell to the running container:kubectl exec --stdin --tty shell-demo -- /bin/bash Note:The double dash (--) separates the arguments you want to pass to the command from the kubectl arguments.In your shell, list the root directory:# Run this inside the container ls / In your shell, experiment with other commands. Here are some examples:# You can run these example commands inside the container ls / cat /proc/mounts cat /proc/1/maps apt-get update apt-get install -y tcpdump tcpdump apt-get install -y lsof lsof apt-get install -y procps ps aux ps aux | grep nginx Writing the root page for nginxLook again at the configuration file for your Pod. The Pod has an emptyDir volume, and the container mounts the volume at /usr/share/nginx/html.In your shell, create an index.html file in the /usr/share/nginx/html directory:# Run this inside the container echo 'Hello shell demo' > /usr/share/nginx/html/index.html In your shell, send a GET request to the nginx server:# Run this in the shell inside your container apt-get update apt-get install curl curl http://localhost/ The output shows the text that you wrote to the index.html file:Hello shell demo When you are finished with your shell, enter exit.exit # To quit the shell in the container Running individual commands in a containerIn an ordinary command window, not your shell, list the environment variables in the running container:kubectl exec shell-demo -- env Experiment with running other commands. Here are some examples:kubectl exec shell-demo -- ps aux kubectl exec shell-demo -- ls / kubectl exec shell-demo -- cat /proc/1/mounts Opening a shell when a Pod has more than one containerIf a Pod has more than one container, use --container or -c to specify a container in the kubectl exec command. For example, suppose you have a Pod named my-pod, and the Pod has two containers named main-app


Question: When would you use Get a Shell to a Running Container?

Answer: Get a Shell to a Running ContainerThis page shows how to use kubectl exec to get a shell to a running container.Before you beginYou need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster. It is recommended to run this tutorial on a cluster with at least two nodes that are not acting as control plane hosts. If you do not already have a cluster, you can create one by using minikube or you can use one of these Kubernetes playgrounds:iximiuz LabsKillercodaKodeKloudPlay with KubernetesGetting a shell to a containerIn this exercise, you create a Pod that has one container. The container runs the nginx image. Here is the configuration file for the Pod:application/shell-demo.yaml apiVersion: v1 kind: Pod metadata: name: shell-demo spec: volumes: - name: shared-data emptyDir: {} containers: - name: nginx image: nginx volumeMounts: - name: shared-data mountPath: /usr/share/nginx/html hostNetwork: true dnsPolicy: Default Create the Pod:kubectl apply -f https://k8s.io/examples/application/shell-demo.yaml Verify that the container is running:kubectl get pod shell-demo Get a shell to the running container:kubectl exec --stdin --tty shell-demo -- /bin/bash Note:The double dash (--) separates the arguments you want to pass to the command from the kubectl arguments.In your shell, list the root directory:# Run this inside the container ls / In your shell, experiment with other commands. Here are some examples:# You can run these example commands inside the container ls / cat /proc/mounts cat /proc/1/maps apt-get update apt-get install -y tcpdump tcpdump apt-get install -y lsof lsof apt-get install -y procps ps aux ps aux | grep nginx Writing the root page for nginxLook again at the configuration file for your Pod. The Pod has an emptyDir volume, and the container mounts the volume at /usr/share/nginx/html.In your shell, create an index.html file in the /usr/share/nginx/html directory:# Run this inside the container echo 'Hello shell demo' > /usr/share/nginx/html/index.html In your shell, send a GET request to the nginx server:# Run this in the shell inside your container apt-get update apt-get install curl curl http://localhost/ The output shows the text that you wrote to the index.html file:Hello shell demo When you are finished with your shell, enter exit.exit # To quit the shell in the container Running individual commands in a containerIn an ordinary command window, not your shell, list the environment variables in the running container:kubectl exec shell-demo -- env Experiment with running other commands. Here are some examples:kubectl exec shell-demo -- ps aux kubectl exec shell-demo -- ls / kubectl exec shell-demo -- cat /proc/1/mounts Opening a shell when a Pod has more than one containerIf a Pod has more than one container, use --container or -c to specify a container in the kubectl exec command. For example, suppose you have a Pod named my-pod, and the Pod has two containers named main-app


Question: What are the benefits of Get a Shell to a Running Container?

Answer: Get a Shell to a Running ContainerThis page shows how to use kubectl exec to get a shell to a running container.Before you beginYou need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster. It is recommended to run this tutorial on a cluster with at least two nodes that are not acting as control plane hosts. If you do not already have a cluster, you can create one by using minikube or you can use one of these Kubernetes playgrounds:iximiuz LabsKillercodaKodeKloudPlay with KubernetesGetting a shell to a containerIn this exercise, you create a Pod that has one container. The container runs the nginx image. Here is the configuration file for the Pod:application/shell-demo.yaml apiVersion: v1 kind: Pod metadata: name: shell-demo spec: volumes: - name: shared-data emptyDir: {} containers: - name: nginx image: nginx volumeMounts: - name: shared-data mountPath: /usr/share/nginx/html hostNetwork: true dnsPolicy: Default Create the Pod:kubectl apply -f https://k8s.io/examples/application/shell-demo.yaml Verify that the container is running:kubectl get pod shell-demo Get a shell to the running container:kubectl exec --stdin --tty shell-demo -- /bin/bash Note:The double dash (--) separates the arguments you want to pass to the command from the kubectl arguments.In your shell, list the root directory:# Run this inside the container ls / In your shell, experiment with other commands. Here are some examples:# You can run these example commands inside the container ls / cat /proc/mounts cat /proc/1/maps apt-get update apt-get install -y tcpdump tcpdump apt-get install -y lsof lsof apt-get install -y procps ps aux ps aux | grep nginx Writing the root page for nginxLook again at the configuration file for your Pod. The Pod has an emptyDir volume, and the container mounts the volume at /usr/share/nginx/html.In your shell, create an index.html file in the /usr/share/nginx/html directory:# Run this inside the container echo 'Hello shell demo' > /usr/share/nginx/html/index.html In your shell, send a GET request to the nginx server:# Run this in the shell inside your container apt-get update apt-get install curl curl http://localhost/ The output shows the text that you wrote to the index.html file:Hello shell demo When you are finished with your shell, enter exit.exit # To quit the shell in the container Running individual commands in a containerIn an ordinary command window, not your shell, list the environment variables in the running container:kubectl exec shell-demo -- env Experiment with running other commands. Here are some examples:kubectl exec shell-demo -- ps aux kubectl exec shell-demo -- ls / kubectl exec shell-demo -- cat /proc/1/mounts Opening a shell when a Pod has more than one containerIf a Pod has more than one container, use --container or -c to specify a container in the kubectl exec command. For example, suppose you have a Pod named my-pod, and the Pod has two containers named main-app


Question: What is Get a Shell to a Running Container?

Answer: T h i s   p a g e   s h o w s   h o w   t o   u s e   k u b e c t l   e x e c   t o   g e t   a   s h e l l   t o   a   r u n n i n g   c o n t a i n e r .


Question: What is Before you begin?

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


Question: What is Getting a shell to a container?

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


Question: What is Note:?

Answer: I n   y o u r   s h e l l ,   l i s t   t h e   r o o t   d i r e c t o r y :   #   R u n   t h i s   i n s i d e   t h e   c o n t a i n e r   l s   /   I n   y o u r   s h e l l ,   e x p e r i m e n t   w i t h   o t h e r   c o m m a n d s .   H e r e   a r e   s o m e   e x a m p l e s :   #   Y o u   c a n   r u n   t h e s e   e x a m p l e   c o m m a n d s   i n s i d e   t h e   c o n t a i n e r   l s   /   c a t   / p r o c / m o u n t s   c a t   / p r o c / 1 / m a p s   a p t - g e t   u p d a t e   a p t - g e t   i n s t a l l   - y   t c p d u m p   t c p d u m p   a p t - g e t   i n s t a l l   - y   l s o f   l s o f   a p t - g e t   i n s t a l l   - y   p r o c p s   p s   a u x   p s   a u x   |   g r e p   n g i n x


Question: What is Writing the root page for nginx?

Answer: L o o k   a g a i n   a t   t h e   c o n f i g u r a t i o n   f i l e   f o r   y o u r   P o d .   T h e   P o d   h a s   a n   e m p t y D i r   v o l u m e ,   a n d   t h e   c o n t a i n e r   m o u n t s   t h e   v o l u m e   a t   / u s r / s h a r e / n g i n x / h t m l .   I n   y o u r   s h e l l ,   c r e a t e   a n   i n d e x . h t m l   f i l e   i n   t h e   / u s r / s h a r e / n g i n x / h t m l   d i r e c t o r y :   #   R u n   t h i s   i n s i d e   t h e   c o n t a i n e r   e c h o   ' H e l l o   s h e l l   d e m o '   >   / u s r / s h a r e / n g i n x / h t m l / i n d e x . h t m l   I n   y o u r   s h e l l ,   s e n d   a   G E T   r e q u e s t   t o   t h e   n g i n x   s e r v e r :   #   R u n   t h i s   i n   t h e   s h e l l   i n s i d e   y o u r   c o n t a i n e r   a p t - g e t   u p d a t e   a p t - g e t   i n s t a l l   c u r l   c u r l   h t t p : / / l o c a l h o s t /   T h e   o u t p u t   s h o w s   t h e   t e x t   t h a t   y o u   w r o t e   t o   t h e   i n d e x . h t m l   f i l e :   H e l l o   s h e l l   d e m o   W h e n   y o u   a r e   f i n i s h e d   w i t h   y o u r   s h e l l ,   e n t e r   e x i t .   e x i t   #   T o   q u i t   t h e   s h e l l   i n   t h e   c o n t a i n e r


Question: What is Running individual commands in a container?

Answer: I n   a n   o r d i n a r y   c o m m a n d   w i n d o w ,   n o t   y o u r   s h e l l ,   l i s t   t h e   e n v i r o n m e n t   v a r i a b l e s   i n   t h e   r u n n i n g   c o n t a i n e r :   k u b e c t l   e x e c   s h e l l - d e m o   - -   e n v   E x p e r i m e n t   w i t h   r u n n i n g   o t h e r   c o m m a n d s .   H e r e   a r e   s o m e   e x a m p l e s :   k u b e c t l   e x e c   s h e l l - d e m o   - -   p s   a u x   k u b e c t l   e x e c   s h e l l - d e m o   - -   l s   /   k u b e c t l   e x e c   s h e l l - d e m o   - -   c a t   / p r o c / 1 / m o u n t s


Question: What is Opening a shell when a Pod has more than one container?

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


Question: What is What's next?

Answer: R e a d   a b o u t   k u b e c t l   e x e c


Question: What is ListMeta?

Answer: ListMetaListMeta describes metadata that synthetic resources must have, including lists and various status objects.import "k8s.io/apimachinery/pkg/apis/meta/v1"ListMeta describes metadata that synthetic resources must have, including lists and various status objects. A resource may have only one of {ObjectMeta, ListMeta}.continue (string)continue may be set if the user set a limit on the number of items returned, and indicates that the server has more data available. The value is opaque and may be used to issue another request to the endpoint that served this list to retrieve the next set of available objects. Continuing a consistent list may not be possible if the server configuration has changed or more than a few minutes have passed. The resourceVersion field returned when using this continue value will be identical to the value in the first response, unless you have received this token from an error message.remainingItemCount (int64)remainingItemCount is the number of subsequent items in the list which are not included in this list response. If the list request contained label or field selectors, then the number of remaining items is unknown and the field will be left unset and omitted during serialization. If the list is complete (either because it is not chunking or because this is the last chunk), then there are no more remaining items and this field will be left unset and omitted during serialization. Servers older than v1.15 do not set this field. The intended use of the remainingItemCount is estimating the size of a collection. Clients should not rely on the remainingItemCount to be set or to be exact.resourceVersion (string)String that identifies the server's internal version of this object that can be used by clients to determine when objects have changed. Value must be treated as opaque by clients and passed unmodified back to the server. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistencyselfLink (string)Deprecated: selfLink is a legacy read-only field that is no longer populated by the system.This page is automatically generated.If you plan to report an issue with this page, mention that the page is auto-generated in your issue description. The fix may need to happen elsewhere in the Kubernetes project.


Question: How does ListMeta work?

Answer: ListMetaListMeta describes metadata that synthetic resources must have, including lists and various status objects.import "k8s.io/apimachinery/pkg/apis/meta/v1"ListMeta describes metadata that synthetic resources must have, including lists and various status objects. A resource may have only one of {ObjectMeta, ListMeta}.continue (string)continue may be set if the user set a limit on the number of items returned, and indicates that the server has more data available. The value is opaque and may be used to issue another request to the endpoint that served this list to retrieve the next set of available objects. Continuing a consistent list may not be possible if the server configuration has changed or more than a few minutes have passed. The resourceVersion field returned when using this continue value will be identical to the value in the first response, unless you have received this token from an error message.remainingItemCount (int64)remainingItemCount is the number of subsequent items in the list which are not included in this list response. If the list request contained label or field selectors, then the number of remaining items is unknown and the field will be left unset and omitted during serialization. If the list is complete (either because it is not chunking or because this is the last chunk), then there are no more remaining items and this field will be left unset and omitted during serialization. Servers older than v1.15 do not set this field. The intended use of the remainingItemCount is estimating the size of a collection. Clients should not rely on the remainingItemCount to be set or to be exact.resourceVersion (string)String that identifies the server's internal version of this object that can be used by clients to determine when objects have changed. Value must be treated as opaque by clients and passed unmodified back to the server. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistencyselfLink (string)Deprecated: selfLink is a legacy read-only field that is no longer populated by the system.This page is automatically generated.If you plan to report an issue with this page, mention that the page is auto-generated in your issue description. The fix may need to happen elsewhere in the Kubernetes project.


Question: When would you use ListMeta?

Answer: ListMetaListMeta describes metadata that synthetic resources must have, including lists and various status objects.import "k8s.io/apimachinery/pkg/apis/meta/v1"ListMeta describes metadata that synthetic resources must have, including lists and various status objects. A resource may have only one of {ObjectMeta, ListMeta}.continue (string)continue may be set if the user set a limit on the number of items returned, and indicates that the server has more data available. The value is opaque and may be used to issue another request to the endpoint that served this list to retrieve the next set of available objects. Continuing a consistent list may not be possible if the server configuration has changed or more than a few minutes have passed. The resourceVersion field returned when using this continue value will be identical to the value in the first response, unless you have received this token from an error message.remainingItemCount (int64)remainingItemCount is the number of subsequent items in the list which are not included in this list response. If the list request contained label or field selectors, then the number of remaining items is unknown and the field will be left unset and omitted during serialization. If the list is complete (either because it is not chunking or because this is the last chunk), then there are no more remaining items and this field will be left unset and omitted during serialization. Servers older than v1.15 do not set this field. The intended use of the remainingItemCount is estimating the size of a collection. Clients should not rely on the remainingItemCount to be set or to be exact.resourceVersion (string)String that identifies the server's internal version of this object that can be used by clients to determine when objects have changed. Value must be treated as opaque by clients and passed unmodified back to the server. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistencyselfLink (string)Deprecated: selfLink is a legacy read-only field that is no longer populated by the system.This page is automatically generated.If you plan to report an issue with this page, mention that the page is auto-generated in your issue description. The fix may need to happen elsewhere in the Kubernetes project.


Question: What are the benefits of ListMeta?

Answer: ListMetaListMeta describes metadata that synthetic resources must have, including lists and various status objects.import "k8s.io/apimachinery/pkg/apis/meta/v1"ListMeta describes metadata that synthetic resources must have, including lists and various status objects. A resource may have only one of {ObjectMeta, ListMeta}.continue (string)continue may be set if the user set a limit on the number of items returned, and indicates that the server has more data available. The value is opaque and may be used to issue another request to the endpoint that served this list to retrieve the next set of available objects. Continuing a consistent list may not be possible if the server configuration has changed or more than a few minutes have passed. The resourceVersion field returned when using this continue value will be identical to the value in the first response, unless you have received this token from an error message.remainingItemCount (int64)remainingItemCount is the number of subsequent items in the list which are not included in this list response. If the list request contained label or field selectors, then the number of remaining items is unknown and the field will be left unset and omitted during serialization. If the list is complete (either because it is not chunking or because this is the last chunk), then there are no more remaining items and this field will be left unset and omitted during serialization. Servers older than v1.15 do not set this field. The intended use of the remainingItemCount is estimating the size of a collection. Clients should not rely on the remainingItemCount to be set or to be exact.resourceVersion (string)String that identifies the server's internal version of this object that can be used by clients to determine when objects have changed. Value must be treated as opaque by clients and passed unmodified back to the server. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistencyselfLink (string)Deprecated: selfLink is a legacy read-only field that is no longer populated by the system.This page is automatically generated.If you plan to report an issue with this page, mention that the page is auto-generated in your issue description. The fix may need to happen elsewhere in the Kubernetes project.


Question: What is ListMeta?

Answer: i m p o r t   " k 8 s . i o / a p i m a c h i n e r y / p k g / a p i s / m e t a / v 1 "   L i s t M e t a   d e s c r i b e s   m e t a d a t a   t h a t   s y n t h e t i c   r e s o u r c e s   m u s t   h a v e ,   i n c l u d i n g   l i s t s   a n d   v a r i o u s   s t a t u s   o b j e c t s .   A   r e s o u r c e   m a y   h a v e   o n l y   o n e   o f   { O b j e c t M e t a ,   L i s t M e t a } .   c o n t i n u e   ( s t r i n g ) c o n t i n u e   m a y   b e   s e t   i f   t h e   u s e r   s e t   a   l i m i t   o n   t h e   n u m b e r   o f   i t e m s   r e t u r n e d ,   a n d   i n d i c a t e s   t h a t   t h e   s e r v e r   h a s   m o r e   d a t a   a v a i l a b l e .   T h e   v a l u e   i s   o p a q u e   a n d   m a y   b e   u s e d   t o   i s s u e   a n o t h e r   r e q u e s t   t o   t h e   e n d p o i n t   t h a t   s e r v e d   t h i s   l i s t   t o   r e t r i e v e   t h e   n e x t   s e t   o f   a v a i l a b l e   o b j e c t s .   C o n t i n u i n g   a   c o n s i s t e n t   l i s t   m a y   n o t   b e   p o s s i b l e   i f   t h e   s e r v e r   c o n f i g u r a t i o n   h a s   c h a n g e d   o r   m o r e   t h a n   a   f e w   m i n u t e s   h a v e   p a s s e d .   T h e   r e s o u r c e V e r s i o n   f i e l d   r e t u r n e d   w h e n   u s i n g   t h i s   c o n t i n u e   v a l u e   w i l l   b e   i d e n t i c a l   t o   t h e   v a l u e   i n   t h e   f i r s t   r e s p o n s e ,   u n l e s s   y o u   h a v e   r e c e i v e d   t h i s   t o k e n   f r o m   a n   e r r o r   m e s s a g e . r e m a i n i n g I t e m C o u n t   ( i n t 6 4 ) r e m a i n i n g I t e m C o u n t   i s   t h e   n u m b e r   o f   s u b s e q u e n t   i t e m s   i n   t h e   l i s t   w h i c h   a r e   n o t   i n c l u d e d   i n   t h i s   l i s t   r e s p o n s e .   I f   t h e   l i s t   r e q u e s t   c o n t a i n e d   l a b e l   o r   f i e l d   s e l e c t


Question: What is Configuration APIs?

Answer: Configuration APIsClient Authentication (v1)Client Authentication (v1beta1)Event Rate Limit Configuration (v1alpha1)Image Policy API (v1alpha1)kube-apiserver Admission (v1)kube-apiserver Audit Configuration (v1)kube-apiserver Configuration (v1)kube-apiserver Configuration (v1alpha1)kube-apiserver Configuration (v1beta1)kube-controller-manager Configuration (v1alpha1)kube-proxy Configuration (v1alpha1)kube-scheduler Configuration (v1)kubeadm Configuration (v1beta3)kubeadm Configuration (v1beta4)kubeconfig (v1)Kubelet Configuration (v1)Kubelet Configuration (v1alpha1)Kubelet Configuration (v1beta1)Kubelet CredentialProvider (v1)kuberc (v1alpha1)WebhookAdmission Configuration (v1)


Question: How does Configuration APIs work?

Answer: Configuration APIsClient Authentication (v1)Client Authentication (v1beta1)Event Rate Limit Configuration (v1alpha1)Image Policy API (v1alpha1)kube-apiserver Admission (v1)kube-apiserver Audit Configuration (v1)kube-apiserver Configuration (v1)kube-apiserver Configuration (v1alpha1)kube-apiserver Configuration (v1beta1)kube-controller-manager Configuration (v1alpha1)kube-proxy Configuration (v1alpha1)kube-scheduler Configuration (v1)kubeadm Configuration (v1beta3)kubeadm Configuration (v1beta4)kubeconfig (v1)Kubelet Configuration (v1)Kubelet Configuration (v1alpha1)Kubelet Configuration (v1beta1)Kubelet CredentialProvider (v1)kuberc (v1alpha1)WebhookAdmission Configuration (v1)


Question: When would you use Configuration APIs?

Answer: Configuration APIsClient Authentication (v1)Client Authentication (v1beta1)Event Rate Limit Configuration (v1alpha1)Image Policy API (v1alpha1)kube-apiserver Admission (v1)kube-apiserver Audit Configuration (v1)kube-apiserver Configuration (v1)kube-apiserver Configuration (v1alpha1)kube-apiserver Configuration (v1beta1)kube-controller-manager Configuration (v1alpha1)kube-proxy Configuration (v1alpha1)kube-scheduler Configuration (v1)kubeadm Configuration (v1beta3)kubeadm Configuration (v1beta4)kubeconfig (v1)Kubelet Configuration (v1)Kubelet Configuration (v1alpha1)Kubelet Configuration (v1beta1)Kubelet CredentialProvider (v1)kuberc (v1alpha1)WebhookAdmission Configuration (v1)


Question: What are the benefits of Configuration APIs?

Answer: Configuration APIsClient Authentication (v1)Client Authentication (v1beta1)Event Rate Limit Configuration (v1alpha1)Image Policy API (v1alpha1)kube-apiserver Admission (v1)kube-apiserver Audit Configuration (v1)kube-apiserver Configuration (v1)kube-apiserver Configuration (v1alpha1)kube-apiserver Configuration (v1beta1)kube-controller-manager Configuration (v1alpha1)kube-proxy Configuration (v1alpha1)kube-scheduler Configuration (v1)kubeadm Configuration (v1beta3)kubeadm Configuration (v1beta4)kubeconfig (v1)Kubelet Configuration (v1)Kubelet Configuration (v1alpha1)Kubelet Configuration (v1beta1)Kubelet CredentialProvider (v1)kuberc (v1alpha1)WebhookAdmission Configuration (v1)


Question: What is kubectl set selector?

Answer: kubectl set selectorSynopsisSet the selector on a resource. Note that the new selector will overwrite the old selector if the resource had one prior to the invocation of 'set selector'.A selector must begin with a letter or number, and may contain letters, numbers, hyphens, dots, and underscores, up to 63 characters. If --resource-version is specified, then updates will use this resource version, otherwise the existing resource-version will be used. Note: currently selectors can only be set on Service objects.kubectl set selector (-f FILENAME | TYPE NAME) EXPRESSIONS [--resource-version=version] Examples # Set the labels and selector before creating a deployment/service pair kubectl create service clusterip my-svc --clusterip="None" -o yaml --dry-run=client | kubectl set selector --local -f - 'environment=qa' -o yaml | kubectl create -f - kubectl create deployment my-dep -o yaml --dry-run=client | kubectl label --local -f - environment=qa -o yaml | kubectl create -f - 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.--dry-run string[="unchanged"] Default: "none"Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.--field-manager string Default: "kubectl-set"Name of the manager used to track field ownership.-f, --filename stringsidentifying the resource.-h, --helphelp for selector--localIf true, annotation will NOT contact api-server but run locally.-o, --output stringOutput format. One of: (json, yaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file).-R, --recursive Default: trueProcess the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.--resource-version stringIf non-empty, the selectors update will only succeed if this is the current resource-version for the object. Only valid when specifying a single resource.--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--


Question: How does kubectl set selector work?

Answer: kubectl set selectorSynopsisSet the selector on a resource. Note that the new selector will overwrite the old selector if the resource had one prior to the invocation of 'set selector'.A selector must begin with a letter or number, and may contain letters, numbers, hyphens, dots, and underscores, up to 63 characters. If --resource-version is specified, then updates will use this resource version, otherwise the existing resource-version will be used. Note: currently selectors can only be set on Service objects.kubectl set selector (-f FILENAME | TYPE NAME) EXPRESSIONS [--resource-version=version] Examples # Set the labels and selector before creating a deployment/service pair kubectl create service clusterip my-svc --clusterip="None" -o yaml --dry-run=client | kubectl set selector --local -f - 'environment=qa' -o yaml | kubectl create -f - kubectl create deployment my-dep -o yaml --dry-run=client | kubectl label --local -f - environment=qa -o yaml | kubectl create -f - 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.--dry-run string[="unchanged"] Default: "none"Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.--field-manager string Default: "kubectl-set"Name of the manager used to track field ownership.-f, --filename stringsidentifying the resource.-h, --helphelp for selector--localIf true, annotation will NOT contact api-server but run locally.-o, --output stringOutput format. One of: (json, yaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file).-R, --recursive Default: trueProcess the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.--resource-version stringIf non-empty, the selectors update will only succeed if this is the current resource-version for the object. Only valid when specifying a single resource.--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--


Question: When would you use kubectl set selector?

Answer: kubectl set selectorSynopsisSet the selector on a resource. Note that the new selector will overwrite the old selector if the resource had one prior to the invocation of 'set selector'.A selector must begin with a letter or number, and may contain letters, numbers, hyphens, dots, and underscores, up to 63 characters. If --resource-version is specified, then updates will use this resource version, otherwise the existing resource-version will be used. Note: currently selectors can only be set on Service objects.kubectl set selector (-f FILENAME | TYPE NAME) EXPRESSIONS [--resource-version=version] Examples # Set the labels and selector before creating a deployment/service pair kubectl create service clusterip my-svc --clusterip="None" -o yaml --dry-run=client | kubectl set selector --local -f - 'environment=qa' -o yaml | kubectl create -f - kubectl create deployment my-dep -o yaml --dry-run=client | kubectl label --local -f - environment=qa -o yaml | kubectl create -f - 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.--dry-run string[="unchanged"] Default: "none"Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.--field-manager string Default: "kubectl-set"Name of the manager used to track field ownership.-f, --filename stringsidentifying the resource.-h, --helphelp for selector--localIf true, annotation will NOT contact api-server but run locally.-o, --output stringOutput format. One of: (json, yaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file).-R, --recursive Default: trueProcess the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.--resource-version stringIf non-empty, the selectors update will only succeed if this is the current resource-version for the object. Only valid when specifying a single resource.--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--


Question: What are the benefits of kubectl set selector?

Answer: kubectl set selectorSynopsisSet the selector on a resource. Note that the new selector will overwrite the old selector if the resource had one prior to the invocation of 'set selector'.A selector must begin with a letter or number, and may contain letters, numbers, hyphens, dots, and underscores, up to 63 characters. If --resource-version is specified, then updates will use this resource version, otherwise the existing resource-version will be used. Note: currently selectors can only be set on Service objects.kubectl set selector (-f FILENAME | TYPE NAME) EXPRESSIONS [--resource-version=version] Examples # Set the labels and selector before creating a deployment/service pair kubectl create service clusterip my-svc --clusterip="None" -o yaml --dry-run=client | kubectl set selector --local -f - 'environment=qa' -o yaml | kubectl create -f - kubectl create deployment my-dep -o yaml --dry-run=client | kubectl label --local -f - environment=qa -o yaml | kubectl create -f - 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.--dry-run string[="unchanged"] Default: "none"Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.--field-manager string Default: "kubectl-set"Name of the manager used to track field ownership.-f, --filename stringsidentifying the resource.-h, --helphelp for selector--localIf true, annotation will NOT contact api-server but run locally.-o, --output stringOutput format. One of: (json, yaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file).-R, --recursive Default: trueProcess the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.--resource-version stringIf non-empty, the selectors update will only succeed if this is the current resource-version for the object. Only valid when specifying a single resource.--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--


Question: What is Synopsis?

Answer: S e t   t h e   s e l e c t o r   o n   a   r e s o u r c e .   N o t e   t h a t   t h e   n e w   s e l e c t o r   w i l l   o v e r w r i t e   t h e   o l d   s e l e c t o r   i f   t h e   r e s o u r c e   h a d   o n e   p r i o r   t o   t h e   i n v o c a t i o n   o f   ' s e t   s e l e c t o r ' .   A   s e l e c t o r   m u s t   b e g i n   w i t h   a   l e t t e r   o r   n u m b e r ,   a n d   m a y   c o n t a i n   l e t t e r s ,   n u m b e r s ,   h y p h e n s ,   d o t s ,   a n d   u n d e r s c o r e s ,   u p   t o   6 3   c h a r a c t e r s .   I f   - - 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 ,   t h e n   u p d a t e s   w i l l   u s e   t h i s   r e s o u r c e   v e r s i o n ,   o t h e r w i s e   t h e   e x i s t i n g   r e s o u r c e - v e r s i o n   w i l l   b e   u s e d .   N o t e :   c u r r e n t l y   s e l e c t o r s   c a n   o n l y   b e   s e t   o n   S e r v i c e   o b j e c t s .   k u b e c t l   s e t   s e l e c t o r   ( - f   F I L E N A M E   |   T Y P E   N A M E )   E X P R E S S I O N S   [ - - r e s o u r c e - v e r s i o n = v e r s i o n ]


Question: What is Examples?

Answer: #   S e t   t h e   l a b e l s   a n d   s e l e c t o r   b e f o r e   c r e a t i n g   a   d e p l o y m e n t / s e r v i c e   p a i r   k u b e c t l   c r e a t e   s e r v i c e   c l u s t e r i p   m y - s v c   - - c l u s t e r i p = " N o n e "   - o   y a m l   - - d r y - r u n = c l i e n t   |   k u b e c t l   s e t   s e l e c t o r   - - l o c a l   - f   -   ' e n v i r o n m e n t = q a '   - o   y a m l   |   k u b e c t l   c r e a t e   - f   -   k u b e c t l   c r e a t e   d e p l o y m e n t   m y - d e p   - o   y a m l   - - d r y - r u n = c l i e n t   |   k u b e c t l   l a b e l   - - l o c a l   - f   -   e n v i r o n m e n t = q a   - o   y a m l   |   k u b e c t l   c r e a t e   - f   -


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 .   M u s t   b e   " n o n e " ,   " s e r v e r " ,   o r   " c l i e n t " .   I f   c l i e n t   s t r a t e g y ,   o n l y   p r i n t   t h e   o b j e c t   t h a t   w o u l d   b e   s e n t ,   w i t h o u t   s e n d i n g   i t .   I f   s e r v e r   s t r a t e g y ,   s u b m i t   s e r v e r - s i d e   r e q u e s t   w i t h o u t   p e r s i s t i n g   t h e   r e s o u r c e .   N a m e   o f   t h e   m a n a g e r   u s e d   t o   t r a c k   f i e l d   o w n e r s h i p .   i d e n t i f y i n g   t h e   r e s o u r c e .   h e l p   f o r   s e l e c t o r   I f   t r u e ,   a n n o t a t i o n   w i l l   N O T   c o n t a c t   a p i - s e r v e r   b u t   r u n   l o c a l l y .   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   n o n - e m p t y ,   t h e   s e l e c t o r s   u p d a t e   w i l l   o n l y   s u c c e e d   i f   t h i s   i s   t h e   c u r r e n t   r e s o u r c e - v e r s i o n   f o r   t h e   o b j e c t .   O n l y   v a l i d   w h e n   s p e c i f y i n g   a   s 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   s e t   -   S e t   s p e c i f i c   f e a t u r e s   o n   o b j e c t 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 Kubernetes Issue Tracker?

Answer: Kubernetes Issue TrackerTo report a security issue, please follow the Kubernetes security disclosure process.Work on Kubernetes code and public issues are tracked using GitHub Issues.Official list of known CVEs (security vulnerabilities) that have been announced by the Security Response CommitteeCVE-related GitHub issuesSecurity-related announcements are sent to the kubernetes-security-announce@googlegroups.com mailing list.


Question: How does Kubernetes Issue Tracker work?

Answer: Kubernetes Issue TrackerTo report a security issue, please follow the Kubernetes security disclosure process.Work on Kubernetes code and public issues are tracked using GitHub Issues.Official list of known CVEs (security vulnerabilities) that have been announced by the Security Response CommitteeCVE-related GitHub issuesSecurity-related announcements are sent to the kubernetes-security-announce@googlegroups.com mailing list.


Question: When would you use Kubernetes Issue Tracker?

Answer: Kubernetes Issue TrackerTo report a security issue, please follow the Kubernetes security disclosure process.Work on Kubernetes code and public issues are tracked using GitHub Issues.Official list of known CVEs (security vulnerabilities) that have been announced by the Security Response CommitteeCVE-related GitHub issuesSecurity-related announcements are sent to the kubernetes-security-announce@googlegroups.com mailing list.


Question: What are the benefits of Kubernetes Issue Tracker?

Answer: Kubernetes Issue TrackerTo report a security issue, please follow the Kubernetes security disclosure process.Work on Kubernetes code and public issues are tracked using GitHub Issues.Official list of known CVEs (security vulnerabilities) that have been announced by the Security Response CommitteeCVE-related GitHub issuesSecurity-related announcements are sent to the kubernetes-security-announce@googlegroups.com mailing list.


Question: What is Kubernetes Issue Tracker?

Answer: T o   r e p o r t   a   s e c u r i t y   i s s u e ,   p l e a s e   f o l l o w   t h e   K u b e r n e t e s   s e c u r i t y   d i s c l o s u r e   p r o c e s s .   W o r k   o n   K u b e r n e t e s   c o d e   a n d   p u b l i c   i s s u e s   a r e   t r a c k e d   u s i n g   G i t H u b   I s s u e s .   O f f i c i a l   l i s t   o f   k n o w n   C V E s   ( s e c u r i t y   v u l n e r a b i l i t i e s )   t h a t   h a v e   b e e n   a n n o u n c e d   b y   t h e   S e c u r i t y   R e s p o n s e   C o m m i t t e e C V E - r e l a t e d   G i t H u b   i s s u e s   S e c u r i t y - r e l a t e d   a n n o u n c e m e n t s   a r e   s e n t   t o   t h e   k u b e r n e t e s - s e c u r i t y - a n n o u n c e @ g o o g l e g r o u p s . c o m   m a i l i n g   l i s t .


Question: What is Example: Deploying PHP Guestbook application with Redis?

Answer: Example: Deploying PHP Guestbook application with RedisThis tutorial shows you how to build and deploy a simple (not production ready), multi-tier web application using Kubernetes and Docker. This example consists of the following components:A single-instance Redis to store guestbook entriesMultiple web frontend instancesObjectivesStart up a Redis leader.Start up two Redis followers.Start up the guestbook frontend.Expose and view the Frontend Service.Clean up.Before you beginYou need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster. It is recommended to run this tutorial on a cluster with at least two nodes that are not acting as control plane hosts. If you do not already have a cluster, you can create one by using minikube or you can use one of these Kubernetes playgrounds:iximiuz LabsKillercodaKodeKloudPlay with KubernetesYour Kubernetes server must be at or later than version v1.14.To check the version, enter kubectl version.Start up the Redis DatabaseThe guestbook application uses Redis to store its data.Creating the Redis DeploymentThe manifest file, included below, specifies a Deployment controller that runs a single replica Redis Pod.application/guestbook/redis-leader-deployment.yaml # SOURCE: https://cloud.google.com/kubernetes-engine/docs/tutorials/guestbook apiVersion: apps/v1 kind: Deployment metadata: name: redis-leader labels: app: redis role: leader tier: backend spec: replicas: 1 selector: matchLabels: app: redis template: metadata: labels: app: redis role: leader tier: backend spec: containers: - name: leader image: "docker.io/redis:6.0.5" resources: requests: cpu: 100m memory: 100Mi ports: - containerPort: 6379Launch a terminal window in the directory you downloaded the manifest files.Apply the Redis Deployment from the redis-leader-deployment.yaml file:kubectl apply -f https://k8s.io/examples/application/guestbook/redis-leader-deployment.yaml Query the list of Pods to verify that the Redis Pod is running:kubectl get pods The response should be similar to this:NAME READY STATUS RESTARTS AGE redis-leader-fb76b4755-xjr2n 1/1 Running 0 13s Run the following command to view the logs from the Redis leader Pod:kubectl logs -f deployment/redis-leader Creating the Redis leader ServiceThe guestbook application needs to communicate to the Redis to write its data. You need to apply a Service to proxy the traffic to the Redis Pod. A Service defines a policy to access the Pods.application/guestbook/redis-leader-service.yaml # SOURCE: https://cloud.google.com/kubernetes-engine/docs/tutorials/guestbook apiVersion: v1 kind: Service metadata: name: redis-leader labels: app: redis role: leader tier: backend spec: ports: - port: 6379 targetPort: 6379 selector: app: redis role: leader tier: backendApply the Redis Service from the following redis-leader-service.yaml file:kubectl apply -f https://k8s.io/examples/application/guestbook/redis-leader-service.yaml Query the list of Services


Question: How does Example: Deploying PHP Guestbook application with Redis work?

Answer: Example: Deploying PHP Guestbook application with RedisThis tutorial shows you how to build and deploy a simple (not production ready), multi-tier web application using Kubernetes and Docker. This example consists of the following components:A single-instance Redis to store guestbook entriesMultiple web frontend instancesObjectivesStart up a Redis leader.Start up two Redis followers.Start up the guestbook frontend.Expose and view the Frontend Service.Clean up.Before you beginYou need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster. It is recommended to run this tutorial on a cluster with at least two nodes that are not acting as control plane hosts. If you do not already have a cluster, you can create one by using minikube or you can use one of these Kubernetes playgrounds:iximiuz LabsKillercodaKodeKloudPlay with KubernetesYour Kubernetes server must be at or later than version v1.14.To check the version, enter kubectl version.Start up the Redis DatabaseThe guestbook application uses Redis to store its data.Creating the Redis DeploymentThe manifest file, included below, specifies a Deployment controller that runs a single replica Redis Pod.application/guestbook/redis-leader-deployment.yaml # SOURCE: https://cloud.google.com/kubernetes-engine/docs/tutorials/guestbook apiVersion: apps/v1 kind: Deployment metadata: name: redis-leader labels: app: redis role: leader tier: backend spec: replicas: 1 selector: matchLabels: app: redis template: metadata: labels: app: redis role: leader tier: backend spec: containers: - name: leader image: "docker.io/redis:6.0.5" resources: requests: cpu: 100m memory: 100Mi ports: - containerPort: 6379Launch a terminal window in the directory you downloaded the manifest files.Apply the Redis Deployment from the redis-leader-deployment.yaml file:kubectl apply -f https://k8s.io/examples/application/guestbook/redis-leader-deployment.yaml Query the list of Pods to verify that the Redis Pod is running:kubectl get pods The response should be similar to this:NAME READY STATUS RESTARTS AGE redis-leader-fb76b4755-xjr2n 1/1 Running 0 13s Run the following command to view the logs from the Redis leader Pod:kubectl logs -f deployment/redis-leader Creating the Redis leader ServiceThe guestbook application needs to communicate to the Redis to write its data. You need to apply a Service to proxy the traffic to the Redis Pod. A Service defines a policy to access the Pods.application/guestbook/redis-leader-service.yaml # SOURCE: https://cloud.google.com/kubernetes-engine/docs/tutorials/guestbook apiVersion: v1 kind: Service metadata: name: redis-leader labels: app: redis role: leader tier: backend spec: ports: - port: 6379 targetPort: 6379 selector: app: redis role: leader tier: backendApply the Redis Service from the following redis-leader-service.yaml file:kubectl apply -f https://k8s.io/examples/application/guestbook/redis-leader-service.yaml Query the list of Services


Question: When would you use Example: Deploying PHP Guestbook application with Redis?

Answer: Example: Deploying PHP Guestbook application with RedisThis tutorial shows you how to build and deploy a simple (not production ready), multi-tier web application using Kubernetes and Docker. This example consists of the following components:A single-instance Redis to store guestbook entriesMultiple web frontend instancesObjectivesStart up a Redis leader.Start up two Redis followers.Start up the guestbook frontend.Expose and view the Frontend Service.Clean up.Before you beginYou need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster. It is recommended to run this tutorial on a cluster with at least two nodes that are not acting as control plane hosts. If you do not already have a cluster, you can create one by using minikube or you can use one of these Kubernetes playgrounds:iximiuz LabsKillercodaKodeKloudPlay with KubernetesYour Kubernetes server must be at or later than version v1.14.To check the version, enter kubectl version.Start up the Redis DatabaseThe guestbook application uses Redis to store its data.Creating the Redis DeploymentThe manifest file, included below, specifies a Deployment controller that runs a single replica Redis Pod.application/guestbook/redis-leader-deployment.yaml # SOURCE: https://cloud.google.com/kubernetes-engine/docs/tutorials/guestbook apiVersion: apps/v1 kind: Deployment metadata: name: redis-leader labels: app: redis role: leader tier: backend spec: replicas: 1 selector: matchLabels: app: redis template: metadata: labels: app: redis role: leader tier: backend spec: containers: - name: leader image: "docker.io/redis:6.0.5" resources: requests: cpu: 100m memory: 100Mi ports: - containerPort: 6379Launch a terminal window in the directory you downloaded the manifest files.Apply the Redis Deployment from the redis-leader-deployment.yaml file:kubectl apply -f https://k8s.io/examples/application/guestbook/redis-leader-deployment.yaml Query the list of Pods to verify that the Redis Pod is running:kubectl get pods The response should be similar to this:NAME READY STATUS RESTARTS AGE redis-leader-fb76b4755-xjr2n 1/1 Running 0 13s Run the following command to view the logs from the Redis leader Pod:kubectl logs -f deployment/redis-leader Creating the Redis leader ServiceThe guestbook application needs to communicate to the Redis to write its data. You need to apply a Service to proxy the traffic to the Redis Pod. A Service defines a policy to access the Pods.application/guestbook/redis-leader-service.yaml # SOURCE: https://cloud.google.com/kubernetes-engine/docs/tutorials/guestbook apiVersion: v1 kind: Service metadata: name: redis-leader labels: app: redis role: leader tier: backend spec: ports: - port: 6379 targetPort: 6379 selector: app: redis role: leader tier: backendApply the Redis Service from the following redis-leader-service.yaml file:kubectl apply -f https://k8s.io/examples/application/guestbook/redis-leader-service.yaml Query the list of Services


Question: What are the benefits of Example: Deploying PHP Guestbook application with Redis?

Answer: Example: Deploying PHP Guestbook application with RedisThis tutorial shows you how to build and deploy a simple (not production ready), multi-tier web application using Kubernetes and Docker. This example consists of the following components:A single-instance Redis to store guestbook entriesMultiple web frontend instancesObjectivesStart up a Redis leader.Start up two Redis followers.Start up the guestbook frontend.Expose and view the Frontend Service.Clean up.Before you beginYou need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster. It is recommended to run this tutorial on a cluster with at least two nodes that are not acting as control plane hosts. If you do not already have a cluster, you can create one by using minikube or you can use one of these Kubernetes playgrounds:iximiuz LabsKillercodaKodeKloudPlay with KubernetesYour Kubernetes server must be at or later than version v1.14.To check the version, enter kubectl version.Start up the Redis DatabaseThe guestbook application uses Redis to store its data.Creating the Redis DeploymentThe manifest file, included below, specifies a Deployment controller that runs a single replica Redis Pod.application/guestbook/redis-leader-deployment.yaml # SOURCE: https://cloud.google.com/kubernetes-engine/docs/tutorials/guestbook apiVersion: apps/v1 kind: Deployment metadata: name: redis-leader labels: app: redis role: leader tier: backend spec: replicas: 1 selector: matchLabels: app: redis template: metadata: labels: app: redis role: leader tier: backend spec: containers: - name: leader image: "docker.io/redis:6.0.5" resources: requests: cpu: 100m memory: 100Mi ports: - containerPort: 6379Launch a terminal window in the directory you downloaded the manifest files.Apply the Redis Deployment from the redis-leader-deployment.yaml file:kubectl apply -f https://k8s.io/examples/application/guestbook/redis-leader-deployment.yaml Query the list of Pods to verify that the Redis Pod is running:kubectl get pods The response should be similar to this:NAME READY STATUS RESTARTS AGE redis-leader-fb76b4755-xjr2n 1/1 Running 0 13s Run the following command to view the logs from the Redis leader Pod:kubectl logs -f deployment/redis-leader Creating the Redis leader ServiceThe guestbook application needs to communicate to the Redis to write its data. You need to apply a Service to proxy the traffic to the Redis Pod. A Service defines a policy to access the Pods.application/guestbook/redis-leader-service.yaml # SOURCE: https://cloud.google.com/kubernetes-engine/docs/tutorials/guestbook apiVersion: v1 kind: Service metadata: name: redis-leader labels: app: redis role: leader tier: backend spec: ports: - port: 6379 targetPort: 6379 selector: app: redis role: leader tier: backendApply the Redis Service from the following redis-leader-service.yaml file:kubectl apply -f https://k8s.io/examples/application/guestbook/redis-leader-service.yaml Query the list of Services


Question: What is Example: Deploying PHP Guestbook application with Redis?

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


Question: What is Objectives?

Answer: S t a r t   u p   a   R e d i s   l e a d e r . S t a r t   u p   t w o   R e d i s   f o l l o w e r s . S t a r t   u p   t h e   g u e s t b o o k   f r o n t e n d . E x p o s e   a n d   v i e w   t h e   F r o n t e n d   S e r v i c e . C l e a n   u p .


Question: What is Before you begin?

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


Question: What is Start up the Redis Database?

Answer: T h e   g u e s t b o o k   a p p l i c a t i o n   u s e s   R e d i s   t o   s t o r e   i t s   d a t a .


Question: What is Creating the Redis Deployment?

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


Question: What is Creating the Redis leader Service?

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


Question: What is Set up Redis followers?

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


Question: What is Creating the Redis follower service?

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


Question: What is Set up and Expose the Guestbook Frontend?

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


Question: What is Creating the Guestbook Frontend Deployment?

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


Question: What is Creating the Frontend Service?

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


Question: What is Note:?

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


Question: What is Viewing the Frontend Service via kubectl port-forward?

Answer: R u n   t h e   f o l l o w i n g   c o m m a n d   t o   f o r w a r d   p o r t   8 0 8 0   o n   y o u r   l o c a l   m a c h i n e   t o   p o r t   8 0   o n   t h e   s e r v i c e . k u b e c t l   p o r t - f o r w a r d   s v c / f r o n t e n d   8 0 8 0 : 8 0   T h e   r e s p o n s e   s h o u l d   b e   s i m i l a r   t o   t h i s : F o r w a r d i n g   f r o m   1 2 7 . 0 . 0 . 1 : 8 0 8 0   - >   8 0   F o r w a r d i n g   f r o m   [ : : 1 ] : 8 0 8 0   - >   8 0   l o a d   t h e   p a g e   h t t p : / / l o c a l h o s t : 8 0 8 0   i n   y o u r   b r o w s e r   t o   v i e w   y o u r   g u e s t b o o k .   R u n   t h e   f o l l o w i n g   c o m m a n d   t o   f o r w a r d   p o r t   8 0 8 0   o n   y o u r   l o c a l   m a c h i n e   t o   p o r t   8 0   o n   t h e   s e r v i c e .   k u b e c t l   p o r t - f o r w a r d   s v c / f r o n t e n d   8 0 8 0 : 8 0   T h e   r e s p o n s e   s h o u l d   b e   s i m i l a r   t o   t h i s :   F o r w a r d i n g   f r o m   1 2 7 . 0 . 0 . 1 : 8 0 8 0   - >   8 0   F o r w a r d i n g   f r o m   [ : : 1 ] : 8 0 8 0   - >   8 0   l o a d   t h e   p a g e   h t t p : / / l o c a l h o s t : 8 0 8 0   i n   y o u r   b r o w s e r   t o   v i e w   y o u r   g u e s t b o o k .


Question: What is Viewing the Frontend Service via LoadBalancer?

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


Question: What is Scale the Web Frontend?

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


Question: What is Cleaning up?

Answer: D e l e t i n g   t h e   D e p l o y m e n t s   a n d   S e r v i c e s   a l s o   d e l e t e s   a n y   r u n n i n g   P o d s .   U s e   l a b e l s   t o   d e l e t e   m u l t i p l e   r e s o u r c e s   w i t h   o n e   c o m m a n d .   R u n   t h e   f o l l o w i n g   c o m m a n d s   t o   d e l e t e   a l l   P o d s ,   D e p l o y m e n t s ,   a n d   S e r v i c e s . k u b e c t l   d e l e t e   d e p l o y m e n t   - l   a p p = r e d i s   k u b e c t l   d e l e t e   s e r v i c e   - l   a p p = r e d i s   k u b e c t l   d e l e t e   d e p l o y m e n t   f r o n t e n d   k u b e c t l   d e l e t e   s e r v i c e   f r o n t e n d   T h e   r e s p o n s e   s h o u l d   l o o k   s i m i l a r   t o   t h i s : d e p l o y m e n t . a p p s   " r e d i s - f o l l o w e r "   d e l e t e d   d e p l o y m e n t . a p p s   " r e d i s - l e a d e r "   d e l e t e d   d e p l o y m e n t . a p p s   " f r o n t e n d "   d e l e t e d   s e r v i c e   " f r o n t e n d "   d e l e t e d   Q u e r y   t h e   l i s t   o f   P o d s   t o   v e r i f y   t h a t   n o   P o d s   a r e   r u n n i n g : k u b e c t l   g e t   p o d s   T h e   r e s p o n s e   s h o u l d   l o o k   s i m i l a r   t o   t h i s : N o   r e s o u r c e s   f o u n d   i n   d e f a u l t   n a m e s p a c e .   R u n   t h e   f o l l o w i n g   c o m m a n d s   t o   d e l e t e   a l l   P o d s ,   D e p l o y m e n t s ,   a n d   S e r v i c e s .   k u b e c t l   d e l e t e   d e p l o y m e n t   - l   a p p = r e d i s   k u b e c t l   d e l e t e   s e r v i c e   - l   a p p = r e d i s   k u b e c t l   d e l e t e   d e p l o y m e n t   f r o n t e n d   k u b e c t l   d e l e t e   s e r v i c e   f r o n t e n d   T h e   r e s p o n s e   s h o u l d   l o o k   s i m i l a r   t o   t h i s :   d e p l o y m e n t . a p p s   " r e d i s - f o l l o w e r "   d e l e t e d   d e p l o y m e n t . a p p s   " r e


Question: What is What's next?

Answer: C o m p l e t e   t h e   K u b e r n e t e s   B a s i c s   I n t e r a c t i v e   T u t o r i a l s U s e   K u b e r n e t e s   t o   c r e a t e   a   b l o g   u s i n g   P e r s i s t e n t   V o l u m e s   f o r   M y S Q L   a n d   W o r d p r e s s R e a d   m o r e   a b o u t   c o n n e c t i n g   a p p l i c a t i o n s   w i t h   s e r v i c e s R e a d   m o r e   a b o u t   u s i n g   l a b e l s   e f f e c t i v e l y


Question: What is Kubelet Checkpoint API?

Answer: Kubelet Checkpoint APIFEATURE STATE: Kubernetes v1.30 [beta] (enabled by default: true)Checkpointing a container is the functionality to create a stateful copy of a running container. Once you have a stateful copy of a container, you could move it to a different computer for debugging or similar purposes.If you move the checkpointed container data to a computer that's able to restore it, that restored container continues to run at exactly the same point it was checkpointed. You can also inspect the saved data, provided that you have suitable tools for doing so.Creating a checkpoint of a container might have security implications. Typically a checkpoint contains all memory pages of all processes in the checkpointed container. This means that everything that used to be in memory is now available on the local disk. This includes all private data and possibly keys used for encryption. The underlying CRI implementations (the container runtime on that node) should create the checkpoint archive to be only accessible by the root user. It is still important to remember if the checkpoint archive is transferred to another system all memory pages will be readable by the owner of the checkpoint archive.Operationspost checkpoint the specified containerTell the kubelet to checkpoint a specific container from the specified Pod.Consult the Kubelet authentication/authorization reference for more information about how access to the kubelet checkpoint interface is controlled.The kubelet will request a checkpoint from the underlying CRI implementation. In the checkpoint request the kubelet will specify the name of the checkpoint archive as checkpoint-<podFullName>-<containerName>-<timestamp>.tar and also request to store the checkpoint archive in the checkpoints directory below its root directory (as defined by --root-dir). This defaults to /var/lib/kubelet/checkpoints.The checkpoint archive is in tar format, and could be listed using an implementation of tar. The contents of the archive depend on the underlying CRI implementation (the container runtime on that node).HTTP RequestPOST /checkpoint/{namespace}/{pod}/{container}Parametersnamespace (in path): string, requiredNamespacepod (in path): string, requiredPodcontainer (in path): string, requiredContainertimeout (in query): integerTimeout in seconds to wait until the checkpoint creation is finished. If zero or no timeout is specified the default CRI timeout value will be used. Checkpoint creation time depends directly on the used memory of the container. The more memory a container uses the more time is required to create the corresponding checkpoint.Response200: OK401: Unauthorized404: Not Found (if the ContainerCheckpoint feature gate is disabled)404: Not Found (if the specified namespace, pod or container cannot be found)500: Internal Server Error (if the CRI implementation encounter an error during checkpointing (see error message for further details))500: Internal Server Error (if the CRI implementation does


Question: How does Kubelet Checkpoint API work?

Answer: Kubelet Checkpoint APIFEATURE STATE: Kubernetes v1.30 [beta] (enabled by default: true)Checkpointing a container is the functionality to create a stateful copy of a running container. Once you have a stateful copy of a container, you could move it to a different computer for debugging or similar purposes.If you move the checkpointed container data to a computer that's able to restore it, that restored container continues to run at exactly the same point it was checkpointed. You can also inspect the saved data, provided that you have suitable tools for doing so.Creating a checkpoint of a container might have security implications. Typically a checkpoint contains all memory pages of all processes in the checkpointed container. This means that everything that used to be in memory is now available on the local disk. This includes all private data and possibly keys used for encryption. The underlying CRI implementations (the container runtime on that node) should create the checkpoint archive to be only accessible by the root user. It is still important to remember if the checkpoint archive is transferred to another system all memory pages will be readable by the owner of the checkpoint archive.Operationspost checkpoint the specified containerTell the kubelet to checkpoint a specific container from the specified Pod.Consult the Kubelet authentication/authorization reference for more information about how access to the kubelet checkpoint interface is controlled.The kubelet will request a checkpoint from the underlying CRI implementation. In the checkpoint request the kubelet will specify the name of the checkpoint archive as checkpoint-<podFullName>-<containerName>-<timestamp>.tar and also request to store the checkpoint archive in the checkpoints directory below its root directory (as defined by --root-dir). This defaults to /var/lib/kubelet/checkpoints.The checkpoint archive is in tar format, and could be listed using an implementation of tar. The contents of the archive depend on the underlying CRI implementation (the container runtime on that node).HTTP RequestPOST /checkpoint/{namespace}/{pod}/{container}Parametersnamespace (in path): string, requiredNamespacepod (in path): string, requiredPodcontainer (in path): string, requiredContainertimeout (in query): integerTimeout in seconds to wait until the checkpoint creation is finished. If zero or no timeout is specified the default CRI timeout value will be used. Checkpoint creation time depends directly on the used memory of the container. The more memory a container uses the more time is required to create the corresponding checkpoint.Response200: OK401: Unauthorized404: Not Found (if the ContainerCheckpoint feature gate is disabled)404: Not Found (if the specified namespace, pod or container cannot be found)500: Internal Server Error (if the CRI implementation encounter an error during checkpointing (see error message for further details))500: Internal Server Error (if the CRI implementation does


Question: When would you use Kubelet Checkpoint API?

Answer: Kubelet Checkpoint APIFEATURE STATE: Kubernetes v1.30 [beta] (enabled by default: true)Checkpointing a container is the functionality to create a stateful copy of a running container. Once you have a stateful copy of a container, you could move it to a different computer for debugging or similar purposes.If you move the checkpointed container data to a computer that's able to restore it, that restored container continues to run at exactly the same point it was checkpointed. You can also inspect the saved data, provided that you have suitable tools for doing so.Creating a checkpoint of a container might have security implications. Typically a checkpoint contains all memory pages of all processes in the checkpointed container. This means that everything that used to be in memory is now available on the local disk. This includes all private data and possibly keys used for encryption. The underlying CRI implementations (the container runtime on that node) should create the checkpoint archive to be only accessible by the root user. It is still important to remember if the checkpoint archive is transferred to another system all memory pages will be readable by the owner of the checkpoint archive.Operationspost checkpoint the specified containerTell the kubelet to checkpoint a specific container from the specified Pod.Consult the Kubelet authentication/authorization reference for more information about how access to the kubelet checkpoint interface is controlled.The kubelet will request a checkpoint from the underlying CRI implementation. In the checkpoint request the kubelet will specify the name of the checkpoint archive as checkpoint-<podFullName>-<containerName>-<timestamp>.tar and also request to store the checkpoint archive in the checkpoints directory below its root directory (as defined by --root-dir). This defaults to /var/lib/kubelet/checkpoints.The checkpoint archive is in tar format, and could be listed using an implementation of tar. The contents of the archive depend on the underlying CRI implementation (the container runtime on that node).HTTP RequestPOST /checkpoint/{namespace}/{pod}/{container}Parametersnamespace (in path): string, requiredNamespacepod (in path): string, requiredPodcontainer (in path): string, requiredContainertimeout (in query): integerTimeout in seconds to wait until the checkpoint creation is finished. If zero or no timeout is specified the default CRI timeout value will be used. Checkpoint creation time depends directly on the used memory of the container. The more memory a container uses the more time is required to create the corresponding checkpoint.Response200: OK401: Unauthorized404: Not Found (if the ContainerCheckpoint feature gate is disabled)404: Not Found (if the specified namespace, pod or container cannot be found)500: Internal Server Error (if the CRI implementation encounter an error during checkpointing (see error message for further details))500: Internal Server Error (if the CRI implementation does