-
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 a LVMLogicalVolumeWatcher CRDs (#13)
Signed-off-by: Viktor Kramarenko <[email protected]> Signed-off-by: Aleksandr Zimin <[email protected]> Co-authored-by: Aleksandr Zimin <[email protected]>
- Loading branch information
1 parent
00af364
commit fd1c9b3
Showing
19 changed files
with
1,286 additions
and
386 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
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,80 @@ | ||
--- | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
name: lvmlogicalvolumes.storage.deckhouse.io | ||
finalizers: | ||
- storage.deckhouse.io/sds-node-configurator | ||
labels: | ||
heritage: deckhouse | ||
module: storage | ||
spec: | ||
group: storage.deckhouse.io | ||
scope: Cluster | ||
names: | ||
kind: LvmLogicalVolume | ||
plural: lvmlogicalvolumes | ||
singular: lvmlogicalvolume | ||
shortNames: | ||
- llv | ||
preserveUnknownFields: false | ||
versions: | ||
- name: v1alpha1 | ||
served: true | ||
storage: true | ||
schema: | ||
openAPIV3Schema: | ||
type: object | ||
description: | | ||
The LVMLogicalVolume resource defines the storage where a PV will be created in. | ||
properties: | ||
spec: | ||
type: object | ||
description: | | ||
properties: | ||
type: | ||
x-kubernetes-validations: | ||
- rule: self == oldSelf | ||
type: string | ||
enum: [Thick, Thin] | ||
size: | ||
type: string | ||
lvmVolumeGroup: | ||
x-kubernetes-validations: | ||
- rule: self == oldSelf | ||
type: string | ||
thin: | ||
x-kubernetes-validations: | ||
- rule: self == oldSelf | ||
type: object | ||
properties: | ||
poolName: | ||
type: string | ||
status: | ||
type: object | ||
description: | | ||
properties: | ||
phase: | ||
type: string | ||
enum: [Created, Pending, Resizing, Failed] | ||
reason: | ||
type: string | ||
actualSize: | ||
type: string | ||
additionalPrinterColumns: | ||
- jsonPath: .status.phase | ||
name: Phase | ||
type: string | ||
description: The current resource status. | ||
- jsonPath: .spec.lvmVolumeGroup | ||
name: LVMVolumeGroup | ||
type: string | ||
description: The selected LVMVolumeGroup resource. | ||
- jsonPath: .spec.thin.poolName | ||
name: ThinPool | ||
type: string | ||
description: The selected ThinPool in LVMVolumeGroup. Might be empty if the LVMVolumeGroup is thick. | ||
- jsonPath: .status.actualSize | ||
name: Size | ||
type: string | ||
description: Actual LVMLogicalVolume size. |
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,54 @@ | ||
/* | ||
Copyright 2023 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 ( | ||
"k8s.io/apimachinery/pkg/api/resource" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
type LvmLogicalVolumeList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata"` | ||
|
||
Items []LvmLogicalVolume `json:"items"` | ||
} | ||
|
||
type LvmLogicalVolume struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec LvmLogicalVolumeSpec `json:"spec"` | ||
Status *LvmLogicalVolumeStatus `json:"status,omitempty"` | ||
} | ||
|
||
type LvmLogicalVolumeSpec struct { | ||
Type string `json:"type"` | ||
Size resource.Quantity `json:"size"` | ||
LvmVolumeGroup string `json:"lvmVolumeGroup"` | ||
Thin *ThinLogicalVolumeSpec `json:"thin"` | ||
} | ||
|
||
type ThinLogicalVolumeSpec struct { | ||
PoolName string `json:"poolName"` | ||
} | ||
|
||
type LvmLogicalVolumeStatus struct { | ||
Phase string `json:"phase"` | ||
Reason string `json:"reason"` | ||
ActualSize resource.Quantity `json:"actualSize"` | ||
} |
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
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
Oops, something went wrong.