Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
9b6f9f1
init common-scheduler-extender
krpsh123 Nov 13, 2025
0312560
add cert to sds-common-scheduler-extender
krpsh123 Nov 13, 2025
99bc4b6
add a comment to failurePolicy
krpsh123 Nov 13, 2025
91db1be
minor changes
krpsh123 Nov 13, 2025
d304c3d
add http.StatusOK
krpsh123 Nov 13, 2025
55417ee
update access_log
krpsh123 Nov 13, 2025
b90bf4e
cosmetic
krpsh123 Nov 14, 2025
9ce2254
update logger
krpsh123 Nov 17, 2025
fb9ed54
update internal server error
krpsh123 Nov 17, 2025
b694675
filter_test
krpsh123 Nov 19, 2025
6282af5
refactor filter
krpsh123 Nov 19, 2025
ca07d74
refactor prioritize
krpsh123 Nov 19, 2025
ce64dd8
fix the pkg import
krpsh123 Nov 19, 2025
f5b7362
cosmetic
krpsh123 Nov 19, 2025
7ea5e03
add useLinstor
krpsh123 Nov 20, 2025
ab11dab
move the extractRequestedSize
krpsh123 Nov 20, 2025
c5ea305
refactor the extractRequestedSize
krpsh123 Nov 20, 2025
486e3ee
fix useLinstor
krpsh123 Nov 20, 2025
469ca04
refactor the cache
krpsh123 Nov 21, 2025
349ff4f
refactor cache_test.go
krpsh123 Nov 21, 2025
97064b1
fix url /stat
krpsh123 Nov 21, 2025
74bf68d
add the total number of reserved in url /stat
krpsh123 Nov 21, 2025
c291d44
remove shouldProcessPod and filterNotManagedPVC
krpsh123 Nov 22, 2025
7f7656f
fix the trace msg about managed PVC
krpsh123 Nov 23, 2025
e52c5a5
rename api
krpsh123 Nov 24, 2025
fa51a30
some refactoring
krpsh123 Nov 24, 2025
2d12194
filterNodes: some refactoring
krpsh123 Nov 24, 2025
9287bff
delete getCommonNodesByStorageClasses
krpsh123 Nov 25, 2025
86e1f76
fix the thin volumes
krpsh123 Nov 26, 2025
fc40475
some refactoring
krpsh123 Nov 26, 2025
7bfb807
add TODO
krpsh123 Nov 26, 2025
86fb23a
minor fixes
AleksZimin Nov 27, 2025
caaa83e
refactor existing code
AleksZimin Nov 27, 2025
893dc69
fix tests
AleksZimin Nov 27, 2025
a97ee60
add env
AleksZimin Nov 27, 2025
5fba543
add endpoint
AleksZimin Nov 27, 2025
50f5605
add logging
AleksZimin Nov 27, 2025
5cd1e58
case insensitive type
AleksZimin Nov 28, 2025
36a0d46
improve logging
AleksZimin Nov 28, 2025
9abd263
rework cache clear
AleksZimin Nov 30, 2025
301b794
add traceid
AleksZimin Nov 30, 2025
941e783
add replicated
AleksZimin Nov 30, 2025
381f7bd
test change
AleksZimin Dec 22, 2025
d26ba21
[CRD] udate the regexp for actualLVNameOnTheNode
krpsh123 Dec 26, 2025
0220472
trigger for build
krpsh123 Jan 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,7 @@ images/agent/dev
images/agent/Makefile
local_build.sh
/base_images.yml

images/sds-common-scheduler-extender/REVIEW.md

# trigger for build
18 changes: 18 additions & 0 deletions api/v1alpha1/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,22 @@ const (
BlockDeviceRotaLabelKey = blockDeviceLabelPrefix + "/rota"
BlockDeviceHotPlugLabelKey = blockDeviceLabelPrefix + "/hotplug"
BlockDeviceMachineIDLabelKey = blockDeviceLabelPrefix + "/machineid"

// ReplicatedStorageClass VolumeAccess modes
VolumeAccessLocal = "Local"
VolumeAccessEventuallyLocal = "EventuallyLocal"
VolumeAccessPreferablyLocal = "PreferablyLocal"
VolumeAccessAny = "Any"

// ReplicatedStorageClass Topology modes
TopologyTransZonal = "TransZonal"
TopologyZonal = "Zonal"
TopologyIgnored = "Ignored"

// ReplicatedStoragePool Types
RSPTypeLVM = "LVM" // Thick volumes
RSPTypeLVMThin = "LVMThin" // Thin volumes

// Labels for replicated volumes
LabelReplicatedNode = "storage.deckhouse.io/sds-replicated-volume-node"
)
4 changes: 4 additions & 0 deletions api/v1alpha1/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ var knownTypes = []runtime.Object{
&LVMVolumeGroupSetList{},
&LVMLogicalVolumeSnapshot{},
&LVMLogicalVolumeSnapshotList{},
&ReplicatedStorageClass{},
&ReplicatedStorageClassList{},
&ReplicatedStoragePool{},
&ReplicatedStoragePoolList{},
}

