Question: What are the benefits of Configure RunAsUserName for Windows pods and containers?

Answer: Configure RunAsUserName for Windows pods and containersFEATURE STATE: Kubernetes v1.18 [stable]This page shows how to use the runAsUserName setting for Pods and containers that will run on Windows nodes. This is roughly equivalent of the Linux-specific runAsUser setting, allowing you to run applications in a container as a different username than the default.Before you beginYou need to have a Kubernetes cluster and the kubectl command-line tool must be configured to communicate with your cluster. The cluster is expected to have Windows worker nodes where pods with containers running Windows workloads will get scheduled.Set the Username for a PodTo specify the username with which to execute the Pod's container processes, include the securityContext field (PodSecurityContext) in the Pod specification, and within it, the windowsOptions (WindowsSecurityContextOptions) field containing the runAsUserName field.The Windows security context options that you specify for a Pod apply to all Containers and init Containers in the Pod.Here is a configuration file for a Windows Pod that has the runAsUserName field set:windows/run-as-username-pod.yaml apiVersion: v1 kind: Pod metadata: name: run-as-username-pod-demo spec: securityContext: windowsOptions: runAsUserName: "ContainerUser" containers: - name: run-as-username-demo image: mcr.microsoft.com/windows/servercore:ltsc2019 command: ["ping", "-t", "localhost"] nodeSelector: kubernetes.io/os: windows Create the Pod:kubectl apply -f https://k8s.io/examples/windows/run-as-username-pod.yaml Verify that the Pod's Container is running:kubectl get pod run-as-username-pod-demo Get a shell to the running Container:kubectl exec -it run-as-username-pod-demo -- powershell Check that the shell is running user the correct username:echo $env:USERNAME The output should be:ContainerUser Set the Username for a ContainerTo specify the username with which to execute a Container's processes, include the securityContext field (SecurityContext) in the Container manifest, and within it, the windowsOptions (WindowsSecurityContextOptions) field containing the runAsUserName field.The Windows security context options that you specify for a Container apply only to that individual Container, and they override the settings made at the Pod level.Here is the configuration file for a Pod that has one Container, and the runAsUserName field is set at the Pod level and the Container level:windows/run-as-username-container.yaml apiVersion: v1 kind: Pod metadata: name: run-as-username-container-demo spec: securityContext: windowsOptions: runAsUserName: "ContainerUser" containers: - name: run-as-username-demo image: mcr.microsoft.com/windows/servercore:ltsc2019 command: ["ping", "-t", "localhost"] securityContext: windowsOptions: runAsUserName: "ContainerAdministrator" nodeSelector: kubernetes.io/os: windows Create the Pod:kubectl apply -f https://k8s.io/examples/windows/run-as-username-container.yaml Verify that the Pod's Container is running:kube


Question: What is Configure RunAsUserName for Windows pods and containers?

Answer: T h i s   p a g e   s h o w s   h o w   t o   u s e   t h e   r u n A s U s e r N a m e   s e t t i n g   f o r   P o d s   a n d   c o n t a i n e r s   t h a t   w i l l   r u n   o n   W i n d o w s   n o d e s .   T h i s   i s   r o u g h l y   e q u i v a l e n t   o f   t h e   L i n u x - s p e c i f i c   r u n A s U s e r   s e t t i n g ,   a l l o w i n g   y o u   t o   r u n   a p p l i c a t i o n s   i n   a   c o n t a i n e r   a s   a   d i f f e r e n t   u s e r n a m e   t h a n   t h e   d e f a u l t .


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 .   T h e   c l u s t e r   i s   e x p e c t e d   t o   h a v e   W i n d o w s   w o r k e r   n o d e s   w h e r e   p o d s   w i t h   c o n t a i n e r s   r u n n i n g   W i n d o w s   w o r k l o a d s   w i l l   g e t   s c h e d u l e d .


Question: What is Set the Username for a Pod?

Answer: T o   s p e c i f y   t h e   u s e r n a m e   w i t h   w h i c h   t o   e x e c u t e   t h e   P o d ' s   c o n t a i n e r   p r o c e s s e s ,   i n c l u d e   t h e   s e c u r i t y C o n t e x t   f i e l d   ( P o d S e c u r i t y C o n t e x t )   i n   t h e   P o d   s p e c i f i c a t i o n ,   a n d   w i t h i n   i t ,   t h e   w i n d o w s O p t i o n s   ( W i n d o w s S e c u r i t y C o n t e x t O p t i o n s )   f i e l d   c o n t a i n i n g   t h e   r u n A s U s e r N a m e   f i e l d .   T h e   W i n d o w s   s e c u r i t y   c o n t e x t   o p t i o n s   t h a t   y o u   s p e c i f y   f o r   a   P o d   a p p l y   t o   a l l   C o n t a i n e r s   a n d   i n i t   C o n t a i n e r s   i n   t h e   P o d .   H e r e   i s   a   c o n f i g u r a t i o n   f i l e   f o r   a   W i n d o w s   P o d   t h a t   h a s   t h e   r u n A s U s e r N a m e   f i e l d   s e t :   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 :   r u n - a s - u s e r n a m e - p o d - d e m o   s p e c :   s e c u r i t y C o n t e x t :   w i n d o w s O p t i o n s :   r u n A s U s e r N a m e :   " C o n t a i n e r U s e r "   c o n t a i n e r s :   -   n a m e :   r u n - a s - u s e r n a m e - d e m o   i m a g e :   m c r . m i c r o s o f t . c o m / w i n d o w s / s e r v e r c o r e : l t s c 2 0 1 9   c o m m a n d :   [ " p i n g " ,   " - t " ,   " l o c a l h o s t " ]   n o d e S e l e c t o r :   k u b e r n e t e s . i o / o s :   w i n d o w s   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 / w i n d o w s / r u n - a s - u s e r n a m e - p o d . y a m l   V e r i f y   t h a t   t h e   P o d ' s   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   r u n - a s - u s e r n a m e - p o d - 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


Question: What is Set the Username for a Container?

Answer: T o   s p e c i f y   t h e   u s e r n a m e   w i t h   w h i c h   t o   e x e c u t e   a   C o n t a i n e r ' s   p r o c e s s e s ,   i n c l u d e   t h e   s e c u r i t y C o n t e x t   f i e l d   ( S e c u r i t y C o n t e x t )   i n   t h e   C o n t a i n e r   m a n i f e s t ,   a n d   w i t h i n   i t ,   t h e   w i n d o w s O p t i o n s   ( W i n d o w s S e c u r i t y C o n t e x t O p t i o n s )   f i e l d   c o n t a i n i n g   t h e   r u n A s U s e r N a m e   f i e l d .   T h e   W i n d o w s   s e c u r i t y   c o n t e x t   o p t i o n s   t h a t   y o u   s p e c i f y   f o r   a   C o n t a i n e r   a p p l y   o n l y   t o   t h a t   i n d i v i d u a l   C o n t a i n e r ,   a n d   t h e y   o v e r r i d e   t h e   s e t t i n g s   m a d e   a t   t h e   P o d   l e v e l .   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   a   P o d   t h a t   h a s   o n e   C o n t a i n e r ,   a n d   t h e   r u n A s U s e r N a m e   f i e l d   i s   s e t   a t   t h e   P o d   l e v e l   a n d   t h e   C o n t a i n e r   l e v e l :   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 :   r u n - a s - u s e r n a m e - c o n t a i n e r - d e m o   s p e c :   s e c u r i t y C o n t e x t :   w i n d o w s O p t i o n s :   r u n A s U s e r N a m e :   " C o n t a i n e r U s e r "   c o n t a i n e r s :   -   n a m e :   r u n - a s - u s e r n a m e - d e m o   i m a g e :   m c r . m i c r o s o f t . c o m / w i n d o w s / s e r v e r c o r e : l t s c 2 0 1 9   c o m m a n d :   [ " p i n g " ,   " - t " ,   " l o c a l h o s t " ]   s e c u r i t y C o n t e x t :   w i n d o w s O p t i o n s :   r u n A s U s e r N a m e :   " C o n t a i n e r A d m i n i s t r a t o r "   n o d e S e l e c t o r :   k u b e r n e t e s . i o / o s :   w i n d o w s   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


Question: What is Windows Username limitations?

