Question: What is Claim resources and deploy a Pod?

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


Question: What is Create the ResourceClaim?

Answer: I n   t h i s   s e c t i o n ,   y o u   c r e a t e   a   R e s o u r c e C l a i m   a n d   r e f e r e n c e   i t   i n   a   P o d .   W h a t e v e r   t h e   c l a i m ,   t h e   d e v i c e C l a s s N a m e   i s   a   r e q u i r e d   f i e l d ,   n a r r o w i n g   d o w n   t h e   s c o p e   o f   t h e   r e q u e s t   t o   a   s p e c i f i c   d e v i c e   c l a s s .   T h e   r e q u e s t   i t s e l f   c a n   i n c l u d e   a   C o m m o n   E x p r e s s i o n   L a n g u a g e   e x p r e s s i o n   t h a t   r e f e r e n c e s   a t t r i b u t e s   t h a t   m a y   b e   a d v e r t i s e d   b y   t h e   d r i v e r   m a n a g i n g   t h a t   d e v i c e   c l a s s .   I n   t h i s   e x a m p l e ,   y o u   w i l l   c r e a t e   a   r e q u e s t   f o r   a n y   G P U   a d v e r t i s i n g   o v e r   1 0 G i   m e m o r y   c a p a c i t y .   T h e   a t t r i b u t e   e x p o s i n g   c a p a c i t y   f r o m   t h e   e x a m p l e   d r i v e r   t a k e s   t h e   f o r m   d e v i c e . c a p a c i t y [ ' g p u . e x a m p l e . c o m ' ] . m e m o r y .   N o t e   a l s o   t h a t   t h e   n a m e   o f   t h e   c l a i m   i s   s e t   t o   s o m e - g p u .   a p i V e r s i o n :   r e s o u r c e . k 8 s . i o / v 1   k i n d :   R e s o u r c e C l a i m   m e t a d a t a :   n a m e :   s o m e - g p u   n a m e s p a c e :   d r a - t u t o r i a l   s p e c :   d e v i c e s :   r e q u e s t s :   -   n a m e :   s o m e - g p u   e x a c t l y :   d e v i c e C l a s s N a m e :   g p u . e x a m p l e . c o m   s e l e c t o r s :   -   c e l :   e x p r e s s i o n :   " d e v i c e . c a p a c i t y [ ' g p u . e x a m p l e . c o m ' ] . m e m o r y . c o m p a r e T o ( q u a n t i t y ( ' 1 0 G i ' ) )   > =   0 "   k u b e c t l   a p p l y   - - s e r v e r - s i d e   - f   h t t p : / / k 8 s . i o / e x a m p l e s / d r a / d r i v e r - i n s t a l l / e x a m p l e /


Question: What is Create the Pod that references that ResourceClaim?

Answer: B e l o w   i s   t h e   P o d   m a n i f e s t   r e f e r e n c i n g   t h e   R e s o u r c e C l a i m   y o u   j u s t   m a d e ,   s o m e - g p u ,   i n   t h e   s p e c . r e s o u r c e C l a i m s . r e s o u r c e C l a i m N a m e   f i e l d .   T h e   l o c a l   n a m e   f o r   t h a t   c l a i m ,   g p u ,   i s   t h e n   u s e d   i n   t h e   s p e c . c o n t a i n e r s . r e s o u r c e s . c l a i m s . n a m e   f i e l d   t o   a l l o c a t e   t h e   c l a i m   t o   t h e   P o d ' s   u n d e r l y i n g   c o n t a i n e r .   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 :   p o d 0   n a m e s p a c e :   d r a - t u t o r i a l   l a b e l s :   a p p :   p o d   s p e c :   c o n t a i n e r s :   -   n a m e :   c t r 0   i m a g e :   u b u n t u : 2 4 . 0 4   c o m m a n d :   [ " b a s h " ,   " - c " ]   a r g s :   [ " e x p o r t ;   t r a p   ' e x i t   0 '   T E R M ;   s l e e p   9 9 9 9   &   w a i t " ]   r e s o u r c e s :   c l a i m s :   -   n a m e :   g p u   r e s o u r c e C l a i m s :   -   n a m e :   g p u   r e s o u r c e C l a i m N a m e :   s o m e - g p u   k u b e c t l   a p p l y   - - s e r v e r - s i d e   - f   h t t p : / / k 8 s . i o / e x a m p l e s / d r a / d r i v e r - i n s t a l l / e x a m p l e / p o d . y a m l   C o n f i r m   t h e   p o d   h a s   d e p l o y e d : k u b e c t l   g e t   p o d   p o d 0   - n   d r a - t u t o r i a l   T h e   o u t p u t   i s   s i m i l a r   t o   t h i s : N A M E   R E A D Y   S T A T U S   R E S T A R T S   A G E   p o d 0   1 / 1   R u n n i n g   0   9 s   C o n f i r m   t h e   p o d   h a s   d e p l o y e d :   k u b e c t l   g e t   p o d   p o d 0   - n   d r a - t u t o r i a l   T h e   o u t p u t   i s   s i m i l a r   t o   t h i s :   N A M E   R E A D Y   S T A T U S   R E S T A R T S   A G E   p o d 0   1 / 1   R u n n i n g   0   9 s


Question: What is Explore the DRA state?

Answer: A f t e r   y o u   c r e a t e   t h e   P o d ,   t h e   c l u s t e r   t r i e s   t o   s c h e d u l e   t h a t   P o d   t o   a   n o d e   w h e r e   K u b e r n e t e s   c a n   s a t i s f y   t h e   R e s o u r c e C l a i m .   I n   t h i s   t u t o r i a l ,   t h e   D R A   d r i v e r   i s   d e p l o y e d   o n   a l l   n o d e s ,   a n d   i s   a d v e r t i s i n g   m o c k   G P U s   o n   a l l   n o d e s ,   a l l   o f   w h i c h   h a v e   e n o u g h   c a p a c i t y   a d v e r t i s e d   t o   s a t i s f y   t h e   P o d ' s   c l a i m ,   s o   K u b e r n e t e s   c a n   s c h e d u l e   t h i s   P o d   o n   a n y   n o d e   a n d   c a n   a l l o c a t e   a n y   o f   t h e   m o c k   G P U s   o n   t h a t   n o d e .   W h e n   K u b e r n e t e s   a l l o c a t e s   a   m o c k   G P U   t o   a   P o d ,   t h e   e x a m p l e   d r i v e r   a d d s   e n v i r o n m e n t   v a r i a b l e s   i n   e a c h   c o n t a i n e r   i t   i s   a l l o c a t e d   t o   i n   o r d e r   t o   i n d i c a t e   w h i c h   G P U s   w o u l d   h a v e   b e e n   i n j e c t e d   i n t o   t h e m   b y   a   r e a l   r e s o u r c e   d r i v e r   a n d   h o w   t h e y   w o u l d   h a v e   b e e n   c o n f i g u r e d ,   s o   y o u   c a n   c h e c k   t h o s e   e n v i r o n m e n t   v a r i a b l e s   t o   s e e   h o w   t h e   P o d s   h a v e   b e e n   h a n d l e d   b y   t h e   s y s t e m .   C h e c k   t h e   P o d   l o g s ,   w h i c h   r e p o r t   t h e   n a m e   o f   t h e   m o c k   G P U   t h a t   w a s   a l l o c a t e d : k u b e c t l   l o g s   p o d 0   - c   c t r 0   - n   d r a - t u t o r i a l   |   g r e p   - E   " G P U _ D E V I C E _ [ 0 - 9 ] + = "   |   g r e p   - v   " R E S O U R C E _ C L A I M "   T h e   o u t p u t   i s   s i m i l a r   t o   t h i s : d e c l a r e   - x   G P U _ D E V I C E _ 0 = " g p u - 0 "   C


Question: What is Delete a Pod that has a claim?

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


Question: What is Observe the DRA state?

