-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[controller] Add LVMVolumeGroupSet (#99)
Signed-off-by: Viktor Kramarenko <[email protected]> Co-authored-by: Aleksandr Zimin <[email protected]>
- Loading branch information
1 parent
3e41c48
commit c02b44d
Showing
23 changed files
with
912 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* | ||
Copyright 2024 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" | ||
) | ||
|
||
type LVMVolumeGroupSetList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata"` | ||
|
||
Items []LVMVolumeGroupSet `json:"items"` | ||
} | ||
|
||
type LVMVolumeGroupSet struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec LVMVolumeGroupSetSpec `json:"spec"` | ||
Status LVMVolumeGroupSetStatus `json:"status,omitempty"` | ||
} | ||
|
||
type LVMVolumeGroupSetSpec struct { | ||
NodeSelector *metav1.LabelSelector `json:"nodeSelector"` | ||
LVGTemplate LVMVolumeGroupTemplate `json:"lvmVolumeGroupTemplate"` | ||
Strategy string `json:"strategy"` | ||
} | ||
type LVMVolumeGroupTemplate struct { | ||
Metadata LVMVolumeGroupTemplateMeta `json:"metadata"` | ||
BlockDeviceSelector *metav1.LabelSelector `json:"blockDeviceSelector"` | ||
ActualVGNameOnTheNode string `json:"actualVGNameOnTheNode"` | ||
ThinPools []LVMVolumeGroupThinPoolSpec `json:"thinPools"` | ||
Type string `json:"type"` | ||
} | ||
|
||
type LVMVolumeGroupTemplateMeta struct { | ||
Labels map[string]string `json:"labels"` | ||
} | ||
|
||
type LVMVolumeGroupSetStatus struct { | ||
CreatedLVGs []LVMVolumeGroupSetStatusLVG `json:"createdLVMVolumeGroups"` | ||
CurrentLVMVolumeGroupsCount int `json:"currentLVMVolumeGroupsCount"` | ||
DesiredLVMVolumeGroupsCount int `json:"desiredLVMVolumeGroupsCount"` | ||
Phase string `json:"phase"` | ||
Reason string `json:"reason"` | ||
} | ||
|
||
type LVMVolumeGroupSetStatusLVG struct { | ||
LVMVolumeGroupName string `json:"lvmVolumeGroupName"` | ||
NodeName string `json:"nodeName"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
spec: | ||
versions: | ||
- name: v1alpha1 | ||
schema: | ||
openAPIV3Schema: | ||
description: | | ||
Интерфейс для одновременного создания нескольких LVMVolumeGroup ресурсов по общему шаблону. | ||
properties: | ||
spec: | ||
properties: | ||
strategy: | ||
description: | | ||
Стратегия (правила) создания LVMVolumeGroup ресурсов по текущему ресурсу. | ||
nodeSelector: | ||
description: | | ||
Желаемый selector для узлов, которые будут использованы LVMVolumeGroup ресурсами. | ||
properties: | ||
matchLabels: | ||
description: | | ||
Желаемые метки. | ||
matchExpressions: | ||
description: | | ||
Желаемые выражения. | ||
lvmVolumeGroupTemplate: | ||
description: | | ||
Общий шаблон для LVMVolumeGroup ресурсов, созданных с помощью данного ресурса. | ||
properties: | ||
blockDeviceSelector: | ||
description: | | ||
Желаемый селектор для BlockDevice ресурсов, используемый в LVMVolumeGroup ресурсах. | ||
properties: | ||
matchLabels: | ||
description: | | ||
Желаемые метки. | ||
matchExpressions: | ||
description: | | ||
Желаемые выражения. | ||
metadata: | ||
description: | | ||
Метаинформация для LVMVolumeGroup ресурсов. | ||
properties: | ||
labels: | ||
description: | | ||
Обязательные метки для LVMVolumeGroup ресурсов. | ||
type: | ||
description: | | ||
Тип Volume Group. Может быть: | ||
- Local, то есть локальным, если используемые девайсы не являются распределенными (не Shared LUN). | ||
actualVGNameOnTheNode: | ||
description: | | ||
Желаемое имя для Volume Group. Должно быть уникальным в рамках узла, на котором будет располагаться. | ||
> Неизменяемое поле. | ||
> Обратите внимание, что указанное имя Volume Group будет одинаковым для каждого LVMVolumeGroup ресурса. | ||
thinPools: | ||
description: | | ||
Желаемая конфигурация для Thin-pool'ов текущей Volume Group. | ||
> Обратите внимание, что данная конфигурация будет одинаковой для каждого LVMVolumeGroup ресурса. | ||
items: | ||
properties: | ||
name: | ||
description: | | ||
Желаемое имя thin pool. | ||
> Неизменяемое поле. | ||
size: | ||
description: | | ||
Желаемый размер thin pool. Может быть указан как в численном, так и процентном отношении к общему размеру VG. | ||
> Обратите внимание, что при указании размера в процентах thin pool будет автоматически расширен при расширении VG. | ||
allocationLimit: | ||
description: | | ||
Максимальная степень расширения thin pool-а. По умолчанию 150%. | ||
status: | ||
type: object | ||
properties: | ||
createdLVMVolumeGroups: | ||
description: | | ||
Короткая информация о LVMVolumeGroup ресурсах, созданных по текущему ресурсу. | ||
currentLVMVolumeGroupsCount: | ||
description: | | ||
Текущее количество созданных LVMVolumeGroup ресурсов. | ||
desiredLVMVolumeGroupsCount: | ||
description: | | ||
Желаемое количество созданных LVMVolumeGroup ресурсов. | ||
phase: | ||
description: | | ||
Показывает статус создания LVMVolumeGroup ресурсов. | ||
reason: | ||
description: | | ||
Показывает причину текущего статуса. |
Oops, something went wrong.