Answer: I n   o r d e r   t o   u s e   t h i s   f e a t u r e ,   t h e   v a l u e   s e t   i n   t h e   r u n A s U s e r N a m e   f i e l d   m u s t   b e   a   v a l i d   u s e r n a m e .   I t   m u s t   h a v e   t h e   f o l l o w i n g   f o r m a t :   D O M A I N \ U S E R ,   w h e r e   D O M A I N \   i s   o p t i o n a l .   W i n d o w s   u s e r   n a m e s   a r e   c a s e   i n s e n s i t i v e .   A d d i t i o n a l l y ,   t h e r e   a r e   s o m e   r e s t r i c t i o n s   r e g a r d i n g   t h e   D O M A I N   a n d   U S E R :   T h e   r u n A s U s e r N a m e   f i e l d   c a n n o t   b e   e m p t y ,   a n d   i t   c a n n o t   c o n t a i n   c o n t r o l   c h a r a c t e r s   ( A S C I I   v a l u e s :   0 x 0 0 - 0 x 1 F ,   0 x 7 F ) T h e   D O M A I N   m u s t   b e   e i t h e r   a   N e t B i o s   n a m e ,   o r   a   D N S   n a m e ,   e a c h   w i t h   t h e i r   o w n   r e s t r i c t i o n s : N e t B i o s   n a m e s :   m a x i m u m   1 5   c h a r a c t e r s ,   c a n n o t   s t a r t   w i t h   .   ( d o t ) ,   a n d   c a n n o t   c o n t a i n   t h e   f o l l o w i n g   c h a r a c t e r s :   \   /   :   *   ?   "   <   >   | D N S   n a m e s :   m a x i m u m   2 5 5   c h a r a c t e r s ,   c o n t a i n s   o n l y   a l p h a n u m e r i c   c h a r a c t e r s ,   d o t s ,   a n d   d a s h e s ,   a n d   i t   c a n n o t   s t a r t   o r   e n d   w i t h   a   .   ( d o t )   o r   -   ( d a s h ) . T h e   U S E R   m u s t   h a v e   a t   m o s t   2 0   c h a r a c t e r s ,   i t   c a n n o t   c o n t a i n   o n l y   d o t s   o r   s p a c e s ,   a n d   i t   c a n n o t   c o n t a i n   t h e   f o l l o w i n g   c h a r a c t e r s :   "   /   \   [   ]   :   ;   |   =   ,   +   *   ?   <   >   @ .   N e t B i o s   n a m e s :   m a x i m u m   1 5   c h a r a c t e r s ,   c a n n o t   s t a r t   w i t h   .   ( d o t ) ,   a n d   c a n n o t


Question: What is What's next?

Answer: G u i d e   f o r   s c h e d u l i n g   W i n d o w s   c o n t a i n e r s   i n   K u b e r n e t e s M a n a g i n g   W o r k l o a d   I d e n t i t y   w i t h   G r o u p   M a n a g e d   S e r v i c e   A c c o u n t s   ( G M S A ) C o n f i g u r e   G M S A   f o r   W i n d o w s   p o d s   a n d   c o n t a i n e r s


Question: What is DaemonSet?

Answer: DaemonSetA DaemonSet defines Pods that provide node-local facilities. These might be fundamental to the operation of your cluster, such as a networking helper tool, or be part of an add-on.A DaemonSet ensures that all (or some) Nodes run a copy of a Pod. As nodes are added to the cluster, Pods are added to them. As nodes are removed from the cluster, those Pods are garbage collected. Deleting a DaemonSet will clean up the Pods it created.Some typical uses of a DaemonSet are:running a cluster storage daemon on every noderunning a logs collection daemon on every noderunning a node monitoring daemon on every nodeIn a simple case, one DaemonSet, covering all nodes, would be used for each type of daemon. A more complex setup might use multiple DaemonSets for a single type of daemon, but with different flags and/or different memory and cpu requests for different hardware types.Writing a DaemonSet SpecCreate a DaemonSetYou can describe a DaemonSet in a YAML file. For example, the daemonset.yaml file below describes a DaemonSet that runs the fluentd-elasticsearch Docker image:controllers/daemonset.yaml apiVersion: apps/v1 kind: DaemonSet metadata: name: fluentd-elasticsearch namespace: kube-system labels: k8s-app: fluentd-logging spec: selector: matchLabels: name: fluentd-elasticsearch template: metadata: labels: name: fluentd-elasticsearch spec: tolerations: # these tolerations are to have the daemonset runnable on control plane nodes # remove them if your control plane nodes should not run pods - key: node-role.kubernetes.io/control-plane operator: Exists effect: NoSchedule - key: node-role.kubernetes.io/master operator: Exists effect: NoSchedule containers: - name: fluentd-elasticsearch image: quay.io/fluentd_elasticsearch/fluentd:v5.0.1 resources: limits: memory: 200Mi requests: cpu: 100m memory: 200Mi volumeMounts: - name: varlog mountPath: /var/log # it may be desirable to set a high priority class to ensure that a DaemonSet Pod # preempts running Pods # priorityClassName: important terminationGracePeriodSeconds: 30 volumes: - name: varlog hostPath: path: /var/log Create a DaemonSet based on the YAML file:kubectl apply -f https://k8s.io/examples/controllers/daemonset.yaml Required FieldsAs with all other Kubernetes config, a DaemonSet needs apiVersion, kind, and metadata fields. For general information about working with config files, see running stateless applications and object management using kubectl.The name of a DaemonSet object must be a valid DNS subdomain name.A DaemonSet also needs a .spec section.Pod TemplateThe .spec.template is one of the required fields in .spec.The .spec.template is a pod template. It has exactly the same schema as a Pod, except it is nested and does not have an apiVersion or kind.In addition to required fields for a Pod, a Pod template in a DaemonSet has to specify appropriate labels (see pod selector).A Pod Template in a DaemonSet must have a RestartPolicy equal to Always, or be unspecified, which defaults to Alway


Question: How does DaemonSet work?

Answer: DaemonSetA DaemonSet defines Pods that provide node-local facilities. These might be fundamental to the operation of your cluster, such as a networking helper tool, or be part of an add-on.A DaemonSet ensures that all (or some) Nodes run a copy of a Pod. As nodes are added to the cluster, Pods are added to them. As nodes are removed from the cluster, those Pods are garbage collected. Deleting a DaemonSet will clean up the Pods it created.Some typical uses of a DaemonSet are:running a cluster storage daemon on every noderunning a logs collection daemon on every noderunning a node monitoring daemon on every nodeIn a simple case, one DaemonSet, covering all nodes, would be used for each type of daemon. A more complex setup might use multiple DaemonSets for a single type of daemon, but with different flags and/or different memory and cpu requests for different hardware types.Writing a DaemonSet SpecCreate a DaemonSetYou can describe a DaemonSet in a YAML file. For example, the daemonset.yaml file below describes a DaemonSet that runs the fluentd-elasticsearch Docker image:controllers/daemonset.yaml apiVersion: apps/v1 kind: DaemonSet metadata: name: fluentd-elasticsearch namespace: kube-system labels: k8s-app: fluentd-logging spec: selector: matchLabels: name: fluentd-elasticsearch template: metadata: labels: name: fluentd-elasticsearch spec: tolerations: # these tolerations are to have the daemonset runnable on control plane nodes # remove them if your control plane nodes should not run pods - key: node-role.kubernetes.io/control-plane operator: Exists effect: NoSchedule - key: node-role.kubernetes.io/master operator: Exists effect: NoSchedule containers: - name: fluentd-elasticsearch image: quay.io/fluentd_elasticsearch/fluentd:v5.0.1 resources: limits: memory: 200Mi requests: cpu: 100m memory: 200Mi volumeMounts: - name: varlog mountPath: /var/log # it may be desirable to set a high priority class to ensure that a DaemonSet Pod # preempts running Pods # priorityClassName: important terminationGracePeriodSeconds: 30 volumes: - name: varlog hostPath: path: /var/log Create a DaemonSet based on the YAML file:kubectl apply -f https://k8s.io/examples/controllers/daemonset.yaml Required FieldsAs with all other Kubernetes config, a DaemonSet needs apiVersion, kind, and metadata fields. For general information about working with config files, see running stateless applications and object management using kubectl.The name of a DaemonSet object must be a valid DNS subdomain name.A DaemonSet also needs a .spec section.Pod TemplateThe .spec.template is one of the required fields in .spec.The .spec.template is a pod template. It has exactly the same schema as a Pod, except it is nested and does not have an apiVersion or kind.In addition to required fields for a Pod, a Pod template in a DaemonSet has to specify appropriate labels (see pod selector).A Pod Template in a DaemonSet must have a RestartPolicy equal to Always, or be unspecified, which defaults to Alway


Question: When would you use DaemonSet?