Answer: W h e n   t h e   P o d   i s   d e l e t e d ,   t h e   d r i v e r   d e a l l o c a t e s   t h e   d e v i c e   f r o m   t h e   R e s o u r c e C l a i m   a n d   u p d a t e s   t h e   R e s o u r c e C l a i m   r e s o u r c e   i n   t h e   K u b e r n e t e s   A P I .   T h e   R e s o u r c e C l a i m   h a s   a   p e n d i n g   s t a t e   u n t i l   i t ' s   r e f e r e n c e d   i n   a   n e w   P o d .   C h e c k   t h e   s t a t e   o f   t h e   s o m e - g p u   R e s o u r c e C l a i m : k u b e c t l   g e t   r e s o u r c e c l a i m s   - n   d r a - t u t o r i a l   T h e   o u t p u t   i s   s i m i l a r   t o   t h i s : N A M E   S T A T E   A G E   s o m e - g p u   p e n d i n g   7 6 s   V e r i f y   t h a t   t h e   d r i v e r   h a s   p r o c e s s e d   u n p r e p a r i n g   t h e   d e v i c e   f o r   t h i s   c l a i m   b y   c h e c k i n g   t h e   d r i v e r   l o g s : k u b e c t l   l o g s   - l   a p p . k u b e r n e t e s . i o / n a m e = d r a - e x a m p l e - d r i v e r   - n   d r a - t u t o r i a l   T h e   o u t p u t   i s   s i m i l a r   t o   t h i s : I 0 8 2 0   1 8 : 2 2 : 1 5 . 6 2 9 3 7 6   1   d r i v e r . g o : 1 3 8 ]   U n p r e p a r e R e s o u r c e C l a i m s   i s   c a l l e d :   n u m b e r   o f   c l a i m s :   1   C h e c k   t h e   s t a t e   o f   t h e   s o m e - g p u   R e s o u r c e C l a i m :   k u b e c t l   g e t   r e s o u r c e c l a i m s   - n   d r a - t u t o r i a l   T h e   o u t p u t   i s   s i m i l a r   t o   t h i s :   N A M E   S T A T E   A G E   s o m e - g p u   p e n d i n g   7 6 s   V e r i f y   t h a t   t h e   d r i v e r   h a s   p r o c e s s e d   u n p r e p a r i n g   t h e   d e v i c e   f o r   t h i s   c l a i m   b y   c h e c k i n g   t h e   d r i v e r   l o g s :   k u b e c t l   l o g s   - l   a p p . k u b e r n e t e s . i o / n a m e = d r a - e x a m p l e - d r i v e r   - n   d r a -


Question: What is Cleaning up?

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


Question: What is What's next?

Answer: L e a r n   m o r e   a b o u t   D R A A l l o c a t e   D e v i c e s   t o   W o r k l o a d s   w i t h   D R A


Question: What is Create an External Load Balancer?

Answer: Create an External Load BalancerThis page shows how to create an external load balancer.When creating a Service, you have the option of automatically creating a cloud load balancer. This provides an externally-accessible IP address that sends traffic to the correct port on your cluster nodes, provided your cluster runs in a supported environment and is configured with the correct cloud load balancer provider package.You can also use an Ingress in place of Service. For more information, check the Ingress documentation.Before you beginYou need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster. It is recommended to run this tutorial on a cluster with at least two nodes that are not acting as control plane hosts. If you do not already have a cluster, you can create one by using minikube or you can use one of these Kubernetes playgrounds:iximiuz LabsKillercodaKodeKloudPlay with KubernetesYour cluster must be running in a cloud or other environment that already has support for configuring external load balancers.Create a ServiceCreate a Service from a manifestTo create an external load balancer, add the following line to your Service manifest: type: LoadBalancer Your manifest might then look like:apiVersion: v1 kind: Service metadata: name: example-service spec: selector: app: example ports: - port: 8765 targetPort: 9376 type: LoadBalancer Create a Service using kubectlYou can alternatively create the service with the kubectl expose command and its --type=LoadBalancer flag:kubectl expose deployment example --port=8765 --target-port=9376 \ --name=example-service --type=LoadBalancer This command creates a new Service using the same selectors as the referenced resource (in the case of the example above, a Deployment named example).For more information, including optional flags, refer to the kubectl expose reference.Finding your IP addressYou can find the IP address created for your service by getting the service information through kubectl:kubectl describe services example-service which should produce output similar to:Name: example-service Namespace: default Labels: app=example Annotations: <none> Selector: app=example Type: LoadBalancer IP Families: <none> IP: 10.3.22.96 IPs: 10.3.22.96 LoadBalancer Ingress: 192.0.2.89 Port: <unset> 8765/TCP TargetPort: 9376/TCP NodePort: <unset> 30593/TCP Endpoints: 172.17.0.3:9376 Session Affinity: None External Traffic Policy: Cluster Events: <none> The load balancer's IP address is listed next to LoadBalancer Ingress.Note:If you are running your service on Minikube, you can find the assigned IP address and port with:minikube service example-service --url Preserving the client source IPBy default, the source IP seen in the target container is not the original source IP of the client. To enable preservation of the client IP, the following fields can be configured in the .spec of the Service:.spec.externalTrafficPolicy - denotes if this Service desires t


Question: How does Create an External Load Balancer work?

Answer: Create an External Load BalancerThis page shows how to create an external load balancer.When creating a Service, you have the option of automatically creating a cloud load balancer. This provides an externally-accessible IP address that sends traffic to the correct port on your cluster nodes, provided your cluster runs in a supported environment and is configured with the correct cloud load balancer provider package.You can also use an Ingress in place of Service. For more information, check the Ingress documentation.Before you beginYou need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster. It is recommended to run this tutorial on a cluster with at least two nodes that are not acting as control plane hosts. If you do not already have a cluster, you can create one by using minikube or you can use one of these Kubernetes playgrounds:iximiuz LabsKillercodaKodeKloudPlay with KubernetesYour cluster must be running in a cloud or other environment that already has support for configuring external load balancers.Create a ServiceCreate a Service from a manifestTo create an external load balancer, add the following line to your Service manifest: type: LoadBalancer Your manifest might then look like:apiVersion: v1 kind: Service metadata: name: example-service spec: selector: app: example ports: - port: 8765 targetPort: 9376 type: LoadBalancer Create a Service using kubectlYou can alternatively create the service with the kubectl expose command and its --type=LoadBalancer flag:kubectl expose deployment example --port=8765 --target-port=9376 \ --name=example-service --type=LoadBalancer This command creates a new Service using the same selectors as the referenced resource (in the case of the example above, a Deployment named example).For more information, including optional flags, refer to the kubectl expose reference.Finding your IP addressYou can find the IP address created for your service by getting the service information through kubectl:kubectl describe services example-service which should produce output similar to:Name: example-service Namespace: default Labels: app=example Annotations: <none> Selector: app=example Type: LoadBalancer IP Families: <none> IP: 10.3.22.96 IPs: 10.3.22.96 LoadBalancer Ingress: 192.0.2.89 Port: <unset> 8765/TCP TargetPort: 9376/TCP NodePort: <unset> 30593/TCP Endpoints: 172.17.0.3:9376 Session Affinity: None External Traffic Policy: Cluster Events: <none> The load balancer's IP address is listed next to LoadBalancer Ingress.Note:If you are running your service on Minikube, you can find the assigned IP address and port with:minikube service example-service --url Preserving the client source IPBy default, the source IP seen in the target container is not the original source IP of the client. To enable preservation of the client IP, the following fields can be configured in the .spec of the Service:.spec.externalTrafficPolicy - denotes if this Service desires t


Question: When would you use Create an External Load Balancer?