// Adds the list of known types to Scheme.
Expand Down
158 changes: 158 additions & 0 deletions api/v1alpha1/replicated_storage_class.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
/*
Copyright 2025 Flant JSC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package v1alpha1

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
)

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type ReplicatedStorageClassList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`

Items []ReplicatedStorageClass `json:"items"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type ReplicatedStorageClass struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec ReplicatedStorageClassSpec `json:"spec"`
Status ReplicatedStorageClassStatus `json:"status,omitempty"`
}

// +k8s:deepcopy-gen=true
type ReplicatedStorageClassSpec struct {
// StoragePool is the name of the ReplicatedStoragePool resource
StoragePool string `json:"storagePool"`
// ReclaimPolicy defines what happens to the volume when the PVC is deleted (Delete or Retain)
ReclaimPolicy string `json:"reclaimPolicy"`
// Replication mode: None, Availability, ConsistencyAndAvailability
Replication string `json:"replication,omitempty"`
// VolumeAccess mode: Local, EventuallyLocal, PreferablyLocal, Any
VolumeAccess string `json:"volumeAccess,omitempty"`
// Topology mode: TransZonal, Zonal, Ignored
Topology string `json:"topology"`
// Zones is the list of zones where volumes should be replicated
Zones []string `json:"zones,omitempty"`
}

// +k8s:deepcopy-gen=true
type ReplicatedStorageClassStatus struct {
// Phase is the current state: Failed, Created
Phase string `json:"phase,omitempty"`
// Reason provides additional information about the current state
Reason string `json:"reason,omitempty"`
}

// DeepCopyInto copies the receiver into out
func (in *ReplicatedStorageClass) DeepCopyInto(out *ReplicatedStorageClass) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
out.Status = in.Status
}

// DeepCopy creates a deep copy of ReplicatedStorageClass
func (in *ReplicatedStorageClass) DeepCopy() *ReplicatedStorageClass {
if in == nil {
return nil
}
out := new(ReplicatedStorageClass)
in.DeepCopyInto(out)
return out
}

// DeepCopyObject creates a deep copy as runtime.Object
func (in *ReplicatedStorageClass) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}

// DeepCopyInto copies the receiver into out
func (in *ReplicatedStorageClassList) DeepCopyInto(out *ReplicatedStorageClassList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]ReplicatedStorageClass, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}

// DeepCopy creates a deep copy of ReplicatedStorageClassList
func (in *ReplicatedStorageClassList) DeepCopy() *ReplicatedStorageClassList {
if in == nil {
return nil
}
out := new(ReplicatedStorageClassList)
in.DeepCopyInto(out)
return out
}

// DeepCopyObject creates a deep copy as runtime.Object
func (in *ReplicatedStorageClassList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}

// DeepCopyInto copies the receiver into out
func (in *ReplicatedStorageClassSpec) DeepCopyInto(out *ReplicatedStorageClassSpec) {
*out = *in
if in.Zones != nil {
in, out := &in.Zones, &out.Zones
*out = make([]string, len(*in))
copy(*out, *in)
}
}

// DeepCopy creates a deep copy of ReplicatedStorageClassSpec
func (in *ReplicatedStorageClassSpec) DeepCopy() *ReplicatedStorageClassSpec {
if in == nil {
return nil
}
out := new(ReplicatedStorageClassSpec)
in.DeepCopyInto(out)
return out
}

// DeepCopyInto copies the receiver into out
func (in *ReplicatedStorageClassStatus) DeepCopyInto(out *ReplicatedStorageClassStatus) {
*out = *in
}

// DeepCopy creates a deep copy of ReplicatedStorageClassStatus
func (in *ReplicatedStorageClassStatus) DeepCopy() *ReplicatedStorageClassStatus {
if in == nil {
return nil
}
out := new(ReplicatedStorageClassStatus)
in.DeepCopyInto(out)
return out
}

173 changes: 173 additions & 0 deletions api/v1alpha1/replicated_storage_pool.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
/*
Copyright 2025 Flant JSC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package v1alpha1

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
)

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type ReplicatedStoragePoolList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`

Items []ReplicatedStoragePool `json:"items"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type ReplicatedStoragePool struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec ReplicatedStoragePoolSpec `json:"spec"`
Status ReplicatedStoragePoolStatus `json:"status,omitempty"`
}

// +k8s:deepcopy-gen=true
type ReplicatedStoragePoolSpec struct {
// Type defines the volumes type: LVM (for Thick) or LVMThin (for Thin)
Type string `json:"type"`
// LvmVolumeGroups is the list of LVMVolumeGroup resources used for storage
LvmVolumeGroups []ReplicatedStoragePoolLVG `json:"lvmVolumeGroups"`
}

// +k8s:deepcopy-gen=true
type ReplicatedStoragePoolLVG struct {
// Name is the LVMVolumeGroup resource name
Name string `json:"name"`
// ThinPoolName is the thin pool name (required for LVMThin type)
ThinPoolName string `json:"thinPoolName,omitempty"`
}

// +k8s:deepcopy-gen=true
type ReplicatedStoragePoolStatus struct {
// Phase is the current state: Updating, Failed, Completed
Phase string `json:"phase,omitempty"`
// Reason provides additional information about the current state
Reason string `json:"reason,omitempty"`
}

// DeepCopyInto copies the receiver into out
func (in *ReplicatedStoragePool) DeepCopyInto(out *ReplicatedStoragePool) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
out.Status = in.Status
}

// DeepCopy creates a deep copy of ReplicatedStoragePool
func (in *ReplicatedStoragePool) DeepCopy() *ReplicatedStoragePool {
if in == nil {
return nil
}
out := new(ReplicatedStoragePool)
in.DeepCopyInto(out)
return out
}

// DeepCopyObject creates a deep copy as runtime.Object
func (in *ReplicatedStoragePool) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}

// DeepCopyInto copies the receiver into out
func (in *ReplicatedStoragePoolList) DeepCopyInto(out *ReplicatedStoragePoolList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]ReplicatedStoragePool, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}

// DeepCopy creates a deep copy of ReplicatedStoragePoolList
func (in *ReplicatedStoragePoolList) DeepCopy() *ReplicatedStoragePoolList {
if in == nil {
return nil
}
out := new(ReplicatedStoragePoolList)
in.DeepCopyInto(out)
return out
}

// DeepCopyObject creates a deep copy as runtime.Object
func (in *ReplicatedStoragePoolList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}

// DeepCopyInto copies the receiver into out
func (in *ReplicatedStoragePoolSpec) DeepCopyInto(out *ReplicatedStoragePoolSpec) {
*out = *in
if in.LvmVolumeGroups != nil {
in, out := &in.LvmVolumeGroups, &out.LvmVolumeGroups
*out = make([]ReplicatedStoragePoolLVG, len(*in))
copy(*out, *in)
}
}

// DeepCopy creates a deep copy of ReplicatedStoragePoolSpec
func (in *ReplicatedStoragePoolSpec) DeepCopy() *ReplicatedStoragePoolSpec {
if in == nil {
return nil
}
out := new(ReplicatedStoragePoolSpec)
in.DeepCopyInto(out)
return out
}

// DeepCopyInto copies the receiver into out
func (in *ReplicatedStoragePoolLVG) DeepCopyInto(out *ReplicatedStoragePoolLVG) {
*out = *in
}

// DeepCopy creates a deep copy of ReplicatedStoragePoolLVG
func (in *ReplicatedStoragePoolLVG) DeepCopy() *ReplicatedStoragePoolLVG {
if in == nil {
return nil
}
out := new(ReplicatedStoragePoolLVG)
in.DeepCopyInto(out)
return out
}

// DeepCopyInto copies the receiver into out
func (in *ReplicatedStoragePoolStatus) DeepCopyInto(out *ReplicatedStoragePoolStatus) {
*out = *in
}

// DeepCopy creates a deep copy of ReplicatedStoragePoolStatus
func (in *ReplicatedStoragePoolStatus) DeepCopy() *ReplicatedStoragePoolStatus {
if in == nil {
return nil
}
out := new(ReplicatedStoragePoolStatus)
in.DeepCopyInto(out)
return out
}

2 changes: 1 addition & 1 deletion crds/lvmlogicalvolume.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ spec:
- rule: self == oldSelf
message: Value is immutable.
minLength: 1
pattern: '^[a-z0-9]([a-z0-9-.]{0,251}[a-z0-9])?$'
pattern: '^[a-z0-9]([a-z0-9-._]{0,251}[a-z0-9])?$'
type:
type: string
description: |
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ The `sds-node-configurator` module manages block devices and LVM on Kubernetes c
- [Custom Resources](./cr.html): Module CRD reference.
- [Configuration](./configuration.html): Module parameter configuration.
- [Configuration scenarios](./layouts.html): Typical disk subsystem configuration scenarios for various storage configurations.
- [FAQ](./faq.html): Frequently asked questions and answers.
- [FAQ](./faq.html): Frequently asked questions and answers.
Loading
Loading