Answer: DaemonSetA DaemonSet defines Pods that provide node-local facilities. These might be fundamental to the operation of your cluster, such as a networking helper tool, or be part of an add-on.A DaemonSet ensures that all (or some) Nodes run a copy of a Pod. As nodes are added to the cluster, Pods are added to them. As nodes are removed from the cluster, those Pods are garbage collected. Deleting a DaemonSet will clean up the Pods it created.Some typical uses of a DaemonSet are:running a cluster storage daemon on every noderunning a logs collection daemon on every noderunning a node monitoring daemon on every nodeIn a simple case, one DaemonSet, covering all nodes, would be used for each type of daemon. A more complex setup might use multiple DaemonSets for a single type of daemon, but with different flags and/or different memory and cpu requests for different hardware types.Writing a DaemonSet SpecCreate a DaemonSetYou can describe a DaemonSet in a YAML file. For example, the daemonset.yaml file below describes a DaemonSet that runs the fluentd-elasticsearch Docker image:controllers/daemonset.yaml apiVersion: apps/v1 kind: DaemonSet metadata: name: fluentd-elasticsearch namespace: kube-system labels: k8s-app: fluentd-logging spec: selector: matchLabels: name: fluentd-elasticsearch template: metadata: labels: name: fluentd-elasticsearch spec: tolerations: # these tolerations are to have the daemonset runnable on control plane nodes # remove them if your control plane nodes should not run pods - key: node-role.kubernetes.io/control-plane operator: Exists effect: NoSchedule - key: node-role.kubernetes.io/master operator: Exists effect: NoSchedule containers: - name: fluentd-elasticsearch image: quay.io/fluentd_elasticsearch/fluentd:v5.0.1 resources: limits: memory: 200Mi requests: cpu: 100m memory: 200Mi volumeMounts: - name: varlog mountPath: /var/log # it may be desirable to set a high priority class to ensure that a DaemonSet Pod # preempts running Pods # priorityClassName: important terminationGracePeriodSeconds: 30 volumes: - name: varlog hostPath: path: /var/log Create a DaemonSet based on the YAML file:kubectl apply -f https://k8s.io/examples/controllers/daemonset.yaml Required FieldsAs with all other Kubernetes config, a DaemonSet needs apiVersion, kind, and metadata fields. For general information about working with config files, see running stateless applications and object management using kubectl.The name of a DaemonSet object must be a valid DNS subdomain name.A DaemonSet also needs a .spec section.Pod TemplateThe .spec.template is one of the required fields in .spec.The .spec.template is a pod template. It has exactly the same schema as a Pod, except it is nested and does not have an apiVersion or kind.In addition to required fields for a Pod, a Pod template in a DaemonSet has to specify appropriate labels (see pod selector).A Pod Template in a DaemonSet must have a RestartPolicy equal to Always, or be unspecified, which defaults to Alway


Question: What are the benefits of DaemonSet?

Answer: DaemonSetA DaemonSet defines Pods that provide node-local facilities. These might be fundamental to the operation of your cluster, such as a networking helper tool, or be part of an add-on.A DaemonSet ensures that all (or some) Nodes run a copy of a Pod. As nodes are added to the cluster, Pods are added to them. As nodes are removed from the cluster, those Pods are garbage collected. Deleting a DaemonSet will clean up the Pods it created.Some typical uses of a DaemonSet are:running a cluster storage daemon on every noderunning a logs collection daemon on every noderunning a node monitoring daemon on every nodeIn a simple case, one DaemonSet, covering all nodes, would be used for each type of daemon. A more complex setup might use multiple DaemonSets for a single type of daemon, but with different flags and/or different memory and cpu requests for different hardware types.Writing a DaemonSet SpecCreate a DaemonSetYou can describe a DaemonSet in a YAML file. For example, the daemonset.yaml file below describes a DaemonSet that runs the fluentd-elasticsearch Docker image:controllers/daemonset.yaml apiVersion: apps/v1 kind: DaemonSet metadata: name: fluentd-elasticsearch namespace: kube-system labels: k8s-app: fluentd-logging spec: selector: matchLabels: name: fluentd-elasticsearch template: metadata: labels: name: fluentd-elasticsearch spec: tolerations: # these tolerations are to have the daemonset runnable on control plane nodes # remove them if your control plane nodes should not run pods - key: node-role.kubernetes.io/control-plane operator: Exists effect: NoSchedule - key: node-role.kubernetes.io/master operator: Exists effect: NoSchedule containers: - name: fluentd-elasticsearch image: quay.io/fluentd_elasticsearch/fluentd:v5.0.1 resources: limits: memory: 200Mi requests: cpu: 100m memory: 200Mi volumeMounts: - name: varlog mountPath: /var/log # it may be desirable to set a high priority class to ensure that a DaemonSet Pod # preempts running Pods # priorityClassName: important terminationGracePeriodSeconds: 30 volumes: - name: varlog hostPath: path: /var/log Create a DaemonSet based on the YAML file:kubectl apply -f https://k8s.io/examples/controllers/daemonset.yaml Required FieldsAs with all other Kubernetes config, a DaemonSet needs apiVersion, kind, and metadata fields. For general information about working with config files, see running stateless applications and object management using kubectl.The name of a DaemonSet object must be a valid DNS subdomain name.A DaemonSet also needs a .spec section.Pod TemplateThe .spec.template is one of the required fields in .spec.The .spec.template is a pod template. It has exactly the same schema as a Pod, except it is nested and does not have an apiVersion or kind.In addition to required fields for a Pod, a Pod template in a DaemonSet has to specify appropriate labels (see pod selector).A Pod Template in a DaemonSet must have a RestartPolicy equal to Always, or be unspecified, which defaults to Alway


Question: What is DaemonSet?

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


Question: What is Create a DaemonSet?

Answer: Y o u   c a n   d e s c r i b e   a   D a e m o n S e t   i n   a   Y A M L   f i l e .   F o r   e x a m p l e ,   t h e   d a e m o n s e t . y a m l   f i l e   b e l o w   d e s c r i b e s   a   D a e m o n S e t   t h a t   r u n s   t h e   f l u e n t d - e l a s t i c s e a r c h   D o c k e r   i m a g e :   a p i V e r s i o n :   a p p s / v 1   k i n d :   D a e m o n S e t   m e t a d a t a :   n a m e :   f l u e n t d - e l a s t i c s e a r c h   n a m e s p a c e :   k u b e - s y s t e m   l a b e l s :   k 8 s - a p p :   f l u e n t d - l o g g i n g   s p e c :   s e l e c t o r :   m a t c h L a b e l s :   n a m e :   f l u e n t d - e l a s t i c s e a r c h   t e m p l a t e :   m e t a d a t a :   l a b e l s :   n a m e :   f l u e n t d - e l a s t i c s e a r c h   s p e c :   t o l e r a t i o n s :   #   t h e s e   t o l e r a t i o n s   a r e   t o   h a v e   t h e   d a e m o n s e t   r u n n a b l e   o n   c o n t r o l   p l a n e   n o d e s   #   r e m o v e   t h e m   i f   y o u r   c o n t r o l   p l a n e   n o d e s   s h o u l d   n o t   r u n   p o d s   -   k e y :   n o d e - r o l e . k u b e r n e t e s . i o / c o n t r o l - p l a n e   o p e r a t o r :   E x i s t s   e f f e c t :   N o S c h e d u l e   -   k e y :   n o d e - r o l e . k u b e r n e t e s . i o / m a s t e r   o p e r a t o r :   E x i s t s   e f f e c t :   N o S c h e d u l e   c o n t a i n e r s :   -   n a m e :   f l u e n t d - e l a s t i c s e a r c h   i m a g e :   q u a y . i o / f l u e n t d _ e l a s t i c s e a r c h / f l u e n t d : v 5 . 0 . 1   r e s o u r c e s :   l i m i t s :   m e m o r y :   2 0 0 M i   r e q u e s t s :   c p u :   1 0 0 m   m e m o r y :   2 0 0 M i   v o l u m e M o u n t s :   -   n a m e :   v a r l o g   m o u n t P a t h :   / v a r / l o g   #   i t   m a y   b e   d e s i r a b l e   t o   s e t   a   h i g h   p r i o r i t y   c l a s s   t o   e n s u r e   t h a t   a   D a e m o


Question: What is Required Fields?

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


Question: What is Pod Template?

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


Question: What is Pod Selector?

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


Question: What is Running Pods on select Nodes?

Answer: I f   y o u   s p e c i f y   a   . s p e c . t e m p l a t e . s p e c . n o d e S e l e c t o r ,   t h e n   t h e   D a e m o n S e t   c o n t r o l l e r   w i l l   c r e a t e   P o d s   o n   n o d e s   w h i c h   m a t c h   t h a t   n o d e   s e l e c t o r .   L i k e w i s e   i f   y o u   s p e c i f y   a   . s p e c . t e m p l a t e . s p e c . a f f i n i t y ,   t h e n   D a e m o n S e t   c o n t r o l l e r   w i l l   c r e a t e   P o d s   o n   n o d e s   w h i c h   m a t c h   t h a t   n o d e   a f f i n i t y .   I f   y o u   d o   n o t   s p e c i f y   e i t h e r ,   t h e n   t h e   D a e m o n S e t   c o n t r o l l e r   w i l l   c r e a t e   P o d s   o n   a l l   n o d e s .


Question: What is How Daemon Pods are scheduled?

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


Question: What is Note:?

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


Question: What is Taints and tolerations?

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


Question: What is Communicating with Daemon Pods?

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


Question: What is Updating a DaemonSet?

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


Question: What is Init scripts?

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


Question: What is Bare Pods?

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


Question: What is Static Pods?

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


Question: What is Deployments?

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


Question: What is What's next?

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


Question: What is Configure a Pod to Use a PersistentVolume for Storage?