Answer: Create an External Load BalancerThis page shows how to create an external load balancer.When creating a Service, you have the option of automatically creating a cloud load balancer. This provides an externally-accessible IP address that sends traffic to the correct port on your cluster nodes, provided your cluster runs in a supported environment and is configured with the correct cloud load balancer provider package.You can also use an Ingress in place of Service. For more information, check the Ingress documentation.Before you beginYou need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster. It is recommended to run this tutorial on a cluster with at least two nodes that are not acting as control plane hosts. If you do not already have a cluster, you can create one by using minikube or you can use one of these Kubernetes playgrounds:iximiuz LabsKillercodaKodeKloudPlay with KubernetesYour cluster must be running in a cloud or other environment that already has support for configuring external load balancers.Create a ServiceCreate a Service from a manifestTo create an external load balancer, add the following line to your Service manifest: type: LoadBalancer Your manifest might then look like:apiVersion: v1 kind: Service metadata: name: example-service spec: selector: app: example ports: - port: 8765 targetPort: 9376 type: LoadBalancer Create a Service using kubectlYou can alternatively create the service with the kubectl expose command and its --type=LoadBalancer flag:kubectl expose deployment example --port=8765 --target-port=9376 \ --name=example-service --type=LoadBalancer This command creates a new Service using the same selectors as the referenced resource (in the case of the example above, a Deployment named example).For more information, including optional flags, refer to the kubectl expose reference.Finding your IP addressYou can find the IP address created for your service by getting the service information through kubectl:kubectl describe services example-service which should produce output similar to:Name: example-service Namespace: default Labels: app=example Annotations: <none> Selector: app=example Type: LoadBalancer IP Families: <none> IP: 10.3.22.96 IPs: 10.3.22.96 LoadBalancer Ingress: 192.0.2.89 Port: <unset> 8765/TCP TargetPort: 9376/TCP NodePort: <unset> 30593/TCP Endpoints: 172.17.0.3:9376 Session Affinity: None External Traffic Policy: Cluster Events: <none> The load balancer's IP address is listed next to LoadBalancer Ingress.Note:If you are running your service on Minikube, you can find the assigned IP address and port with:minikube service example-service --url Preserving the client source IPBy default, the source IP seen in the target container is not the original source IP of the client. To enable preservation of the client IP, the following fields can be configured in the .spec of the Service:.spec.externalTrafficPolicy - denotes if this Service desires t


Question: What are the benefits of Create an External Load Balancer?

Answer: Create an External Load BalancerThis page shows how to create an external load balancer.When creating a Service, you have the option of automatically creating a cloud load balancer. This provides an externally-accessible IP address that sends traffic to the correct port on your cluster nodes, provided your cluster runs in a supported environment and is configured with the correct cloud load balancer provider package.You can also use an Ingress in place of Service. For more information, check the Ingress documentation.Before you beginYou need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster. It is recommended to run this tutorial on a cluster with at least two nodes that are not acting as control plane hosts. If you do not already have a cluster, you can create one by using minikube or you can use one of these Kubernetes playgrounds:iximiuz LabsKillercodaKodeKloudPlay with KubernetesYour cluster must be running in a cloud or other environment that already has support for configuring external load balancers.Create a ServiceCreate a Service from a manifestTo create an external load balancer, add the following line to your Service manifest: type: LoadBalancer Your manifest might then look like:apiVersion: v1 kind: Service metadata: name: example-service spec: selector: app: example ports: - port: 8765 targetPort: 9376 type: LoadBalancer Create a Service using kubectlYou can alternatively create the service with the kubectl expose command and its --type=LoadBalancer flag:kubectl expose deployment example --port=8765 --target-port=9376 \ --name=example-service --type=LoadBalancer This command creates a new Service using the same selectors as the referenced resource (in the case of the example above, a Deployment named example).For more information, including optional flags, refer to the kubectl expose reference.Finding your IP addressYou can find the IP address created for your service by getting the service information through kubectl:kubectl describe services example-service which should produce output similar to:Name: example-service Namespace: default Labels: app=example Annotations: <none> Selector: app=example Type: LoadBalancer IP Families: <none> IP: 10.3.22.96 IPs: 10.3.22.96 LoadBalancer Ingress: 192.0.2.89 Port: <unset> 8765/TCP TargetPort: 9376/TCP NodePort: <unset> 30593/TCP Endpoints: 172.17.0.3:9376 Session Affinity: None External Traffic Policy: Cluster Events: <none> The load balancer's IP address is listed next to LoadBalancer Ingress.Note:If you are running your service on Minikube, you can find the assigned IP address and port with:minikube service example-service --url Preserving the client source IPBy default, the source IP seen in the target container is not the original source IP of the client. To enable preservation of the client IP, the following fields can be configured in the .spec of the Service:.spec.externalTrafficPolicy - denotes if this Service desires t


Question: What is Create an External Load Balancer?

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


Question: What is Before you begin?

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


Question: What is Create a Service from a manifest?

Answer: T o   c r e a t e   a n   e x t e r n a l   l o a d   b a l a n c e r ,   a d d   t h e   f o l l o w i n g   l i n e   t o   y o u r   S e r v i c e   m a n i f e s t :   t y p e :   L o a d B a l a n c e r   Y o u r   m a n i f e s t   m i g h t   t h e n   l o o k   l i k e :   a p i V e r s i o n :   v 1   k i n d :   S e r v i c e   m e t a d a t a :   n a m e :   e x a m p l e - s e r v i c e   s p e c :   s e l e c t o r :   a p p :   e x a m p l e   p o r t s :   -   p o r t :   8 7 6 5   t a r g e t P o r t :   9 3 7 6   t y p e :   L o a d B a l a n c e r


Question: What is Create a Service using kubectl?

Answer: Y o u   c a n   a l t e r n a t i v e l y   c r e a t e   t h e   s e r v i c e   w i t h   t h e   k u b e c t l   e x p o s e   c o m m a n d   a n d   i t s   - - t y p e = L o a d B a l a n c e r   f l a g :   k u b e c t l   e x p o s e   d e p l o y m e n t   e x a m p l e   - - p o r t = 8 7 6 5   - - t a r g e t - p o r t = 9 3 7 6   \   - - n a m e = e x a m p l e - s e r v i c e   - - t y p e = L o a d B a l a n c e r   T h i s   c o m m a n d   c r e a t e s   a   n e w   S e r v i c e   u s i n g   t h e   s a m e   s e l e c t o r s   a s   t h e   r e f e r e n c e d   r e s o u r c e   ( i n   t h e   c a s e   o f   t h e   e x a m p l e   a b o v e ,   a   D e p l o y m e n t   n a m e d   e x a m p l e ) .   F o r   m o r e   i n f o r m a t i o n ,   i n c l u d i n g   o p t i o n a l   f l a g s ,   r e f e r   t o   t h e   k u b e c t l   e x p o s e   r e f e r e n c e .


Question: What is Finding your IP address?

Answer: Y o u   c a n   f i n d   t h e   I P   a d d r e s s   c r e a t e d   f o r   y o u r   s e r v i c e   b y   g e t t i n g   t h e   s e r v i c e   i n f o r m a t i o n   t h r o u g h   k u b e c t l :   k u b e c t l   d e s c r i b e   s e r v i c e s   e x a m p l e - s e r v i c e   w h i c h   s h o u l d   p r o d u c e   o u t p u t   s i m i l a r   t o :   N a m e :   e x a m p l e - s e r v i c e   N a m e s p a c e :   d e f a u l t   L a b e l s :   a p p = e x a m p l e   A n n o t a t i o n s :   < n o n e >   S e l e c t o r :   a p p = e x a m p l e   T y p e :   L o a d B a l a n c e r   I P   F a m i l i e s :   < n o n e >   I P :   1 0 . 3 . 2 2 . 9 6   I P s :   1 0 . 3 . 2 2 . 9 6   L o a d B a l a n c e r   I n g r e s s :   1 9 2 . 0 . 2 . 8 9   P o r t :   < u n s e t >   8 7 6 5 / T C P   T a r g e t P o r t :   9 3 7 6 / T C P   N o d e P o r t :   < u n s e t >   3 0 5 9 3 / T C P   E n d p o i n t s :   1 7 2 . 1 7 . 0 . 3 : 9 3 7 6   S e s s i o n   A f f i n i t y :   N o n e   E x t e r n a l   T r a f f i c   P o l i c y :   C l u s t e r   E v e n t s :   < n o n e >   T h e   l o a d   b a l a n c e r ' s   I P   a d d r e s s   i s   l i s t e d   n e x t   t o   L o a d B a l a n c e r   I n g r e s s .


