Kubernetes StatefulSet: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 23: Line 23:
Because persistent volume claims map to persistent volumes one-to-one, and each pod of a StatefulSet needs its dedicated, separate storage, each pod of a StatefulSet needs to reference a different persistent volume claim to have its own separate persistent volume. The StatefulSet achieves this behavior by creating persistent volume claims alongside pods, based on a persistent volume claim template.
Because persistent volume claims map to persistent volumes one-to-one, and each pod of a StatefulSet needs its dedicated, separate storage, each pod of a StatefulSet needs to reference a different persistent volume claim to have its own separate persistent volume. The StatefulSet achieves this behavior by creating persistent volume claims alongside pods, based on a persistent volume claim template.


<font color=darkgray>TODO: [[Kubernetes_StatefulSet_Manifest#volumeClaimTemplates]].</font>
===Labels on a Persistent Volume Claim created from the Persistent Volume Claim Template===


===Labels on a Persistent Volume Claim created from the Persistent Volume Claim Template===
===Persistent Volume Claim Template Manifest===
{{Internal|Kubernetes_StatefulSet_Manifest#volumeClaimTemplates|StatefulSet Manifest}}


=Operations=
=Operations=
{{Internal|Kubernetes StatefulSet Operations|StatefulSet Operations}}
{{Internal|Kubernetes StatefulSet Operations|StatefulSet Operations}}

Revision as of 20:26, 17 March 2020

External

Internal

Overview

Used for stateful application components, where the application component relies on access to "stable" file storage to maintain state between restarts. As such, local volumes that are directly attached to node hosts, can be used. A StatefulSet and the individual pods the StatefulSet manages are registered with the cluster's DNS service.

A stateful set makes sure pods are rescheduled in such a way that they retain their identity and state.

The StatefulSet creates PersistentVolumeClaims in a manner similar to the one in which it creates pods. More details in StatefulSet Storage below.

StatefulSet Manifest

StatefulSet Manifest

StatefulSet Storage

Persistent Volume Claim Template

Because persistent volume claims map to persistent volumes one-to-one, and each pod of a StatefulSet needs its dedicated, separate storage, each pod of a StatefulSet needs to reference a different persistent volume claim to have its own separate persistent volume. The StatefulSet achieves this behavior by creating persistent volume claims alongside pods, based on a persistent volume claim template.

Labels on a Persistent Volume Claim created from the Persistent Volume Claim Template

Persistent Volume Claim Template Manifest

StatefulSet Manifest

Operations

StatefulSet Operations