Answer: Configure a Pod to Use a PersistentVolume for StorageThis page shows you how to configure a Pod to use a PersistentVolumeClaim for storage. Here is a summary of the process:You, as cluster administrator, create a PersistentVolume backed by physical storage. You do not associate the volume with any Pod.You, now taking the role of a developer / cluster user, create a PersistentVolumeClaim that is automatically bound to a suitable PersistentVolume.You create a Pod that uses the above PersistentVolumeClaim for storage.Before you beginYou need to have a Kubernetes cluster that has only one Node, and the kubectl command-line tool must be configured to communicate with your cluster. If you do not already have a single-node cluster, you can create one by using Minikube.Familiarize yourself with the material in Persistent Volumes.Create an index.html file on your NodeOpen a shell to the single Node in your cluster. How you open a shell depends on how you set up your cluster. For example, if you are using Minikube, you can open a shell to your Node by entering minikube ssh.In your shell on that Node, create a /mnt/data directory:# This assumes that your Node uses "sudo" to run commands # as the superuser sudo mkdir /mnt/data In the /mnt/data directory, create an index.html file:# This again assumes that your Node uses "sudo" to run commands # as the superuser sudo sh -c "echo 'Hello from Kubernetes storage' > /mnt/data/index.html" Note:If your Node uses a tool for superuser access other than sudo, you can usually make this work if you replace sudo with the name of the other tool.Test that the index.html file exists:cat /mnt/data/index.html The output should be:Hello from Kubernetes storage You can now close the shell to your Node.Create a PersistentVolumeIn this exercise, you create a hostPath PersistentVolume. Kubernetes supports hostPath for development and testing on a single-node cluster. A hostPath PersistentVolume uses a file or directory on the Node to emulate network-attached storage.In a production cluster, you would not use hostPath. Instead a cluster administrator would provision a network resource like a Google Compute Engine persistent disk, an NFS share, or an Amazon Elastic Block Store volume. Cluster administrators can also use StorageClasses to set up dynamic provisioning.Here is the configuration file for the hostPath PersistentVolume:pods/storage/pv-volume.yaml apiVersion: v1 kind: PersistentVolume metadata: name: task-pv-volume labels: type: local spec: storageClassName: manual capacity: storage: 10Gi accessModes: - ReadWriteOnce hostPath: path: "/mnt/data" The configuration file specifies that the volume is at /mnt/data on the cluster's Node. The configuration also specifies a size of 10 gibibytes and an access mode of ReadWriteOnce, which means the volume can be mounted as read-write by a single Node. It defines the StorageClass name manual for the PersistentVolume, which will be used to bind PersistentVolumeClaim requests to this Per


Question: How does Configure a Pod to Use a PersistentVolume for Storage work?

Answer: Configure a Pod to Use a PersistentVolume for StorageThis page shows you how to configure a Pod to use a PersistentVolumeClaim for storage. Here is a summary of the process:You, as cluster administrator, create a PersistentVolume backed by physical storage. You do not associate the volume with any Pod.You, now taking the role of a developer / cluster user, create a PersistentVolumeClaim that is automatically bound to a suitable PersistentVolume.You create a Pod that uses the above PersistentVolumeClaim for storage.Before you beginYou need to have a Kubernetes cluster that has only one Node, and the kubectl command-line tool must be configured to communicate with your cluster. If you do not already have a single-node cluster, you can create one by using Minikube.Familiarize yourself with the material in Persistent Volumes.Create an index.html file on your NodeOpen a shell to the single Node in your cluster. How you open a shell depends on how you set up your cluster. For example, if you are using Minikube, you can open a shell to your Node by entering minikube ssh.In your shell on that Node, create a /mnt/data directory:# This assumes that your Node uses "sudo" to run commands # as the superuser sudo mkdir /mnt/data In the /mnt/data directory, create an index.html file:# This again assumes that your Node uses "sudo" to run commands # as the superuser sudo sh -c "echo 'Hello from Kubernetes storage' > /mnt/data/index.html" Note:If your Node uses a tool for superuser access other than sudo, you can usually make this work if you replace sudo with the name of the other tool.Test that the index.html file exists:cat /mnt/data/index.html The output should be:Hello from Kubernetes storage You can now close the shell to your Node.Create a PersistentVolumeIn this exercise, you create a hostPath PersistentVolume. Kubernetes supports hostPath for development and testing on a single-node cluster. A hostPath PersistentVolume uses a file or directory on the Node to emulate network-attached storage.In a production cluster, you would not use hostPath. Instead a cluster administrator would provision a network resource like a Google Compute Engine persistent disk, an NFS share, or an Amazon Elastic Block Store volume. Cluster administrators can also use StorageClasses to set up dynamic provisioning.Here is the configuration file for the hostPath PersistentVolume:pods/storage/pv-volume.yaml apiVersion: v1 kind: PersistentVolume metadata: name: task-pv-volume labels: type: local spec: storageClassName: manual capacity: storage: 10Gi accessModes: - ReadWriteOnce hostPath: path: "/mnt/data" The configuration file specifies that the volume is at /mnt/data on the cluster's Node. The configuration also specifies a size of 10 gibibytes and an access mode of ReadWriteOnce, which means the volume can be mounted as read-write by a single Node. It defines the StorageClass name manual for the PersistentVolume, which will be used to bind PersistentVolumeClaim requests to this Per


Question: When would you use Configure a Pod to Use a PersistentVolume for Storage?

Answer: Configure a Pod to Use a PersistentVolume for StorageThis page shows you how to configure a Pod to use a PersistentVolumeClaim for storage. Here is a summary of the process:You, as cluster administrator, create a PersistentVolume backed by physical storage. You do not associate the volume with any Pod.You, now taking the role of a developer / cluster user, create a PersistentVolumeClaim that is automatically bound to a suitable PersistentVolume.You create a Pod that uses the above PersistentVolumeClaim for storage.Before you beginYou need to have a Kubernetes cluster that has only one Node, and the kubectl command-line tool must be configured to communicate with your cluster. If you do not already have a single-node cluster, you can create one by using Minikube.Familiarize yourself with the material in Persistent Volumes.Create an index.html file on your NodeOpen a shell to the single Node in your cluster. How you open a shell depends on how you set up your cluster. For example, if you are using Minikube, you can open a shell to your Node by entering minikube ssh.In your shell on that Node, create a /mnt/data directory:# This assumes that your Node uses "sudo" to run commands # as the superuser sudo mkdir /mnt/data In the /mnt/data directory, create an index.html file:# This again assumes that your Node uses "sudo" to run commands # as the superuser sudo sh -c "echo 'Hello from Kubernetes storage' > /mnt/data/index.html" Note:If your Node uses a tool for superuser access other than sudo, you can usually make this work if you replace sudo with the name of the other tool.Test that the index.html file exists:cat /mnt/data/index.html The output should be:Hello from Kubernetes storage You can now close the shell to your Node.Create a PersistentVolumeIn this exercise, you create a hostPath PersistentVolume. Kubernetes supports hostPath for development and testing on a single-node cluster. A hostPath PersistentVolume uses a file or directory on the Node to emulate network-attached storage.In a production cluster, you would not use hostPath. Instead a cluster administrator would provision a network resource like a Google Compute Engine persistent disk, an NFS share, or an Amazon Elastic Block Store volume. Cluster administrators can also use StorageClasses to set up dynamic provisioning.Here is the configuration file for the hostPath PersistentVolume:pods/storage/pv-volume.yaml apiVersion: v1 kind: PersistentVolume metadata: name: task-pv-volume labels: type: local spec: storageClassName: manual capacity: storage: 10Gi accessModes: - ReadWriteOnce hostPath: path: "/mnt/data" The configuration file specifies that the volume is at /mnt/data on the cluster's Node. The configuration also specifies a size of 10 gibibytes and an access mode of ReadWriteOnce, which means the volume can be mounted as read-write by a single Node. It defines the StorageClass name manual for the PersistentVolume, which will be used to bind PersistentVolumeClaim requests to this Per


Question: What are the benefits of Configure a Pod to Use a PersistentVolume for Storage?