Question: What is Note:?

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


Question: What is Preserving the client source IP?

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


Question: What is Caveats and limitations when preserving source IPs?

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


Question: What is Garbage collecting load balancers?

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


Question: What is External load balancer providers?

Answer: I t   i s   i m p o r t a n t   t o   n o t e   t h a t   t h e   d a t a p a t h   f o r   t h i s   f u n c t i o n a l i t y   i s   p r o v i d e d   b y   a   l o a d   b a l a n c e r   e x t e r n a l   t o   t h e   K u b e r n e t e s   c l u s t e r .   W h e n   t h e   S e r v i c e   t y p e   i s   s e t   t o   L o a d B a l a n c e r ,   K u b e r n e t e s   p r o v i d e s   f u n c t i o n a l i t y   e q u i v a l e n t   t o   t y p e   e q u a l s   C l u s t e r I P   t o   p o d s   w i t h i n   t h e   c l u s t e r   a n d   e x t e n d s   i t   b y   p r o g r a m m i n g   t h e   ( e x t e r n a l   t o   K u b e r n e t e s )   l o a d   b a l a n c e r   w i t h   e n t r i e s   f o r   t h e   n o d e s   h o s t i n g   t h e   r e l e v a n t   K u b e r n e t e s   p o d s .   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   a u t o m a t e s   t h e   c r e a t i o n   o f   t h e   e x t e r n a l   l o a d   b a l a n c e r ,   h e a l t h   c h e c k s   ( i f   n e e d e d ) ,   a n d   p a c k e t   f i l t e r i n g   r u l e s   ( i f   n e e d e d ) .   O n c e   t h e   c l o u d   p r o v i d e r   a l l o c a t e s   a n   I P   a d d r e s s   f o r   t h e   l o a d   b a l a n c e r ,   t h e   c o n t r o l   p l a n e   l o o k s   u p   t h a t   e x t e r n a l   I P   a d d r e s s   a n d   p o p u l a t e s   i t   i n t o   t h e   S e r v i c e   o b j e c t .


Question: What is What's next?

Answer: F o l l o w   t h e   C o n n e c t i n g   A p p l i c a t i o n s   w i t h   S e r v i c e s   t u t o r i a l R e a d   a b o u t   S e r v i c e R e a d   a b o u t   I n g r e s s


Question: What is Example: Deploying Cassandra with a StatefulSet?

Answer: Example: Deploying Cassandra with a StatefulSetThis tutorial shows you how to run Apache Cassandra on Kubernetes. Cassandra, a database, needs persistent storage to provide data durability (application state). In this example, a custom Cassandra seed provider lets the database discover new Cassandra instances as they join the Cassandra cluster.StatefulSets make it easier to deploy stateful applications into your Kubernetes cluster. For more information on the features used in this tutorial, see StatefulSet.Note:Cassandra and Kubernetes both use the term node to mean a member of a cluster. In this tutorial, the Pods that belong to the StatefulSet are Cassandra nodes and are members of the Cassandra cluster (called a ring). When those Pods run in your Kubernetes cluster, the Kubernetes control plane schedules those Pods onto Kubernetes Nodes.When a Cassandra node starts, it uses a seed list to bootstrap discovery of other nodes in the ring. This tutorial deploys a custom Cassandra seed provider that lets the database discover new Cassandra Pods as they appear inside your Kubernetes cluster.ObjectivesCreate and validate a Cassandra headless Service.Use a StatefulSet to create a Cassandra ring.Validate the StatefulSet.Modify the StatefulSet.Delete the StatefulSet and its Pods.Before you beginYou need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster. It is recommended to run this tutorial on a cluster with at least two nodes that are not acting as control plane hosts. If you do not already have a cluster, you can create one by using minikube or you can use one of these Kubernetes playgrounds:iximiuz LabsKillercodaKodeKloudPlay with KubernetesTo complete this tutorial, you should already have a basic familiarity with Pods, Services, and StatefulSets.Additional Minikube setup instructionsCaution:Minikube defaults to 2048MB of memory and 2 CPU. Running Minikube with the default resource configuration results in insufficient resource errors during this tutorial. To avoid these errors, start Minikube with the following settings:minikube start --memory 5120 --cpus=4 Creating a headless Service for CassandraIn Kubernetes, a Service describes a set of Pods that perform the same task.The following Service is used for DNS lookups between Cassandra Pods and clients within your cluster:application/cassandra/cassandra-service.yaml apiVersion: v1 kind: Service metadata: labels: app: cassandra name: cassandra spec: clusterIP: None ports: - port: 9042 selector: app: cassandra Create a Service to track all Cassandra StatefulSet members from the cassandra-service.yaml file:kubectl apply -f https://k8s.io/examples/application/cassandra/cassandra-service.yaml Validating (optional)Get the Cassandra Service.kubectl get svc cassandra The response isNAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE cassandra ClusterIP None <none> 9042/TCP 45s If you don't see a Service named cassandra, that means creation failed.


Question: How does Example: Deploying Cassandra with a StatefulSet work?

Answer: Example: Deploying Cassandra with a StatefulSetThis tutorial shows you how to run Apache Cassandra on Kubernetes. Cassandra, a database, needs persistent storage to provide data durability (application state). In this example, a custom Cassandra seed provider lets the database discover new Cassandra instances as they join the Cassandra cluster.StatefulSets make it easier to deploy stateful applications into your Kubernetes cluster. For more information on the features used in this tutorial, see StatefulSet.Note:Cassandra and Kubernetes both use the term node to mean a member of a cluster. In this tutorial, the Pods that belong to the StatefulSet are Cassandra nodes and are members of the Cassandra cluster (called a ring). When those Pods run in your Kubernetes cluster, the Kubernetes control plane schedules those Pods onto Kubernetes Nodes.When a Cassandra node starts, it uses a seed list to bootstrap discovery of other nodes in the ring. This tutorial deploys a custom Cassandra seed provider that lets the database discover new Cassandra Pods as they appear inside your Kubernetes cluster.ObjectivesCreate and validate a Cassandra headless Service.Use a StatefulSet to create a Cassandra ring.Validate the StatefulSet.Modify the StatefulSet.Delete the StatefulSet and its Pods.Before you beginYou need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster. It is recommended to run this tutorial on a cluster with at least two nodes that are not acting as control plane hosts. If you do not already have a cluster, you can create one by using minikube or you can use one of these Kubernetes playgrounds:iximiuz LabsKillercodaKodeKloudPlay with KubernetesTo complete this tutorial, you should already have a basic familiarity with Pods, Services, and StatefulSets.Additional Minikube setup instructionsCaution:Minikube defaults to 2048MB of memory and 2 CPU. Running Minikube with the default resource configuration results in insufficient resource errors during this tutorial. To avoid these errors, start Minikube with the following settings:minikube start --memory 5120 --cpus=4 Creating a headless Service for CassandraIn Kubernetes, a Service describes a set of Pods that perform the same task.The following Service is used for DNS lookups between Cassandra Pods and clients within your cluster:application/cassandra/cassandra-service.yaml apiVersion: v1 kind: Service metadata: labels: app: cassandra name: cassandra spec: clusterIP: None ports: - port: 9042 selector: app: cassandra Create a Service to track all Cassandra StatefulSet members from the cassandra-service.yaml file:kubectl apply -f https://k8s.io/examples/application/cassandra/cassandra-service.yaml Validating (optional)Get the Cassandra Service.kubectl get svc cassandra The response isNAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE cassandra ClusterIP None <none> 9042/TCP 45s If you don't see a Service named cassandra, that means creation failed.


Question: When would you use Example: Deploying Cassandra with a StatefulSet?

