This repository has been archived by the owner on Apr 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
CephBlockPool CR #16
Draft
hbinkim
wants to merge
3
commits into
main
Choose a base branch
from
blockpool
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
CephBlockPool CR #16
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -1,7 +1,10 @@ | ||
domain: tmax.io | ||
repo: hypersds-operator | ||
domain: github.com | ||
repo: github.com/tmax-cloud/hypersds-operator | ||
resources: | ||
- group: hypersds | ||
kind: CephCluster | ||
version: v1alpha1 | ||
- group: hypersds | ||
kind: CephBlockPool | ||
version: v1alpha1 | ||
version: "2" |
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,141 @@ | ||
/* | ||
|
||
|
||
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" | ||
) | ||
|
||
//+kubebuilder:object:root=true | ||
|
||
// CephBlockPoolList contains a list of CephBlockPool | ||
type CephBlockPoolList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []CephBlockPool `json:"items"` | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
//+kubebuilder:subresource:status | ||
|
||
// CephBlockPool is the Schema for the cephblockpools API | ||
type CephBlockPool struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec CephBlockPoolSpec `json:"spec,omitempty"` | ||
Status CephBlockPoolStatus `json:"status,omitempty"` | ||
} | ||
|
||
// CephBlockPoolSpec defines the desired state of CephBlockPool | ||
type CephBlockPoolSpec struct { | ||
hbinkim marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// The failure domain: osd/host/(region or zone if available) - technically also any type in the crush map | ||
// +optional | ||
FailureDomain string `json:"failureDomain,omitempty"` | ||
|
||
// The root of the crush hierarchy utilized by the pool | ||
// +optional | ||
// +nullable | ||
CrushRoot string `json:"crushRoot,omitempty"` | ||
|
||
// The device class the OSD should set to for use in the pool | ||
// +optional | ||
// +nullable | ||
DeviceClass string `json:"deviceClass,omitempty"` | ||
|
||
// The inline compression mode in Bluestore OSD to set to (options are: none, passive, aggressive, force) | ||
// +kubebuilder:validation:Enum=none;passive;aggressive;force;"" | ||
// +kubebuilder:default=none | ||
// +optional | ||
// +nullable | ||
CompressionMode string `json:"compressionMode,omitempty"` | ||
|
||
// The replication settings | ||
// +optional | ||
Replicated ReplicatedSpec `json:"replicated,omitempty"` | ||
|
||
// The erasure code settings | ||
// +optional | ||
ErasureCoded ErasureCodedSpec `json:"erasureCoded,omitempty"` | ||
|
||
// EnableRBDStats is used to enable gathering of statistics for all RBD images in the pool | ||
EnableRBDStats bool `json:"enableRBDStats,omitempty"` | ||
|
||
// The quota settings | ||
// +optional | ||
// +nullable | ||
Quotas QuotaSpec `json:"quotas,omitempty"` | ||
} | ||
|
||
// ReplicatedSpec represents the spec for replication in a pool | ||
type ReplicatedSpec struct { | ||
// Size - Number of copies per object in a replicated storage pool, including the object itself (required for replicated pool type) | ||
// +kubebuilder:validation:Minimum=0 | ||
Size uint `json:"size"` | ||
|
||
// TargetSizeRatio gives a hint (%) to Ceph in terms of expected consumption of the total cluster capacity | ||
// +optional | ||
TargetSizeRatio resource.Quantity `json:"targetSizeRatio,omitempty"` | ||
} | ||
|
||
// ErasureCodedSpec represents the spec for erasure code in a pool | ||
type ErasureCodedSpec struct { | ||
// Number of coding chunks per object in an erasure coded storage pool (required for erasure-coded pool type) | ||
// +kubebuilder:validation:Minimum=0 | ||
// +kubebuilder:validation:Maximum=9 | ||
CodingChunks uint `json:"codingChunks"` | ||
|
||
// Number of data chunks per object in an erasure coded storage pool (required for erasure-coded pool type) | ||
// +kubebuilder:validation:Minimum=0 | ||
// +kubebuilder:validation:Maximum=9 | ||
DataChunks uint `json:"dataChunks"` | ||
|
||
// The algorithm for erasure coding | ||
// +optional | ||
Algorithm string `json:"algorithm,omitempty"` | ||
} | ||
|
||
// QuotaSpec represents the spec for quotas in a pool | ||
type QuotaSpec struct { | ||
// MaxSize represents the quota in bytes as a string | ||
// +kubebuilder:validation:Pattern=`^[0-9]+[\.]?[0-9]*([KMGTPE]i|[kMGTPE])?$` | ||
// +optional | ||
MaxSize *string `json:"maxSize,omitempty"` | ||
|
||
// MaxObjects represents the quota in objects | ||
// +optional | ||
MaxObjects *uint64 `json:"maxObjects,omitempty"` | ||
} | ||
|
||
// CephBlockPoolStatus defines the observed state of CephBlockPool | ||
type CephBlockPoolStatus struct { | ||
State CephBlockPoolState `json:"state"` | ||
Conditions []metav1.Condition `json:"conditions,omitempty"` | ||
} | ||
|
||
// CephBlockPoolState is the current state of CephBlockPool | ||
type CephBlockPoolState string | ||
|
||
const ( | ||
// CephBlockPoolConditionReadyToUse indicates CephBlockPool is ready to use | ||
CephBlockPoolConditionReadyToUse = "ReadyToUse" | ||
) | ||
|
||
func init() { | ||
SchemeBuilder.Register(&CephBlockPool{}, &CephBlockPoolList{}) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to be necessary to check if there is no association with the
apiVersion
of cr. Specifically, it meansgroup
of crd.