Answer: Configure a Pod to Use a PersistentVolume for StorageThis page shows you how to configure a Pod to use a PersistentVolumeClaim for storage. Here is a summary of the process:You, as cluster administrator, create a PersistentVolume backed by physical storage. You do not associate the volume with any Pod.You, now taking the role of a developer / cluster user, create a PersistentVolumeClaim that is automatically bound to a suitable PersistentVolume.You create a Pod that uses the above PersistentVolumeClaim for storage.Before you beginYou need to have a Kubernetes cluster that has only one Node, and the kubectl command-line tool must be configured to communicate with your cluster. If you do not already have a single-node cluster, you can create one by using Minikube.Familiarize yourself with the material in Persistent Volumes.Create an index.html file on your NodeOpen a shell to the single Node in your cluster. How you open a shell depends on how you set up your cluster. For example, if you are using Minikube, you can open a shell to your Node by entering minikube ssh.In your shell on that Node, create a /mnt/data directory:# This assumes that your Node uses "sudo" to run commands # as the superuser sudo mkdir /mnt/data In the /mnt/data directory, create an index.html file:# This again assumes that your Node uses "sudo" to run commands # as the superuser sudo sh -c "echo 'Hello from Kubernetes storage' > /mnt/data/index.html" Note:If your Node uses a tool for superuser access other than sudo, you can usually make this work if you replace sudo with the name of the other tool.Test that the index.html file exists:cat /mnt/data/index.html The output should be:Hello from Kubernetes storage You can now close the shell to your Node.Create a PersistentVolumeIn this exercise, you create a hostPath PersistentVolume. Kubernetes supports hostPath for development and testing on a single-node cluster. A hostPath PersistentVolume uses a file or directory on the Node to emulate network-attached storage.In a production cluster, you would not use hostPath. Instead a cluster administrator would provision a network resource like a Google Compute Engine persistent disk, an NFS share, or an Amazon Elastic Block Store volume. Cluster administrators can also use StorageClasses to set up dynamic provisioning.Here is the configuration file for the hostPath PersistentVolume:pods/storage/pv-volume.yaml apiVersion: v1 kind: PersistentVolume metadata: name: task-pv-volume labels: type: local spec: storageClassName: manual capacity: storage: 10Gi accessModes: - ReadWriteOnce hostPath: path: "/mnt/data" The configuration file specifies that the volume is at /mnt/data on the cluster's Node. The configuration also specifies a size of 10 gibibytes and an access mode of ReadWriteOnce, which means the volume can be mounted as read-write by a single Node. It defines the StorageClass name manual for the PersistentVolume, which will be used to bind PersistentVolumeClaim requests to this Per


Question: What is Configure a Pod to Use a PersistentVolume for Storage?

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


Question: What is Before you begin?

Answer: Y o u   n e e d   t o   h a v e   a   K u b e r n e t e s   c l u s t e r   t h a t   h a s   o n l y   o n e   N o d e ,   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 f   y o u   d o   n o t   a l r e a d y   h a v e   a   s i n g l e - n o d e   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 . F a m i l i a r i z e   y o u r s e l f   w i t h   t h e   m a t e r i a l   i n   P e r s i s t e n t   V o l u m e s .   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   t h a t   h a s   o n l y   o n e   N o d e ,   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 f   y o u   d o   n o t   a l r e a d y   h a v e   a   s i n g l e - n o d e   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 .   F a m i l i a r i z e   y o u r s e l f   w i t h   t h e   m a t e r i a l   i n   P e r s i s t e n t   V o l u m e s .


Question: What is Create an index.html file on your Node?

Answer: O p e n   a   s h e l l   t o   t h e   s i n g l e   N o d e   i n   y o u r   c l u s t e r .   H o w   y o u   o p e n   a   s h e l l   d e p e n d s   o n   h o w   y o u   s e t   u p   y o u r   c l u s t e r .   F o r   e x a m p l e ,   i f   y o u   a r e   u s i n g   M i n i k u b e ,   y o u   c a n   o p e n   a   s h e l l   t o   y o u r   N o d e   b y   e n t e r i n g   m i n i k u b e   s s h .   I n   y o u r   s h e l l   o n   t h a t   N o d e ,   c r e a t e   a   / m n t / d a t a   d i r e c t o r y :   #   T h i s   a s s u m e s   t h a t   y o u r   N o d e   u s e s   " s u d o "   t o   r u n   c o m m a n d s   #   a s   t h e   s u p e r u s e r   s u d o   m k d i r   / m n t / d a t a   I n   t h e   / m n t / d a t a   d i r e c t o r y ,   c r e a t e   a n   i n d e x . h t m l   f i l e :   #   T h i s   a g a i n   a s s u m e s   t h a t   y o u r   N o d e   u s e s   " s u d o "   t o   r u n   c o m m a n d s   #   a s   t h e   s u p e r u s e r   s u d o   s h   - c   " e c h o   ' H e l l o   f r o m   K u b e r n e t e s   s t o r a g e '   >   / m n t / d a t a / i n d e x . h t m l "


Question: What is Note:?

Answer: T e s t   t h a t   t h e   i n d e x . h t m l   f i l e   e x i s t s :   c a t   / m n t / d a t a / i n d e x . h t m l   T h e   o u t p u t   s h o u l d   b e :   H e l l o   f r o m   K u b e r n e t e s   s t o r a g e   Y o u   c a n   n o w   c l o s e   t h e   s h e l l   t o   y o u r   N o d e .


Question: What is Create a PersistentVolume?

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   h o s t P a t h   P e r s i s t e n t V o l u m e .   K u b e r n e t e s   s u p p o r t s   h o s t P a t h   f o r   d e v e l o p m e n t   a n d   t e s t i n g   o n   a   s i n g l e - n o d e   c l u s t e r .   A   h o s t P a t h   P e r s i s t e n t V o l u m e   u s e s   a   f i l e   o r   d i r e c t o r y   o n   t h e   N o d e   t o   e m u l a t e   n e t w o r k - a t t a c h e d   s t o r a g e .   I n   a   p r o d u c t i o n   c l u s t e r ,   y o u   w o u l d   n o t   u s e   h o s t P a t h .   I n s t e a d   a   c l u s t e r   a d m i n i s t r a t o r   w o u l d   p r o v i s i o n   a   n e t w o r k   r e s o u r c e   l i k e   a   G o o g l e   C o m p u t e   E n g i n e   p e r s i s t e n t   d i s k ,   a n   N F S   s h a r e ,   o r   a n   A m a z o n   E l a s t i c   B l o c k   S t o r e   v o l u m e .   C l u s t e r   a d m i n i s t r a t o r s   c a n   a l s o   u s e   S t o r a g e C l a s s e s   t o   s e t   u p   d y n a m i c   p r o v i s i o n i n g .   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   h o s t P a t h   P e r s i s t e n t V o l u m e :   a p i V e r s i o n :   v 1   k i n d :   P e r s i s t e n t V o l u m e   m e t a d a t a :   n a m e :   t a s k - p v - v o l u m e   l a b e l s :   t y p e :   l o c a l   s p e c :   s t o r a g e C l a s s N a m e :   m a n u a l   c a p a c i t y :   s t o r a g e :   1 0 G i   a c c e s s M o d e s :   -   R e a d W r i t e O n c e   h o s t P a t h :   p a t h :   " / m n t / d a t a "   T h e   c o n f i g u r a t i o n   f i l e   s p e c i f i e s   t h a t   t h e   v o l u m e   i s   a t   / m n t / d a t a   o n   t h e   c l u s t e r ' s   N o d e .   T h e   c o n f i g u r a t i o n   a l s o   s p e c i f i e s   a   s i z e   o f   1 0   g i b i b y t e s   a n d   a n   a c c e s s   m o d e   o f   R e a d W r i t e O n c e ,   w h i c h


Question: What is Note:?

Answer: C r e a t e   t h e   P e r s i s t e n t V o l u m 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 / p o d s / s t o r a g e / p v - v o l u m e . y a m l   V i e w   i n f o r m a t i o n   a b o u t   t h e   P e r s i s t e n t V o l u m e :   k u b e c t l   g e t   p v   t a s k - p v - v o l u m e   T h e   o u t p u t   s h o w s   t h a t   t h e   P e r s i s t e n t V o l u m e   h a s   a   S T A T U S   o f   A v a i l a b l e .   T h i s   m e a n s   i t   h a s   n o t   y e t   b e e n   b o u n d   t o   a   P e r s i s t e n t V o l u m e C l a i m .   N A M E   C A P A C I T Y   A C C E S S M O D E S   R E C L A I M P O L I C Y   S T A T U S   C L A I M   S T O R A G E C L A S S   R E A S O N   A G E   t a s k - p v - v o l u m e   1 0 G i   R W O   R e t a i n   A v a i l a b l e   m a n u a l   4 s


Question: What is Create a PersistentVolumeClaim?

Answer: T h e   n e x t   s t e p   i s   t o   c r e a t e   a   P e r s i s t e n t V o l u m e C l a i m .   P o d s   u s e   P e r s i s t e n t V o l u m e C l a i m s   t o   r e q u e s t   p h y s i c a l   s t o r a g e .   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 e r s i s t e n t V o l u m e C l a i m   t h a t   r e q u e s t s   a   v o l u m e   o f   a t   l e a s t   t h r e e   g i b i b y t e s   t h a t   c a n   p r o v i d e   r e a d - w r i t e   a c c e s s   f o r   a t   m o s t   o n e   N o d e   a t   a   t i m 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 e r s i s t e n t V o l u m e C l a i m :   a p i V e r s i o n :   v 1   k i n d :   P e r s i s t e n t V o l u m e C l a i m   m e t a d a t a :   n a m e :   t a s k - p v - c l a i m   s p e c :   s t o r a g e C l a s s N a m e :   m a n u a l   a c c e s s M o d e s :   -   R e a d W r i t e O n c e   r e s o u r c e s :   r e q u e s t s :   s t o r a g e :   3 G i   C r e a t e   t h e   P e r s i s t e n t V o l u m e C l a i m :   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 / p o d s / s t o r a g e / p v - c l a i m . y a m l   A f t e r   y o u   c r e a t e   t h e   P e r s i s t e n t V o l u m e C l a i m ,   t h e   K u b e r n e t e s   c o n t r o l   p l a n e   l o o k s   f o r   a   P e r s i s t e n t V o l u m e   t h a t   s a t i s f i e s   t h e   c l a i m ' s   r e q u i r e m e n t s .   I f   t h e   c o n t r o l   p l a n e   f i n d s   a   s u i t a b l e   P e r s i s t e n t V o l u m e   w i t h   t h e   s a m e   S t o r a g e C l a s s ,   i t   b i n d s   t h e   c l a i m   t o   t h e   v o l u m e .   L o o k   a g a i n   a t   t h e   P e r s i s t e n t V o l u m e :   k u b e c t l   g e t   p v   t a s k - p v - v o l u m e   N o w   t h e   o u t p u t   s h o w s   a   S T A T U S   o f   B o u n d .   N A M E   C A P A C I T Y   A C C E S