Answer: Example: Deploying Cassandra with a StatefulSetThis tutorial shows you how to run Apache Cassandra on Kubernetes. Cassandra, a database, needs persistent storage to provide data durability (application state). In this example, a custom Cassandra seed provider lets the database discover new Cassandra instances as they join the Cassandra cluster.StatefulSets make it easier to deploy stateful applications into your Kubernetes cluster. For more information on the features used in this tutorial, see StatefulSet.Note:Cassandra and Kubernetes both use the term node to mean a member of a cluster. In this tutorial, the Pods that belong to the StatefulSet are Cassandra nodes and are members of the Cassandra cluster (called a ring). When those Pods run in your Kubernetes cluster, the Kubernetes control plane schedules those Pods onto Kubernetes Nodes.When a Cassandra node starts, it uses a seed list to bootstrap discovery of other nodes in the ring. This tutorial deploys a custom Cassandra seed provider that lets the database discover new Cassandra Pods as they appear inside your Kubernetes cluster.ObjectivesCreate and validate a Cassandra headless Service.Use a StatefulSet to create a Cassandra ring.Validate the StatefulSet.Modify the StatefulSet.Delete the StatefulSet and its Pods.Before you beginYou need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster. It is recommended to run this tutorial on a cluster with at least two nodes that are not acting as control plane hosts. If you do not already have a cluster, you can create one by using minikube or you can use one of these Kubernetes playgrounds:iximiuz LabsKillercodaKodeKloudPlay with KubernetesTo complete this tutorial, you should already have a basic familiarity with Pods, Services, and StatefulSets.Additional Minikube setup instructionsCaution:Minikube defaults to 2048MB of memory and 2 CPU. Running Minikube with the default resource configuration results in insufficient resource errors during this tutorial. To avoid these errors, start Minikube with the following settings:minikube start --memory 5120 --cpus=4 Creating a headless Service for CassandraIn Kubernetes, a Service describes a set of Pods that perform the same task.The following Service is used for DNS lookups between Cassandra Pods and clients within your cluster:application/cassandra/cassandra-service.yaml apiVersion: v1 kind: Service metadata: labels: app: cassandra name: cassandra spec: clusterIP: None ports: - port: 9042 selector: app: cassandra Create a Service to track all Cassandra StatefulSet members from the cassandra-service.yaml file:kubectl apply -f https://k8s.io/examples/application/cassandra/cassandra-service.yaml Validating (optional)Get the Cassandra Service.kubectl get svc cassandra The response isNAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE cassandra ClusterIP None <none> 9042/TCP 45s If you don't see a Service named cassandra, that means creation failed.


Question: What are the benefits of Example: Deploying Cassandra with a StatefulSet?

Answer: Example: Deploying Cassandra with a StatefulSetThis tutorial shows you how to run Apache Cassandra on Kubernetes. Cassandra, a database, needs persistent storage to provide data durability (application state). In this example, a custom Cassandra seed provider lets the database discover new Cassandra instances as they join the Cassandra cluster.StatefulSets make it easier to deploy stateful applications into your Kubernetes cluster. For more information on the features used in this tutorial, see StatefulSet.Note:Cassandra and Kubernetes both use the term node to mean a member of a cluster. In this tutorial, the Pods that belong to the StatefulSet are Cassandra nodes and are members of the Cassandra cluster (called a ring). When those Pods run in your Kubernetes cluster, the Kubernetes control plane schedules those Pods onto Kubernetes Nodes.When a Cassandra node starts, it uses a seed list to bootstrap discovery of other nodes in the ring. This tutorial deploys a custom Cassandra seed provider that lets the database discover new Cassandra Pods as they appear inside your Kubernetes cluster.ObjectivesCreate and validate a Cassandra headless Service.Use a StatefulSet to create a Cassandra ring.Validate the StatefulSet.Modify the StatefulSet.Delete the StatefulSet and its Pods.Before you beginYou need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster. It is recommended to run this tutorial on a cluster with at least two nodes that are not acting as control plane hosts. If you do not already have a cluster, you can create one by using minikube or you can use one of these Kubernetes playgrounds:iximiuz LabsKillercodaKodeKloudPlay with KubernetesTo complete this tutorial, you should already have a basic familiarity with Pods, Services, and StatefulSets.Additional Minikube setup instructionsCaution:Minikube defaults to 2048MB of memory and 2 CPU. Running Minikube with the default resource configuration results in insufficient resource errors during this tutorial. To avoid these errors, start Minikube with the following settings:minikube start --memory 5120 --cpus=4 Creating a headless Service for CassandraIn Kubernetes, a Service describes a set of Pods that perform the same task.The following Service is used for DNS lookups between Cassandra Pods and clients within your cluster:application/cassandra/cassandra-service.yaml apiVersion: v1 kind: Service metadata: labels: app: cassandra name: cassandra spec: clusterIP: None ports: - port: 9042 selector: app: cassandra Create a Service to track all Cassandra StatefulSet members from the cassandra-service.yaml file:kubectl apply -f https://k8s.io/examples/application/cassandra/cassandra-service.yaml Validating (optional)Get the Cassandra Service.kubectl get svc cassandra The response isNAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE cassandra ClusterIP None <none> 9042/TCP 45s If you don't see a Service named cassandra, that means creation failed.


Question: What is Example: Deploying Cassandra with a StatefulSet?

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


Question: What is Note:?

Answer: C a s s a n d r a   a n d   K u b e r n e t e s   b o t h   u s e   t h e   t e r m   n o d e   t o   m e a n   a   m e m b e r   o f   a   c l u s t e r .   I n   t h i s   t u t o r i a l ,   t h e   P o d s   t h a t   b e l o n g   t o   t h e   S t a t e f u l S e t   a r e   C a s s a n d r a   n o d e s   a n d   a r e   m e m b e r s   o f   t h e   C a s s a n d r a   c l u s t e r   ( c a l l e d   a   r i n g ) .   W h e n   t h o s e   P o d s   r u n   i n   y o u r   K u b e r n e t e s   c l u s t e r ,   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   s c h e d u l e s   t h o s e   P o d s   o n t o   K u b e r n e t e s   N o d e s .   W h e n   a   C a s s a n d r a   n o d e   s t a r t s ,   i t   u s e s   a   s e e d   l i s t   t o   b o o t s t r a p   d i s c o v e r y   o f   o t h e r   n o d e s   i n   t h e   r i n g .   T h i s   t u t o r i a l   d e p l o y s   a   c u s t o m   C a s s a n d r a   s e e d   p r o v i d e r   t h a t   l e t s   t h e   d a t a b a s e   d i s c o v e r   n e w   C a s s a n d r a   P o d s   a s   t h e y   a p p e a r   i n s i d e   y o u r   K u b e r n e t e s   c l u s t e r .


Question: What is Objectives?

Answer: C r e a t e   a n d   v a l i d a t e   a   C a s s a n d r a   h e a d l e s s   S e r v i c e . U s e   a   S t a t e f u l S e t   t o   c r e a t e   a   C a s s a n d r a   r i n g . V a l i d a t e   t h e   S t a t e f u l S e t . M o d i f y   t h e   S t a t e f u l S e t . D e l e t e   t h e   S t a t e f u l S e t   a n d   i t s   P o d s .


Question: What is Before you begin?

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


Question: What is Caution:?

Answer: M i n i k u b e   d e f a u l t s   t o   2 0 4 8 M B   o f   m e m o r y   a n d   2   C P U .   R u n n i n g   M i n i k u b e   w i t h   t h e   d e f a u l t   r e s o u r c e   c o n f i g u r a t i o n   r e s u l t s   i n   i n s u f f i c i e n t   r e s o u r c e   e r r o r s   d u r i n g   t h i s   t u t o r i a l .   T o   a v o i d   t h e s e   e r r o r s ,   s t a r t   M i n i k u b e   w i t h   t h e   f o l l o w i n g   s e t t i n g s :   m i n i k u b e   s t a r t   - - m e m o r y   5 1 2 0   - - c p u s = 4


Question: What is Creating a headless Service for Cassandra?

