Piraeus Operator
repository·v2·Indexed 19 days ago
https://github.com/piraeusdatastore/piraeus-operatorA Kubernetes operator for managing LINSTOR clusters, automating the deployment and management of the LINSTOR software stack, including DRBD, the LINSTOR CSI driver, and the LINSTOR High-Availability Controller. It provides dynamic provisioning and high-availability for Kubernetes Local Persistent Volumes across various distributions including OpenShift, Talos Linux, and MicroK8s.
What's inside piraeus-operator
- Piraeus is a cloud-native storage system designed for Kubernetes. It provides dynamic provisioning, resource management, and high-availability for Kubernetes Local Persistent Volumes. It is designed to deploy and scale automatically within Kubernetes nodes, allowing workloads to consume high-performance local storage using standard Kubernetes volume APIs.
Explore Piraeus Datastore concepts and components
v2To understand the architecture and operational logic of Piraeus Datastore, refer to the following conceptual guides:
- Understanding Piraeus Datastore Components: Provides a short introduction to every individual component within the Piraeus Datastore ecosystem.
- How Piraeus Operator Selects Image Versions for Deployed Resources: Explains the image configuration format, the selection process used by the operator, and how to influence or override image versions.
- Satellite Deletion Policies: Details the various deletion policies available for Satellites in Piraeus Datastore.
What is the DRBD Module Loader?
v2The DRBD Module Loader is a component responsible for making the DRBD kernel module available and loading other essential kernel modules required for Piraeus functionality.
When active, it attempts to load the following modules if they are available on the host:
Module Purpose libcrc32cdependency for DRBD nvmet_rdma,nvme_rdmaLINSTOR NVME layer loopLINSTOR when using loop devices as backing disks dm_writecacheLINSTOR writecache layer dm_cacheLINSTOR cache layer dm_thin_poolLINSTOR thin-provisioned storage dm_snapshotLINSTOR Snapshots dm_cryptLINSTOR encrypted volumes How the LINSTOR CSI NFS Server enables ReadWriteMany
v2The
linstor-csi-nfs-serverPods provideReadWriteMany(RWX) support by exporting LINSTOR volumes via NFS.Key Features:
- Deployment: Deployed as a DaemonSet on every node by default.
- High Availability: Uses DRBD Reactor to ensure high availability of NFS exports in case of node failures.
- Placement: NFS exports can run on any node that currently holds a replica of the volume.
Manage the LINSTOR cluster state with LinstorCluster
v2TheLinstorClusterresource is used to control the overall state of the LINSTOR® cluster and its integration with Kubernetes. Modifying this resource allows you to change the cluster configuration and behavior.How the Piraeus High Availability Controller speeds up failover
v2The
ha-controlleris designed to accelerate the failover process for stateful workloads using Piraeus storage.Operation:
- It is deployed on every node in the cluster.
- It listens for DRBD® events to detect storage failures on other nodes.
- When a failure is detected, it automatically evicts Pods that are using the inaccessible storage, allowing Kubernetes to reschedule them elsewhere.
Understand how Piraeus Operator selects image versions
v2The Piraeus Operator uses a default configuration to select component images, typically using the latest versions available at the time of the Operator's release. This configuration is stored in a ConfigMap named
piraeus-operator-image-configand contains two primary YAML documents:0_piraeus_datastore_images.yaml: Contains image configurations for all Piraeus Datastore components.0_sig_storage_images.yaml: Contains image configurations for Kubernetes CSI components.
Images are constructed using a
baseregistry, a componentimagename, and either atagor adigest(which takes precedence).How piraeus-operator-gencert manages TLS certificates
v2The
piraeus-operator-gencertcomponent manages the TLS lifecycle for the Piraeus Operator. It creates and maintains the TLS key and certificate required for the Operator to serve its validation endpoint for custom resources.Key details:
- TLS Secret: The generated certificate is stored in a Kubernetes secret named
webhook-server-cert. This secret is a prerequisite for starting thepiraeus-operatorPod. - Webhook Management: This component also keeps the
ValidatingWebhookConfigurationfor the Piraeus Operator up-to-date. - Dependency Reduction: This component was introduced to remove the dependency on
cert-managerfor Piraeus deployments.
- TLS Secret: The generated certificate is stored in a Kubernetes secret named
What are Consistency Groups in Piraeus Datastore
v2Consistency groups allow you to combine multiple volumes into a single LINSTOR® resource. This ensures that replicas and snapshots always present a consistent view of the entire set of volumes.
By default, every
PersistentVolumeis a separate LINSTOR resource replicated independently. This can lead to data inconsistency during fail-overs if one volume is up-to-date while another is outdated.Key benefits of Consistency Groups:
- Atomic Replication: All
PersistentVolumeClaimssharing alinstor.csi.linbit.com/consistency-grouplabel share one replication connection and one replication state. - Consistent Placement: All members of a group are always placed on the same set of nodes.
- Atomic Snapshots: Snapshots of group members are captured simultaneously as a single LINSTOR snapshot, ensuring every volume is at the same point in time.
- Atomic Replication: All
Integrate Satellite evacuation with ClusterAPI
v2Piraeus Datastore automatically detects ClusterAPI by looking for
cluster.x-k8s.io/machineandcluster.x-k8s.io/cluster-namespaceannotations.When using the
Evacuatepolicy, Piraeus uses Machine deletion hooks to ensure the Machine remains running until all LINSTOR resources are safely evacuated. This process respects theLinstorCluster.spec.maxConcurrentEvacuationssetting; if the limit is reached, the Machine's pre-drain hook remains in place, preventing ClusterAPI from proceeding with the node removal until an evacuation slot becomes available.Manage LINSTOR node connections with LinstorNodeConnection
v2TheLinstorNodeConnectionresource is used to control the state of LINSTOR® node connections within the cluster.How LINSTOR Satellites manage local storage
v2The
linstor-satelliteis a stateless service that runs on every node as a DaemonSet. It acts as the local configuration agent for LINSTOR managed storage on that specific node.Key Operational Details:
- Privileged Access: Satellites are deployed as privileged containers to interact directly with the host operating system.
- Network Namespace: Any DRBD® device inherits the network namespace of the Satellite Pod. If Satellites are not using host networking, DRBD will be unable to replicate data without a running Satellite Pod.
- UTS Namespace: The Satellite process is spawned in a separate UTS namespace. This ensures that DRBD tools always report the Kubernetes node name as the hostname, even if the Pod name is different. This is transparent to users; running
kubectl execinto a satellite Pod allows you to rundrbdadmcommands as expected.