Question: What is Create a Pod?

Answer: T h e


Question: What is Clean up?

Answer: D e l e t e   t h e   P o d :   k u b e c t l   d e l e t e   p o d   t a s k - p v - p o d


Question: What is Mounting the same PersistentVolume in two places?

Answer: Y o u   h a v e   u n d e r s t o o d   h o w   t o   c r e a t e   a   P e r s i s t e n t V o l u m e   &   P e r s i s t e n t V o l u m e C l a i m ,   a n d   h o w   t o   m o u n t   t h e   v o l u m e   t o   a   s i n g l e   l o c a t i o n   i n   a   c o n t a i n e r .   L e t ' s   e x p l o r e   h o w   y o u   c a n   m o u n t   t h e   s a m e   P e r s i s t e n t V o l u m e   a t   t w o   d i f f e r e n t   l o c a t i o n s   i n   a   c o n t a i n e r .   B e l o w   i s   a n   e x a m p l e :   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 :   t e s t   s p e c :   c o n t a i n e r s :   -   n a m e :   t e s t   i m a g e :   n g i n x   v o l u m e M o u n t s :   #   a   m o u n t   f o r   s i t e - d a t a   -   n a m e :   c o n f i g   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   s u b P a t h :   h t m l   #   a n o t h e r   m o u n t   f o r   n g i n x   c o n f i g   -   n a m e :   c o n f i g   m o u n t P a t h :   / e t c / n g i n x / n g i n x . c o n f   s u b P a t h :   n g i n x . c o n f   v o l u m e s :   -   n a m e :   c o n f i g   p e r s i s t e n t V o l u m e C l a i m :   c l a i m N a m e :   t a s k - p v - s t o r a g e   H e r e :   s u b P a t h :   T h i s   f i e l d   a l l o w s   s p e c i f i c   f i l e s   o r   d i r e c t o r i e s   f r o m   t h e   m o u n t e d   P e r s i s t e n t V o l u m e   t o   b e   e x p o s e d   a t   d i f f e r e n t   l o c a t i o n s   w i t h i n   t h e   c o n t a i n e r .   I n   t h i s   e x a m p l e : s u b P a t h :   h t m l   m o u n t s   t h e   h t m l   d i r e c t o r y . s u b P a t h :   n g i n x . c o n f   m o u n t s   a   s p e c i f i c   f i l e ,   n g i n x . c o n f .   s u b P a t h :   h t m l   m o u n t s   t h e   h t m l   d i r e c t o r y . s u b P a t h :   n g i n x . c o n f   m o u n t s   a   s p e c i f i c   f i l e ,   n g i n x . c o n f .   S i n c e


Question: What is Move the index.html file on your Node to a new folder?

Answer: T h e   i n d e x . h t m l   f i l e   m e n t i o n e d   h e r e   r e f e r s   t o   t h e   o n e   c r e a t e d   i n   t h e   " C r e a t e   a n   i n d e x . h t m l   f i l e   o n   y o u r   N o d e "   s e c t i o n .   O p e n   a   s h e l l   t o   t h e   s i n g l e   N o d e   i n   y o u r   c l u s t e r .   H o w   y o u   o p e n   a   s h e l l   d e p e n d s   o n   h o w   y o u   s e t   u p   y o u r   c l u s t e r .   F o r   e x a m p l e ,   i f   y o u   a r e   u s i n g   M i n i k u b e ,   y o u   c a n   o p e n   a   s h e l l   t o   y o u r   N o d e   b y   e n t e r i n g   m i n i k u b e   s s h .   C r e a t e   a   / m n t / d a t a / h t m l   d i r e c t o r y :   #   T h i s   a s s u m e s   t h a t   y o u r   N o d e   u s e s   " s u d o "   t o   r u n   c o m m a n d s   #   a s   t h e   s u p e r u s e r   s u d o   m k d i r   / m n t / d a t a / h t m l   M o v e   i n d e x . h t m l   i n t o   t h e   d i r e c t o r y :   #   M o v e   i n d e x . h t m l   f r o m   i t s   c u r r e n t   l o c a t i o n   t o   t h e   h t m l   s u b - d i r e c t o r y   s u d o   m v   / m n t / d a t a / i n d e x . h t m l   h t m l


Question: What is Create a new nginx.conf file?