Answer: I n   K u b e r n e t e s ,   a   S e r v i c e   d e s c r i b e s   a   s e t   o f   P o d s   t h a t   p e r f o r m   t h e   s a m e   t a s k .   T h e   f o l l o w i n g   S e r v i c e   i s   u s e d   f o r   D N S   l o o k u p s   b e t w e e n   C a s s a n d r a   P o d s   a n d   c l i e n t s   w i t h i n   y o u r   c l u s t e r :   a p i V e r s i o n :   v 1   k i n d :   S e r v i c e   m e t a d a t a :   l a b e l s :   a p p :   c a s s a n d r a   n a m e :   c a s s a n d r a   s p e c :   c l u s t e r I P :   N o n e   p o r t s :   -   p o r t :   9 0 4 2   s e l e c t o r :   a p p :   c a s s a n d r a   C r e a t e   a   S e r v i c e   t o   t r a c k   a l l   C a s s a n d r a   S t a t e f u l S e t   m e m b e r s   f r o m   t h e   c a s s a n d r a - s e r v i c e . y a m l   f i l e :   k u b e c t l   a p p l y   - f   h t t p s : / / k 8 s . i o / e x a m p l e s / a p p l i c a t i o n / c a s s a n d r a / c a s s a n d r a - s e r v i c e . y a m l


Question: What is Validating (optional)?

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


Question: What is Using a StatefulSet to create a Cassandra ring?

Answer: T h e   S t a t e f u l S e t   m a n i f e s t ,   i n c l u d e d   b e l o w ,   c r e a t e s   a   C a s s a n d r a   r i n g   t h a t   c o n s i s t s   o f   t h r e e   P o d s .


Question: What is Note:?

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


Question: What is Validating the Cassandra StatefulSet?

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


Question: What is Modifying the Cassandra StatefulSet?

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


Question: What is Cleaning up?

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


Question: What is Warning:?

Answer: R u n   t h e   f o l l o w i n g   c o m m a n d s   ( c h a i n e d   t o g e t h e r   i n t o   a   s i n g l e   c o m m a n d )   t o   d e l e t e   e v e r y t h i n g   i n   t h e   C a s s a n d r a   S t a t e f u l S e t : g r a c e = $ ( k u b e c t l   g e t   p o d   c a s s a n d r a - 0   - o = j s o n p a t h = ' { . s p e c . t e r m i n a t i o n G r a c e P e r i o d S e c o n d s } ' )   \   & &   k u b e c t l   d e l e t e   s t a t e f u l s e t   - l   a p p = c a s s a n d r a   \   & &   e c h o   " S l e e p i n g   $ { g r a c e }   s e c o n d s "   1 > & 2   \   & &   s l e e p   $ g r a c e   \   & &   k u b e c t l   d e l e t e   p e r s i s t e n t v o l u m e c l a i m   - l   a p p = c a s s a n d r a   R u n   t h e   f o l l o w i n g   c o m m a n d   t o   d e l e t e   t h e   S e r v i c e   y o u   s e t   u p   f o r   C a s s a n d r a : k u b e c t l   d e l e t e   s e r v i c e   - l   a p p = c a s s a n d r a   R u n   t h e   f o l l o w i n g   c o m m a n d s   ( c h a i n e d   t o g e t h e r   i n t o   a   s i n g l e   c o m m a n d )   t o   d e l e t e   e v e r y t h i n g   i n   t h e   C a s s a n d r a   S t a t e f u l S e t :   g r a c e = $ ( k u b e c t l   g e t   p o d   c a s s a n d r a - 0   - o = j s o n p a t h = ' { . s p e c . t e r m i n a t i o n G r a c e P e r i o d S e c o n d s } ' )   \   & &   k u b e c t l   d e l e t e   s t a t e f u l s e t   - l   a p p = c a s s a n d r a   \   & &   e c h o   " S l e e p i n g   $ { g r a c e }   s e c o n d s "   1 > & 2   \   & &   s l e e p   $ g r a c e   \   & &   k u b e c t l   d e l e t e   p e r s i s t e n t v o l u m e c l a i m   - l   a p p = c a s s a n d r a   R u n   t h e   f o l l o w i n g   c o m m a n d   t o   d e l e t e   t h e   S e r v i c e   y o u   s e t   u p   f o r   C a s s a n d r a :   k u b e c t l   d e l e t e   s e r v i c e   - l   a p p = c a s s a n d r a


Question: What is Cassandra container environment variables?

Answer: T h e   P o d s   i n   t h i s   t u t o r i a l   u s e   t h e   g c r . i o / g o o g l e - s a m p l e s / c a s s a n d r a : v 1 3   i m a g e   f r o m   G o o g l e ' s   c o n t a i n e r   r e g i s t r y .   T h e   D o c k e r   i m a g e   a b o v e   i s   b a s e d   o n   d e b i a n - b a s e   a n d   i n c l u d e s   O p e n J D K   8 .   T h i s   i m a g e   i n c l u d e s   a   s t a n d a r d   C a s s a n d r a   i n s t a l l a t i o n   f r o m   t h e   A p a c h e   D e b i a n   r e p o .   B y   u s i n g   e n v i r o n m e n t   v a r i a b l e s   y o u   c a n   c h a n g e   v a l u e s   t h a t   a r e   i n s e r t e d   i n t o   c a s s a n d r a . y a m l .


Question: What is What's next?

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


Question: What is CSINode?

Answer: CSINodeCSINode holds information about all CSI drivers installed on a node.apiVersion: storage.k8s.io/v1import "k8s.io/api/storage/v1"CSINodeCSINode holds information about all CSI drivers installed on a node. CSI drivers do not need to create the CSINode object directly. As long as they use the node-driver-registrar sidecar container, the kubelet will automatically populate the CSINode object for the CSI driver as part of kubelet plugin registration. CSINode has the same name as a node. If the object is missing, it means either there are no CSI Drivers available on the node, or the Kubelet version is low enough that it doesn't create this object. CSINode has an OwnerReference that points to the corresponding node object.apiVersion: storage.k8s.io/v1kind: CSINodemetadata (ObjectMeta)Standard object's metadata. metadata.name must be the Kubernetes node name.spec (CSINodeSpec), requiredspec is the specification of CSINodeCSINodeSpecCSINodeSpec holds information about the specification of all CSI drivers installed on a nodedrivers ([]CSINodeDriver), requiredPatch strategy: merge on key nameMap: unique values on key name will be kept during a mergedrivers is a list of information of all CSI Drivers existing on a node. If all drivers in the list are uninstalled, this can become empty.CSINodeDriver holds information about the specification of one CSI driver installed on a nodedrivers.name (string), requiredname represents the name of the CSI driver that this object refers to. This MUST be the same name returned by the CSI GetPluginName() call for that driver.drivers.nodeID (string), requirednodeID of the node from the driver point of view. This field enables Kubernetes to communicate with storage systems that do not share the same nomenclature for nodes. For example, Kubernetes may refer to a given node as "node1", but the storage system may refer to the same node as "nodeA". When Kubernetes issues a command to the storage system to attach a volume to a specific node, it can use this field to refer to the node name using the ID that the storage system will understand, e.g. "nodeA" instead of "node1". This field is required.drivers.allocatable (VolumeNodeResources)allocatable represents the volume resources of a node that are available for scheduling. This field is beta.VolumeNodeResources is a set of resource limits for scheduling of volumes.drivers.allocatable.count (int32)count indicates the maximum number of unique volumes managed by the CSI driver that can be used on a node. A volume that is both attached and mounted on a node is considered to be used once, not twice. The same rule applies for a unique volume that is shared among multiple pods on the same node. If this field is not specified, then the supported number of volumes on this node is unbounded.drivers.topologyKeys ([]string)Atomic: will be replaced during a mergetopologyKeys is the list of keys supported by the driver. When a driver is initialized on a cluster, it provides a set of topol


Question: How does CSINode work?

Answer: CSINodeCSINode holds information about all CSI drivers installed on a node.apiVersion: storage.k8s.io/v1import "k8s.io/api/storage/v1"CSINodeCSINode holds information about all CSI drivers installed on a node. CSI drivers do not need to create the CSINode object directly. As long as they use the node-driver-registrar sidecar container, the kubelet will automatically populate the CSINode object for the CSI driver as part of kubelet plugin registration. CSINode has the same name as a node. If the object is missing, it means either there are no CSI Drivers available on the node, or the Kubelet version is low enough that it doesn't create this object. CSINode has an OwnerReference that points to the corresponding node object.apiVersion: storage.k8s.io/v1kind: CSINodemetadata (ObjectMeta)Standard object's metadata. metadata.name must be the Kubernetes node name.spec (CSINodeSpec), requiredspec is the specification of CSINodeCSINodeSpecCSINodeSpec holds information about the specification of all CSI drivers installed on a nodedrivers ([]CSINodeDriver), requiredPatch strategy: merge on key nameMap: unique values on key name will be kept during a mergedrivers is a list of information of all CSI Drivers existing on a node. If all drivers in the list are uninstalled, this can become empty.CSINodeDriver holds information about the specification of one CSI driver installed on a nodedrivers.name (string), requiredname represents the name of the CSI driver that this object refers to. This MUST be the same name returned by the CSI GetPluginName() call for that driver.drivers.nodeID (string), requirednodeID of the node from the driver point of view. This field enables Kubernetes to communicate with storage systems that do not share the same nomenclature for nodes. For example, Kubernetes may refer to a given node as "node1", but the storage system may refer to the same node as "nodeA". When Kubernetes issues a command to the storage system to attach a volume to a specific node, it can use this field to refer to the node name using the ID that the storage system will understand, e.g. "nodeA" instead of "node1". This field is required.drivers.allocatable (VolumeNodeResources)allocatable represents the volume resources of a node that are available for scheduling. This field is beta.VolumeNodeResources is a set of resource limits for scheduling of volumes.drivers.allocatable.count (int32)count indicates the maximum number of unique volumes managed by the CSI driver that can be used on a node. A volume that is both attached and mounted on a node is considered to be used once, not twice. The same rule applies for a unique volume that is shared among multiple pods on the same node. If this field is not specified, then the supported number of volumes on this node is unbounded.drivers.topologyKeys ([]string)Atomic: will be replaced during a mergetopologyKeys is the list of keys supported by the driver. When a driver is initialized on a cluster, it provides a set of topol


Question: When would you use CSINode?

Answer: CSINodeCSINode holds information about all CSI drivers installed on a node.apiVersion: storage.k8s.io/v1import "k8s.io/api/storage/v1"CSINodeCSINode holds information about all CSI drivers installed on a node. CSI drivers do not need to create the CSINode object directly. As long as they use the node-driver-registrar sidecar container, the kubelet will automatically populate the CSINode object for the CSI driver as part of kubelet plugin registration. CSINode has the same name as a node. If the object is missing, it means either there are no CSI Drivers available on the node, or the Kubelet version is low enough that it doesn't create this object. CSINode has an OwnerReference that points to the corresponding node object.apiVersion: storage.k8s.io/v1kind: CSINodemetadata (ObjectMeta)Standard object's metadata. metadata.name must be the Kubernetes node name.spec (CSINodeSpec), requiredspec is the specification of CSINodeCSINodeSpecCSINodeSpec holds information about the specification of all CSI drivers installed on a nodedrivers ([]CSINodeDriver), requiredPatch strategy: merge on key nameMap: unique values on key name will be kept during a mergedrivers is a list of information of all CSI Drivers existing on a node. If all drivers in the list are uninstalled, this can become empty.CSINodeDriver holds information about the specification of one CSI driver installed on a nodedrivers.name (string), requiredname represents the name of the CSI driver that this object refers to. This MUST be the same name returned by the CSI GetPluginName() call for that driver.drivers.nodeID (string), requirednodeID of the node from the driver point of view. This field enables Kubernetes to communicate with storage systems that do not share the same nomenclature for nodes. For example, Kubernetes may refer to a given node as "node1", but the storage system may refer to the same node as "nodeA". When Kubernetes issues a command to the storage system to attach a volume to a specific node, it can use this field to refer to the node name using the ID that the storage system will understand, e.g. "nodeA" instead of "node1". This field is required.drivers.allocatable (VolumeNodeResources)allocatable represents the volume resources of a node that are available for scheduling. This field is beta.VolumeNodeResources is a set of resource limits for scheduling of volumes.drivers.allocatable.count (int32)count indicates the maximum number of unique volumes managed by the CSI driver that can be used on a node. A volume that is both attached and mounted on a node is considered to be used once, not twice. The same rule applies for a unique volume that is shared among multiple pods on the same node. If this field is not specified, then the supported number of volumes on this node is unbounded.drivers.topologyKeys ([]string)Atomic: will be replaced during a mergetopologyKeys is the list of keys supported by the driver. When a driver is initialized on a cluster, it provides a set of topol


Question: What are the benefits of CSINode?

Answer: CSINodeCSINode holds information about all CSI drivers installed on a node.apiVersion: storage.k8s.io/v1import "k8s.io/api/storage/v1"CSINodeCSINode holds information about all CSI drivers installed on a node. CSI drivers do not need to create the CSINode object directly. As long as they use the node-driver-registrar sidecar container, the kubelet will automatically populate the CSINode object for the CSI driver as part of kubelet plugin registration. CSINode has the same name as a node. If the object is missing, it means either there are no CSI Drivers available on the node, or the Kubelet version is low enough that it doesn't create this object. CSINode has an OwnerReference that points to the corresponding node object.apiVersion: storage.k8s.io/v1kind: CSINodemetadata (ObjectMeta)Standard object's metadata. metadata.name must be the Kubernetes node name.spec (CSINodeSpec), requiredspec is the specification of CSINodeCSINodeSpecCSINodeSpec holds information about the specification of all CSI drivers installed on a nodedrivers ([]CSINodeDriver), requiredPatch strategy: merge on key nameMap: unique values on key name will be kept during a mergedrivers is a list of information of all CSI Drivers existing on a node. If all drivers in the list are uninstalled, this can become empty.CSINodeDriver holds information about the specification of one CSI driver installed on a nodedrivers.name (string), requiredname represents the name of the CSI driver that this object refers to. This MUST be the same name returned by the CSI GetPluginName() call for that driver.drivers.nodeID (string), requirednodeID of the node from the driver point of view. This field enables Kubernetes to communicate with storage systems that do not share the same nomenclature for nodes. For example, Kubernetes may refer to a given node as "node1", but the storage system may refer to the same node as "nodeA". When Kubernetes issues a command to the storage system to attach a volume to a specific node, it can use this field to refer to the node name using the ID that the storage system will understand, e.g. "nodeA" instead of "node1". This field is required.drivers.allocatable (VolumeNodeResources)allocatable represents the volume resources of a node that are available for scheduling. This field is beta.VolumeNodeResources is a set of resource limits for scheduling of volumes.drivers.allocatable.count (int32)count indicates the maximum number of unique volumes managed by the CSI driver that can be used on a node. A volume that is both attached and mounted on a node is considered to be used once, not twice. The same rule applies for a unique volume that is shared among multiple pods on the same node. If this field is not specified, then the supported number of volumes on this node is unbounded.drivers.topologyKeys ([]string)Atomic: will be replaced during a mergetopologyKeys is the list of keys supported by the driver. When a driver is initialized on a cluster, it provides a set of topol


Question: What is CSINode?

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


Question: What is CSINode?

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


Question: What is CSINodeSpec?