Answer: u s e r   n g i n x ;   w o r k e r _ p r o c e s s e s   a u t o ;   e r r o r _ l o g   / v a r / l o g / n g i n x / e r r o r . l o g   n o t i c e ;   p i d   / v a r / r u n / n g i n x . p i d ;   e v e n t s   {   w o r k e r _ c o n n e c t i o n s   1 0 2 4 ;   }   h t t p   {   i n c l u d e   / e t c / n g i n x / m i m e . t y p e s ;   d e f a u l t _ t y p e   a p p l i c a t i o n / o c t e t - s t r e a m ;   l o g _ f o r m a t   m a i n   & # 3 9 ; $ r e m o t e _ a d d r   -   $ r e m o t e _ u s e r   [ $ t i m e _ l o c a l ]   & # 3 4 ; $ r e q u e s t & # 3 4 ;   & # 3 9 ;   & # 3 9 ; $ s t a t u s   $ b o d y _ b y t e s _ s e n t   & # 3 4 ; $ h t t p _ r e f e r e r & # 3 4 ;   & # 3 9 ;   & # 3 9 ; & # 3 4 ; $ h t t p _ u s e r _ a g e n t & # 3 4 ;   & # 3 4 ; $ h t t p _ x _ f o r w a r d e d _ f o r & # 3 4 ; & # 3 9 ; ;   a c c e s s _ l o g   / v a r / l o g / n g i n x / a c c e s s . l o g   m a i n ;   s e n d f i l e   o n ;   # t c p _ n o p u s h   o n ;   k e e p a l i v e _ t i m e o u t   6 0 ;   # g z i p   o n ;   i n c l u d e   / e t c / n g i n x / c o n f . d / * . c o n f ;   }   e r r o r _ l o g   / v a r / l o g / n g i n x / e r r o r . l o g   n o t i c e ;   p i d   / v a r / r u n / n g i n x . p i d ;   e v e n t s   {   w o r k e r _ c o n n e c t i o n s   1 0 2 4 ;   }   h t t p   {   i n c l u d e   / e t c / n g i n x / m i m e . t y p e s ;   d e f a u l t _ t y p e   a p p l i c a t i o n / o c t e t - s t r e a m ;   l o g _ f o r m a t   m a i n   & # 3 9 ; $ r e m o t e _ a d d r   -   $ r e m o t e _ u s e r   [ $ t i m e _ l o c a l ]   & # 3 4 ; $ r e q u e s t & # 3 4 ;   & # 3 9 ;   & # 3 9 ; $ s t a t u s   $ b o d y _ b y t e s _ s e n t   & # 3 4 ; $ h t t p _ r e f e r e r & # 3 4 ;   & # 3 9 ;   & # 3 9 ; & # 3 4 ; $ h t t p _ u s e r _ a g e n t & # 3 4 ;   & # 3 4 ; $ h t t p _ x _ f o r w a r d e d _ f o r & # 3 4 ; & # 3 9 ; ;   a c c e s s _ l o g   / v a r / l o g / n g i n x / a c c


Question: What is Create a Pod?

Answer: H e r e   w e   w i l l   c r e a t e   a   p o d   t h a t   u s e s   t h e   e x i s t i n g   p e r s i s t e n t V o l u m e   a n d   p e r s i s t e n t V o l u m e C l a i m .   H o w e v e r ,   t h e   p o d   m o u n t s   o n l y   a   s p e c i f i c   f i l e ,   n g i n x . c o n f ,   a n d   d i r e c t o r y ,   h t m l ,   t o   t h e   c o n t a i n e r .   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 / p o d s / s t o r a g e / p v - d u p l i c a t e . 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 n   t h e   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   t e s t   G e t   a   s h e l l   t o   t h e   c o n t a i n e r   r u n n i n g   i n   y o u r   P o d :   k u b e c t l   e x e c   - i t   t e s t   - -   / b i n / b a s h   I n   y o u r   s h e l l ,   v e r i f y   t h a t   n g i n x   i s   s e r v i n g   t h e   i n d e x . h t m l   f i l e   f r o m   t h e   h o s t P a t h   v o l u m e :   #   B e   s u r e   t o   r u n   t h e s e   3   c o m m a n d s   i n s i d e   t h e   r o o t   s h e l l   t h a t   c o m e s   f r o m   #   r u n n i n g   " k u b e c t l   e x e c "   i n   t h e   p r e v i o u s   s t e p   a p t   u p d a t e   a p 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   o n   t h e   h o s t P a t h   v o l u m e :   H e l l o   f r o m   K u b e r n e t e s   s t o r a g e   I n   y o u r   s h e l l ,   a l s o   v e r i f y   t h a t   n g i n x   i s   s e r v i n g   t h e   n g i n x . c o n f   f i l e   f r o m   t h e   h o s t P a t h   v o l u m e :   #   B e   s u r e   t o   r u n   t h e s e   c o m m a n d s   i n s i d e   t h e   r o o t   s h e l l   t h a t   c o m e s   f r o m   #   r u n n i n g   " k u b e c t l   e x e c "


Question: What is Clean up?

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


Question: What is Access control?

Answer: S t o r a g e   c o n f i g u r e d   w i t h   a   g r o u p   I D   ( G I D )   a l l o w s   w r i t i n g   o n l y   b y   P o d s   u s i n g   t h e   s a m e   G I D .   M i s m a t c h e d   o r   m i s s i n g   G I D s   c a u s e   p e r m i s s i o n   d e n i e d   e r r o r s .   T o   r e d u c e   t h e   n e e d   f o r   c o o r d i n a t i o n   w i t h   u s e r s ,   a n   a d m i n i s t r a t o r   c a n   a n n o t a t e   a   P e r s i s t e n t V o l u m e   w i t h   a   G I D .   T h e n   t h e   G I D   i s   a u t o m a t i c a l l y   a d d e d   t o   a n y   P o d   t h a t   u s e s   t h e   P e r s i s t e n t V o l u m e .   U s e   t h e   p v . b e t a . k u b e r n e t e s . i o / g i d   a n n o t a t i o n   a s   f o l l o w s :   a p i V e r s i o n :   v 1   k i n d :   P e r s i s t e n t V o l u m e   m e t a d a t a :   n a m e :   p v 1   a n n o t a t i o n s :   p v . b e t a . k u b e r n e t e s . i o / g i d :   " 1 2 3 4 "   W h e n   a   P o d   c o n s u m e s   a   P e r s i s t e n t V o l u m e   t h a t   h a s   a   G I D   a n n o t a t i o n ,   t h e   a n n o t a t e d   G I D   i s   a p p l i e d   t o   a l l   c o n t a i n e r s   i n   t h e   P o d   i n   t h e   s a m e   w a y   t h a t   G I D s   s p e c i f i e d   i n   t h e   P o d ' s   s e c u r i t y   c o n t e x t   a r e .   E v e r y   G I D ,   w h e t h e r   i t   o r i g i n a t e s   f r o m   a   P e r s i s t e n t V o l u m e   a n n o t a t i o n   o r   t h e   P o d ' s   s p e c i f i c a t i o n ,   i s   a p p l i e d   t o   t h e   f i r s t   p r o c e s s   r u n   i n   e a c h   c o n t a i n e r .


Question: What is What's next?

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


Question: What is Reference?

Answer: P e r s i s t e n t V o l u m e P e r s i s t e n t V o l u m e S p e c P e r s i s t e n t V o l u m e C l a i m P e r s i s t e n t V o l u m e C l a i m S p e c


Question: What is Volume?

Answer: VolumeVolume represents a named volume in a pod that may be accessed by any container in the pod.import "k8s.io/api/core/v1"VolumeVolume represents a named volume in a pod that may be accessed by any container in the pod.name (string), requiredname of the volume. Must be a DNS_LABEL and unique within the pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#namesExposed Persistent volumespersistentVolumeClaim (PersistentVolumeClaimVolumeSource)persistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaimsPersistentVolumeClaimVolumeSource references the user's PVC in the same namespace. This volume finds the bound PV and mounts that volume for the pod. A PersistentVolumeClaimVolumeSource is, essentially, a wrapper around another type of volume that is owned by someone else (the system).persistentVolumeClaim.claimName (string), requiredclaimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaimspersistentVolumeClaim.readOnly (boolean)readOnly Will force the ReadOnly setting in VolumeMounts. Default false.ProjectionsconfigMap (ConfigMapVolumeSource)configMap represents a configMap that should populate this volume*Adapts a ConfigMap into a volume.The contents of the target ConfigMap's Data field will be presented in a volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. ConfigMap volumes support ownership management and SELinux relabeling.*configMap.name (string)Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#namesconfigMap.optional (boolean)optional specify whether the ConfigMap or its keys must be definedconfigMap.defaultMode (int32)defaultMode is optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.configMap.items ([]KeyToPath)Atomic: will be replaced during a mergeitems if unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys


Question: How does Volume work?

Answer: VolumeVolume represents a named volume in a pod that may be accessed by any container in the pod.import "k8s.io/api/core/v1"VolumeVolume represents a named volume in a pod that may be accessed by any container in the pod.name (string), requiredname of the volume. Must be a DNS_LABEL and unique within the pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#namesExposed Persistent volumespersistentVolumeClaim (PersistentVolumeClaimVolumeSource)persistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaimsPersistentVolumeClaimVolumeSource references the user's PVC in the same namespace. This volume finds the bound PV and mounts that volume for the pod. A PersistentVolumeClaimVolumeSource is, essentially, a wrapper around another type of volume that is owned by someone else (the system).persistentVolumeClaim.claimName (string), requiredclaimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaimspersistentVolumeClaim.readOnly (boolean)readOnly Will force the ReadOnly setting in VolumeMounts. Default false.ProjectionsconfigMap (ConfigMapVolumeSource)configMap represents a configMap that should populate this volume*Adapts a ConfigMap into a volume.The contents of the target ConfigMap's Data field will be presented in a volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. ConfigMap volumes support ownership management and SELinux relabeling.*configMap.name (string)Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#namesconfigMap.optional (boolean)optional specify whether the ConfigMap or its keys must be definedconfigMap.defaultMode (int32)defaultMode is optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.configMap.items ([]KeyToPath)Atomic: will be replaced during a mergeitems if unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys


Question: When would you use Volume?

Answer: VolumeVolume represents a named volume in a pod that may be accessed by any container in the pod.import "k8s.io/api/core/v1"VolumeVolume represents a named volume in a pod that may be accessed by any container in the pod.name (string), requiredname of the volume. Must be a DNS_LABEL and unique within the pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#namesExposed Persistent volumespersistentVolumeClaim (PersistentVolumeClaimVolumeSource)persistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaimsPersistentVolumeClaimVolumeSource references the user's PVC in the same namespace. This volume finds the bound PV and mounts that volume for the pod. A PersistentVolumeClaimVolumeSource is, essentially, a wrapper around another type of volume that is owned by someone else (the system).persistentVolumeClaim.claimName (string), requiredclaimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaimspersistentVolumeClaim.readOnly (boolean)readOnly Will force the ReadOnly setting in VolumeMounts. Default false.ProjectionsconfigMap (ConfigMapVolumeSource)configMap represents a configMap that should populate this volume*Adapts a ConfigMap into a volume.The contents of the target ConfigMap's Data field will be presented in a volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. ConfigMap volumes support ownership management and SELinux relabeling.*configMap.name (string)Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#namesconfigMap.optional (boolean)optional specify whether the ConfigMap or its keys must be definedconfigMap.defaultMode (int32)defaultMode is optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.configMap.items ([]KeyToPath)Atomic: will be replaced during a mergeitems if unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys


Question: What are the benefits of Volume?

Answer: VolumeVolume represents a named volume in a pod that may be accessed by any container in the pod.import "k8s.io/api/core/v1"VolumeVolume represents a named volume in a pod that may be accessed by any container in the pod.name (string), requiredname of the volume. Must be a DNS_LABEL and unique within the pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#namesExposed Persistent volumespersistentVolumeClaim (PersistentVolumeClaimVolumeSource)persistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaimsPersistentVolumeClaimVolumeSource references the user's PVC in the same namespace. This volume finds the bound PV and mounts that volume for the pod. A PersistentVolumeClaimVolumeSource is, essentially, a wrapper around another type of volume that is owned by someone else (the system).persistentVolumeClaim.claimName (string), requiredclaimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaimspersistentVolumeClaim.readOnly (boolean)readOnly Will force the ReadOnly setting in VolumeMounts. Default false.ProjectionsconfigMap (ConfigMapVolumeSource)configMap represents a configMap that should populate this volume*Adapts a ConfigMap into a volume.The contents of the target ConfigMap's Data field will be presented in a volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. ConfigMap volumes support ownership management and SELinux relabeling.*configMap.name (string)Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#namesconfigMap.optional (boolean)optional specify whether the ConfigMap or its keys must be definedconfigMap.defaultMode (int32)defaultMode is optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.configMap.items ([]KeyToPath)Atomic: will be replaced during a mergeitems if unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys


Question: What is Volume?

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


Question: What is Volume?

Answer: V o l u m e   r e p r e s e n t s   a   n a m e d   v o l u m e   i n   a   p o d   t h a t   m a y   b e   a c c e s s e d   b y   a n y   c o n t a i n e r   i n   t h e   p o d .   n a m e   ( s t r i n g ) ,   r e q u i r e d n a m e   o f   t h e   v o l u m e .   M u s t   b e   a   D N S _ L A B E L   a n d   u n i q u e   w i t h i n   t h e   p o d .   M o r e   i n f o :   h t t p s : / / k u b e r n e t e s . i o / d o c s / c o n c e p t s / o v e r v i e w / w o r k i n g - w i t h - o b j e c t s / n a m e s / # n a m e s   n a m e   ( s t r i n g ) ,   r e q u i r e d   n a m e   o f   t h e   v o l u m e .   M u s t   b e   a   D N S _ L A B E L   a n d   u n i q u e   w i t h i n   t h e   p o d .   M o r e   i n f o :   h t t p s : / / k u b e r n e t e s . i o / d o c s / c o n c e p t s / o v e r v i e w / w o r k i n g - w i t h - o b j e c t s / n a m e s / # n a m e s


Question: What is Exposed Persistent volumes?

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


Question: What is Projections?

Answer: c o n f i g M a p   ( C o n f i g M a p V o l u m e S o u r c e ) c o n f i g M a p   r e p r e s e n t s   a   c o n f i g M a p   t h a t   s h o u l d   p o p u l a t e   t h i s   v o l u m e * A d a p t s   a   C o n f i g M a p   i n t o   a   v o l u m e . T h e   c o n t e n t s   o f   t h e   t a r g e t   C o n f i g M a p ' s   D a t a   f i e l d   w i l l   b e   p r e s e n t e d   i n   a   v o l u m e   a s   f i l e s   u s i n g   t h e   k e y s   i n   t h e   D a t a   f i e l d   a s   t h e   f i l e   n a m e s ,   u n l e s s   t h e   i t e m s   e l e m e n t   i s   p o p u l a t e d   w i t h   s p e c i f i c   m a p p i n g s   o f   k e y s   t o   p a t h s .   C o n f i g M a p   v o l u m e s   s u p p o r t   o w n e r s h i p   m a n a g e m e n t   a n d   S E L i n u x   r e l a b e l i n g . * c o n f i g M a p . n a m e   ( s t r i n g ) N a m e   o f   t h e   r e f e r e n t .   T h i s   f i e l d   i s   e f f e c t i v e l y   r e q u i r e d ,   b u t   d u e   t o   b a c k w a r d s   c o m p a t i b i l i t y   i s   a l l o w e d   t o   b e   e m p t y .   I n s t a n c e s   o f   t h i s   t y p e   w i t h   a n   e m p t y   v a l u e   h e r e   a r e   a l m o s t   c e r t a i n l y   w r o n g .   M o r e   i n f o :   h t t p s : / / k u b e r n e t e s . i o / d o c s / c o n c e p t s / o v e r v i e w / w o r k i n g - w i t h - o b j e c t s / n a m e s / # n a m e s c o n f i g M a p . o p t i o n a l   ( b o o l e a n ) o p t i o n a l   s p e c i f y   w h e t h e r   t h e   C o n f i g M a p   o r   i t s   k e y s   m u s t   b e   d e f i n e d c o n f i g M a p . d e f a u l t M o d e   ( i n t 3 2 ) d e f a u l t M o d e   i s   o p t i o n a l :   m o d e   b i t s   u s e d   t o   s e t   p e r m i s s i o n s   o n   c r e a t e d   f i l e s   b y   d e f a u l t .   M u s t   b e   a n   o c t a l   v a l u e   b e t w e e n   0 0 0 0   a n d   0 7 7 7   o r   a   d e c i m a l   v a l


Question: What is Local / Temporary Directory?

Answer: e m p t y D i r   ( E m p t y D i r V o l u m e S o u r c e ) e m p t y D i r   r e p r e s e n t s   a   t e m p o r a r y   d i r e c t o r y   t h a t   s h a r e s   a   p o d ' s   l i f e t i m e .   M o r e   i n f o :   h t t p s : / / k u b e r n e t e s . i o / d o c s / c o n c e p t s / s t o r a g e / v o l u m e s # e m p t y d i r R e p r e s e n t s   a n   e m p t y   d i r e c t o r y   f o r   a   p o d .   E m p t y   d i r e c t o r y   v o l u m e s   s u p p o r t   o w n e r s h i p   m a n a g e m e n t   a n d   S E L i n u x   r e l a b e l i n g . e m p t y D i r . m e d i u m   ( s t r i n g ) m e d i u m   r e p r e s e n t s   w h a t   t y p e   o f   s t o r a g e   m e d i u m   s h o u l d   b a c k   t h i s   d i r e c t o r y .   T h e   d e f a u l t   i s   " "   w h i c h   m e a n s   t o   u s e   t h e   n o d e ' s   d e f a u l t   m e d i u m .   M u s t   b e   a n   e m p t y   s t r i n g   ( d e f a u l t )   o r   M e m o r y .   M o r e   i n f o :   h t t p s : / / k u b e r n e t e s . i o / d o c s / c o n c e p t s / s t o r a g e / v o l u m e s # e m p t y d i r e m p t y D i r . s i z e L i m i t   ( Q u a n t i t y ) s i z e L i m i t   i s   t h e   t o t a l   a m o u n t   o f   l o c a l   s t o r a g e   r e q u i r e d   f o r   t h i s   E m p t y D i r   v o l u m e .   T h e   s i z e   l i m i t   i s   a l s o   a p p l i c a b l e   f o r   m e m o r y   m e d i u m .   T h e   m a x i m u m   u s a g e   o n   m e m o r y   m e d i u m   E m p t y D i r   w o u l d   b e   t h e   m i n i m u m   v a l u e   b e t w e e n   t h e   S i z e L i m i t   s p e c i f i e d   h e r e   a n d   t h e   s u m   o f   m e m o r y   l i m i t s   o f   a l l   c o n t a i n e r s   i n   a   p o d .   T h e   d e f a u l t   i s   n i l   w h i c h   m e a n s   t h a t   t h e   l i m i t   i s   u n d e f i n e d .   M o r e   i n f o :   h t t p s : / / k u b e r n e t e s . i o / d o c s / c o n c


Question: What is Persistent volumes?

Answer: a w s E l a s t i c B l o c k S t o r e   ( A W S E l a s t i c B l o c k S t o r e V o l u m e S o u r c e ) a w s E l a s t i c B l o c k S t o r e   r e p r e s e n t s   a n   A W S   D i s k   r e s o u r c e   t h a t   i s   a t t a c h e d   t o   a   k u b e l e t ' s   h o s t   m a c h i n e   a n d   t h e n   e x p o s e d   t o   t h e   p o d .   D e p r e c a t e d :   A W S E l a s t i c B l o c k S t o r e   i s   d e p r e c a t e d .   A l l   o p e r a t i o n s   f o r   t h e   i n - t r e e   a w s E l a s t i c B l o c k S t o r e   t y p e   a r e   r e d i r e c t e d   t o   t h e   e b s . c s i . a w s . c o m   C S I   d r i v e r .   M o r e   i n f o :   h t t p s : / / k u b e r n e t e s . i o / d o c s / c o n c e p t s / s t o r a g e / v o l u m e s # a w s e l a s t i c b l o c k s t o r e * R e p r e s e n t s   a   P e r s i s t e n t   D i s k   r e s o u r c e   i n   A W S . A n   A W S   E B S   d i s k   m u s t   e x i s t   b e f o r e   m o u n t i n g   t o   a   c o n t a i n e r .   T h e   d i s k   m u s t   a l s o   b e   i n   t h e   s a m e   A W S   z o n e   a s   t h e   k u b e l e t .   A n   A W S   E B S   d i s k   c a n   o n l y   b e   m o u n t e d   a s   r e a d / w r i t e   o n c e .   A W S   E B S   v o l u m e s   s u p p o r t   o w n e r s h i p   m a n a g e m e n t   a n d   S E L i n u x   r e l a b e l i n g . * a w s E l a s t i c B l o c k S t o r e . v o l u m e I D   ( s t r i n g ) ,   r e q u i r e d v o l u m e I D   i s   u n i q u e   I D   o f   t h e   p e r s i s t e n t   d i s k   r e s o u r c e   i n   A W S   ( A m a z o n   E B S   v o l u m e ) .   M o r e   i n f o :   h t t p s : / / k u b e r n e t e s . i o / d o c s / c o n c e p t s / s t o r a g e / v o l u m e s # a w s e l a s t i c b l o c k s t o r e a w s E l a s t i c B l o c k S t o r e . f s T y p e   ( s t r i n g ) f s T y p e   i s   t h e   f i l e s y s t e m   t y p e   o f   t h e   v o l u m


Question: What is Deprecated?

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