Answer: C S I N o d e S p e c   h o l d s   i n f o r m a t i o n   a b o u t   t h e   s p e c i f i c a t i o n   o f   a l l   C S I   d r i v e r s   i n s t a l l e d   o n   a   n o d e   d r i v e r s   ( [ ] C S I N o d e D r i v e r ) ,   r e q u i r e d P a t c h   s t r a t e g y :   m e r g e   o n   k e y   n a m e M a p :   u n i q u e   v a l u e s   o n   k e y   n a m e   w i l l   b e   k e p t   d u r i n g   a   m e r g e d r i v e r s   i s   a   l i s t   o f   i n f o r m a t i o n   o f   a l l   C S I   D r i v e r s   e x i s t i n g   o n   a   n o d e .   I f   a l l   d r i v e r s   i n   t h e   l i s t   a r e   u n i n s t a l l e d ,   t h i s   c a n   b e c o m e   e m p t y . C S I N o d e D r i v e r   h o l d s   i n f o r m a t i o n   a b o u t   t h e   s p e c i f i c a t i o n   o f   o n e   C S I   d r i v e r   i n s t a l l e d   o n   a   n o d e d r i v e r s . n a m e   ( s t r i n g ) ,   r e q u i r e d n a m e   r e p r e s e n t s   t h e   n a m e   o f   t h e   C S I   d r i v e r   t h a t   t h i s   o b j e c t   r e f e r s   t o .   T h i s   M U S T   b e   t h e   s a m e   n a m e   r e t u r n e d   b y   t h e   C S I   G e t P l u g i n N a m e ( )   c a l l   f o r   t h a t   d r i v e r . d r i v e r s . n o d e I D   ( s t r i n g ) ,   r e q u i r e d n o d e I D   o f   t h e   n o d e   f r o m   t h e   d r i v e r   p o i n t   o f   v i e w .   T h i s   f i e l d   e n a b l e s   K u b e r n e t e s   t o   c o m m u n i c a t e   w i t h   s t o r a g e   s y s t e m s   t h a t   d o   n o t   s h a r e   t h e   s a m e   n o m e n c l a t u r e   f o r   n o d e s .   F o r   e x a m p l e ,   K u b e r n e t e s   m a y   r e f e r   t o   a   g i v e n   n o d e   a s   " n o d e 1 " ,   b u t   t h e   s t o r a g e   s y s t e m   m a y   r e f e r   t o   t h e   s a m e   n o d e   a s   " n o d e A " .   W h e n   K u b e r n e t e s   i s s u e s   a   c o m m a n d   t o   t h e


Question: What is CSINodeList?

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


Question: What is HTTP Request?

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


Question: What is Parameters?

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


Question: What is Response?

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


Question: What is HTTP Request?

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


Question: What is Parameters?

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


Question: What is Response?

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


Question: What is HTTP Request?

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


Question: What is Parameters?

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


Question: What is Response?

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


Question: What is HTTP Request?

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


Question: What is Parameters?

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


Question: What is Response?

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


Question: What is HTTP Request?

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


Question: What is Parameters?

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


Question: What is Response?

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


Question: What is HTTP Request?

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


Question: What is Parameters?

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


Question: What is Response?

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


Question: What is HTTP Request?

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


Question: What is Parameters?

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


Question: What is Response?

Answer: 2 0 0   ( S t a t u s ) :   O K   4 0 1 :   U n a u t h o r i z e d   T h i s   p a g e   i s   a u t o m a t i c a l l y   g e n e r a t e d .   I f   y o u   p l a n   t o   r e p o r t   a n   i s s u e   w i t h   t h i s   p a g e ,   m e n t i o n   t h a t   t h e   p a g e   i s   a u t o - g e n e r a t e d   i n   y o u r   i s s u e   d e s c r i p t i o n .   T h e   f i x   m a y   n e e d   t o   h a p p e n   e l s e w h e r e   i n   t h e   K u b e r n e t e s   p r o j e c t .


Question: What is Operator pattern?

Answer: Operator patternOperators are software extensions to Kubernetes that make use of custom resources to manage applications and their components. Operators follow Kubernetes principles, notably the control loop.MotivationThe operator pattern aims to capture the key aim of a human operator who is managing a service or set of services. Human operators who look after specific applications and services have deep knowledge of how the system ought to behave, how to deploy it, and how to react if there are problems.People who run workloads on Kubernetes often like to use automation to take care of repeatable tasks. The operator pattern captures how you can write code to automate a task beyond what Kubernetes itself provides.Operators in KubernetesKubernetes is designed for automation. Out of the box, you get lots of built-in automation from the core of Kubernetes. You can use Kubernetes to automate deploying and running workloads, and you can automate how Kubernetes does that.Kubernetes' operator pattern concept lets you extend the cluster's behaviour without modifying the code of Kubernetes itself by linking controllers to one or more custom resources. Operators are clients of the Kubernetes API that act as controllers for a Custom Resource.An example operatorSome of the things that you can use an operator to automate include:deploying an application on demandtaking and restoring backups of that application's statehandling upgrades of the application code alongside related changes such as database schemas or extra configuration settingspublishing a Service to applications that don't support Kubernetes APIs to discover themsimulating failure in all or part of your cluster to test its resiliencechoosing a leader for a distributed application without an internal member election processWhat might an operator look like in more detail? Here's an example:A custom resource named SampleDB, that you can configure into the cluster.A Deployment that makes sure a Pod is running that contains the controller part of the operator.A container image of the operator code.Controller code that queries the control plane to find out what SampleDB resources are configured.The core of the operator is code to tell the API server how to make reality match the configured resources.If you add a new SampleDB, the operator sets up PersistentVolumeClaims to provide durable database storage, a StatefulSet to run SampleDB and a Job to handle initial configuration.If you delete it, the operator takes a snapshot, then makes sure that the StatefulSet and Volumes are also removed.The operator also manages regular database backups. For each SampleDB resource, the operator determines when to create a Pod that can connect to the database and take backups. These Pods would rely on a ConfigMap and / or a Secret that has database connection details and credentials.Because the operator aims to provide robust automation for the resource it manages, there would be additional supporting code. For this


Question: How does Operator pattern work?

Answer: Operator patternOperators are software extensions to Kubernetes that make use of custom resources to manage applications and their components. Operators follow Kubernetes principles, notably the control loop.MotivationThe operator pattern aims to capture the key aim of a human operator who is managing a service or set of services. Human operators who look after specific applications and services have deep knowledge of how the system ought to behave, how to deploy it, and how to react if there are problems.People who run workloads on Kubernetes often like to use automation to take care of repeatable tasks. The operator pattern captures how you can write code to automate a task beyond what Kubernetes itself provides.Operators in KubernetesKubernetes is designed for automation. Out of the box, you get lots of built-in automation from the core of Kubernetes. You can use Kubernetes to automate deploying and running workloads, and you can automate how Kubernetes does that.Kubernetes' operator pattern concept lets you extend the cluster's behaviour without modifying the code of Kubernetes itself by linking controllers to one or more custom resources. Operators are clients of the Kubernetes API that act as controllers for a Custom Resource.An example operatorSome of the things that you can use an operator to automate include:deploying an application on demandtaking and restoring backups of that application's statehandling upgrades of the application code alongside related changes such as database schemas or extra configuration settingspublishing a Service to applications that don't support Kubernetes APIs to discover themsimulating failure in all or part of your cluster to test its resiliencechoosing a leader for a distributed application without an internal member election processWhat might an operator look like in more detail? Here's an example:A custom resource named SampleDB, that you can configure into the cluster.A Deployment that makes sure a Pod is running that contains the controller part of the operator.A container image of the operator code.Controller code that queries the control plane to find out what SampleDB resources are configured.The core of the operator is code to tell the API server how to make reality match the configured resources.If you add a new SampleDB, the operator sets up PersistentVolumeClaims to provide durable database storage, a StatefulSet to run SampleDB and a Job to handle initial configuration.If you delete it, the operator takes a snapshot, then makes sure that the StatefulSet and Volumes are also removed.The operator also manages regular database backups. For each SampleDB resource, the operator determines when to create a Pod that can connect to the database and take backups. These Pods would rely on a ConfigMap and / or a Secret that has database connection details and credentials.Because the operator aims to provide robust automation for the resource it manages, there would be additional supporting code. For this