diff --git a/cluster/charts/rook-ceph/templates/resources.yaml b/cluster/charts/rook-ceph/templates/resources.yaml index 76fa9499c..733cc5d57 100644 --- a/cluster/charts/rook-ceph/templates/resources.yaml +++ b/cluster/charts/rook-ceph/templates/resources.yaml @@ -64,9 +64,13 @@ spec: type: string codingChunks: description: Number of coding chunks per object in an erasure coded storage pool (required for erasure-coded pool type) + maximum: 9 + minimum: 0 type: integer dataChunks: description: Number of data chunks per object in an erasure coded storage pool (required for erasure-coded pool type) + maximum: 9 + minimum: 0 type: integer required: - codingChunks @@ -82,7 +86,7 @@ spec: description: Enabled whether this pool is mirrored or not type: boolean mode: - description: 'Mode is the mirroring mode: either "pool" or "image"' + description: 'Mode is the mirroring mode: either pool or image' type: string snapshotSchedules: description: SnapshotSchedules is the scheduling of snapshot for mirrored images/pools @@ -409,7 +413,34 @@ spec: singular: cephcluster scope: Namespaced versions: - - name: v1 + - additionalPrinterColumns: + - description: Directory used on the K8s nodes + jsonPath: .spec.dataDirHostPath + name: DataDirHostPath + type: string + - description: Number of MONs + jsonPath: .spec.mon.count + name: MonCount + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + - description: Phase + jsonPath: .status.phase + name: Phase + type: string + - description: Message + jsonPath: .status.message + name: Message + type: string + - description: Ceph Health + jsonPath: .status.ceph.health + name: Health + type: string + - jsonPath: .spec.external.enable + name: External + type: boolean + name: v1 schema: openAPIV3Schema: description: CephCluster is a Ceph storage cluster @@ -458,6 +489,7 @@ spec: confirmation: description: Confirmation represents the cleanup confirmation nullable: true + pattern: ^$|^yes-really-destroy-data$ type: string sanitizeDisks: description: SanitizeDisks represents way we sanitize disks @@ -475,6 +507,9 @@ spec: type: integer method: description: Method is the method we use to sanitize disks + enum: + - complete + - quick type: string type: object type: object @@ -501,6 +536,8 @@ spec: type: boolean port: description: Port is the dashboard webserver port + maximum: 65535 + minimum: 0 type: integer ssl: description: SSL determines whether SSL should be used @@ -511,6 +548,7 @@ spec: type: object dataDirHostPath: description: The path on the host where config and data can be persisted + pattern: ^/(\S+) type: string disruptionManagement: description: A spec for configuring disruption management. @@ -714,6 +752,8 @@ spec: type: boolean count: description: Count is the number of manager to run + maximum: 2 + minimum: 0 type: integer modules: description: Modules is the list of ceph manager modules to enable/disable @@ -1121,6 +1161,8 @@ spec: type: array externalMgrPrometheusPort: description: ExternalMgrPrometheusPort Prometheus exporter port + maximum: 65535 + minimum: 0 type: integer rulesNamespace: description: RulesNamespace is the namespace where the prometheus rules and alerts should be created. If empty, the same namespace as the cluster will be used. @@ -4151,6 +4193,7 @@ spec: type: object served: true storage: true + subresources: {} status: acceptedNames: kind: "" @@ -4682,7 +4725,15 @@ spec: singular: cephfilesystem scope: Namespaced versions: - - name: v1 + - additionalPrinterColumns: + - description: Number of desired active MDS daemons + jsonPath: .spec.metadataServer.activeCount + name: ActiveMDS + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1 schema: openAPIV3Schema: description: CephFilesystem represents a Ceph Filesystem @@ -4734,9 +4785,13 @@ spec: type: string codingChunks: description: Number of coding chunks per object in an erasure coded storage pool (required for erasure-coded pool type) + maximum: 9 + minimum: 0 type: integer dataChunks: description: Number of data chunks per object in an erasure coded storage pool (required for erasure-coded pool type) + maximum: 9 + minimum: 0 type: integer required: - codingChunks @@ -4752,7 +4807,7 @@ spec: description: Enabled whether this pool is mirrored or not type: boolean mode: - description: 'Mode is the mirroring mode: either "pool" or "image"' + description: 'Mode is the mirroring mode: either pool or image' type: string snapshotSchedules: description: SnapshotSchedules is the scheduling of snapshot for mirrored images/pools @@ -4868,9 +4923,13 @@ spec: type: string codingChunks: description: Number of coding chunks per object in an erasure coded storage pool (required for erasure-coded pool type) + maximum: 9 + minimum: 0 type: integer dataChunks: description: Number of data chunks per object in an erasure coded storage pool (required for erasure-coded pool type) + maximum: 9 + minimum: 0 type: integer required: - codingChunks @@ -4886,7 +4945,7 @@ spec: description: Enabled whether this pool is mirrored or not type: boolean mode: - description: 'Mode is the mirroring mode: either "pool" or "image"' + description: 'Mode is the mirroring mode: either pool or image' type: string snapshotSchedules: description: SnapshotSchedules is the scheduling of snapshot for mirrored images/pools @@ -4973,6 +5032,7 @@ spec: activeCount: description: The number of metadata servers that are active. The remaining servers in the cluster will be in standby mode. format: int32 + maximum: 10 minimum: 1 type: integer activeStandby: @@ -5471,6 +5531,7 @@ spec: type: object served: true storage: true + subresources: {} status: acceptedNames: kind: "" @@ -6151,9 +6212,13 @@ spec: type: string codingChunks: description: Number of coding chunks per object in an erasure coded storage pool (required for erasure-coded pool type) + maximum: 9 + minimum: 0 type: integer dataChunks: description: Number of data chunks per object in an erasure coded storage pool (required for erasure-coded pool type) + maximum: 9 + minimum: 0 type: integer required: - codingChunks @@ -6169,7 +6234,7 @@ spec: description: Enabled whether this pool is mirrored or not type: boolean mode: - description: 'Mode is the mirroring mode: either "pool" or "image"' + description: 'Mode is the mirroring mode: either pool or image' type: string snapshotSchedules: description: SnapshotSchedules is the scheduling of snapshot for mirrored images/pools @@ -6768,6 +6833,8 @@ spec: securePort: description: The port the rgw service will be listening on (https) format: int32 + maximum: 65535 + minimum: 0 type: integer sslCertificateRef: description: The name of the secret that stores the ssl certificate for secure rgw connections @@ -6917,9 +6984,13 @@ spec: type: string codingChunks: description: Number of coding chunks per object in an erasure coded storage pool (required for erasure-coded pool type) + maximum: 9 + minimum: 0 type: integer dataChunks: description: Number of data chunks per object in an erasure coded storage pool (required for erasure-coded pool type) + maximum: 9 + minimum: 0 type: integer required: - codingChunks @@ -6935,7 +7006,7 @@ spec: description: Enabled whether this pool is mirrored or not type: boolean mode: - description: 'Mode is the mirroring mode: either "pool" or "image"' + description: 'Mode is the mirroring mode: either pool or image' type: string snapshotSchedules: description: SnapshotSchedules is the scheduling of snapshot for mirrored images/pools @@ -7265,9 +7336,13 @@ spec: type: string codingChunks: description: Number of coding chunks per object in an erasure coded storage pool (required for erasure-coded pool type) + maximum: 9 + minimum: 0 type: integer dataChunks: description: Number of data chunks per object in an erasure coded storage pool (required for erasure-coded pool type) + maximum: 9 + minimum: 0 type: integer required: - codingChunks @@ -7283,7 +7358,7 @@ spec: description: Enabled whether this pool is mirrored or not type: boolean mode: - description: 'Mode is the mirroring mode: either "pool" or "image"' + description: 'Mode is the mirroring mode: either pool or image' type: string snapshotSchedules: description: SnapshotSchedules is the scheduling of snapshot for mirrored images/pools @@ -7398,9 +7473,13 @@ spec: type: string codingChunks: description: Number of coding chunks per object in an erasure coded storage pool (required for erasure-coded pool type) + maximum: 9 + minimum: 0 type: integer dataChunks: description: Number of data chunks per object in an erasure coded storage pool (required for erasure-coded pool type) + maximum: 9 + minimum: 0 type: integer required: - codingChunks @@ -7416,7 +7495,7 @@ spec: description: Enabled whether this pool is mirrored or not type: boolean mode: - description: 'Mode is the mirroring mode: either "pool" or "image"' + description: 'Mode is the mirroring mode: either pool or image' type: string snapshotSchedules: description: SnapshotSchedules is the scheduling of snapshot for mirrored images/pools diff --git a/cluster/examples/kubernetes/ceph/crds.yaml b/cluster/examples/kubernetes/ceph/crds.yaml index 631a260eb..9b9e852fb 100644 --- a/cluster/examples/kubernetes/ceph/crds.yaml +++ b/cluster/examples/kubernetes/ceph/crds.yaml @@ -75,10 +75,14 @@ spec: codingChunks: description: Number of coding chunks per object in an erasure coded storage pool (required for erasure-coded pool type) + maximum: 9 + minimum: 0 type: integer dataChunks: description: Number of data chunks per object in an erasure coded storage pool (required for erasure-coded pool type) + maximum: 9 + minimum: 0 type: integer required: - codingChunks @@ -95,7 +99,7 @@ spec: description: Enabled whether this pool is mirrored or not type: boolean mode: - description: 'Mode is the mirroring mode: either "pool" or "image"' + description: 'Mode is the mirroring mode: either pool or image' type: string snapshotSchedules: description: SnapshotSchedules is the scheduling of snapshot for @@ -453,7 +457,34 @@ spec: singular: cephcluster scope: Namespaced versions: - - name: v1 + - additionalPrinterColumns: + - description: Directory used on the K8s nodes + jsonPath: .spec.dataDirHostPath + name: DataDirHostPath + type: string + - description: Number of MONs + jsonPath: .spec.mon.count + name: MonCount + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + - description: Phase + jsonPath: .status.phase + name: Phase + type: string + - description: Message + jsonPath: .status.message + name: Message + type: string + - description: Ceph Health + jsonPath: .status.ceph.health + name: Health + type: string + - jsonPath: .spec.external.enable + name: External + type: boolean + name: v1 schema: openAPIV3Schema: description: CephCluster is a Ceph storage cluster @@ -512,6 +543,7 @@ spec: confirmation: description: Confirmation represents the cleanup confirmation nullable: true + pattern: ^$|^yes-really-destroy-data$ type: string sanitizeDisks: description: SanitizeDisks represents way we sanitize disks @@ -531,6 +563,9 @@ spec: type: integer method: description: Method is the method we use to sanitize disks + enum: + - complete + - quick type: string type: object type: object @@ -560,6 +595,8 @@ spec: type: boolean port: description: Port is the dashboard webserver port + maximum: 65535 + minimum: 0 type: integer ssl: description: SSL determines whether SSL should be used @@ -571,6 +608,7 @@ spec: type: object dataDirHostPath: description: The path on the host where config and data can be persisted + pattern: ^/(\S+) type: string disruptionManagement: description: A spec for configuring disruption management. @@ -829,6 +867,8 @@ spec: type: boolean count: description: Count is the number of manager to run + maximum: 2 + minimum: 0 type: integer modules: description: Modules is the list of ceph manager modules to enable/disable @@ -1409,6 +1449,8 @@ spec: type: array externalMgrPrometheusPort: description: ExternalMgrPrometheusPort Prometheus exporter port + maximum: 65535 + minimum: 0 type: integer rulesNamespace: description: RulesNamespace is the namespace where the prometheus @@ -6677,6 +6719,7 @@ spec: type: object served: true storage: true + subresources: {} status: acceptedNames: kind: "" @@ -7542,7 +7585,15 @@ spec: singular: cephfilesystem scope: Namespaced versions: - - name: v1 + - additionalPrinterColumns: + - description: Number of desired active MDS daemons + jsonPath: .spec.metadataServer.activeCount + name: ActiveMDS + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1 schema: openAPIV3Schema: description: CephFilesystem represents a Ceph Filesystem @@ -7603,10 +7654,14 @@ spec: codingChunks: description: Number of coding chunks per object in an erasure coded storage pool (required for erasure-coded pool type) + maximum: 9 + minimum: 0 type: integer dataChunks: description: Number of data chunks per object in an erasure coded storage pool (required for erasure-coded pool type) + maximum: 9 + minimum: 0 type: integer required: - codingChunks @@ -7623,8 +7678,8 @@ spec: description: Enabled whether this pool is mirrored or not type: boolean mode: - description: 'Mode is the mirroring mode: either "pool" - or "image"' + description: 'Mode is the mirroring mode: either pool or + image' type: string snapshotSchedules: description: SnapshotSchedules is the scheduling of snapshot @@ -7759,10 +7814,14 @@ spec: codingChunks: description: Number of coding chunks per object in an erasure coded storage pool (required for erasure-coded pool type) + maximum: 9 + minimum: 0 type: integer dataChunks: description: Number of data chunks per object in an erasure coded storage pool (required for erasure-coded pool type) + maximum: 9 + minimum: 0 type: integer required: - codingChunks @@ -7779,8 +7838,7 @@ spec: description: Enabled whether this pool is mirrored or not type: boolean mode: - description: 'Mode is the mirroring mode: either "pool" or - "image"' + description: 'Mode is the mirroring mode: either pool or image' type: string snapshotSchedules: description: SnapshotSchedules is the scheduling of snapshot @@ -7881,6 +7939,7 @@ spec: description: The number of metadata servers that are active. The remaining servers in the cluster will be in standby mode. format: int32 + maximum: 10 minimum: 1 type: integer activeStandby: @@ -8743,6 +8802,7 @@ spec: type: object served: true storage: true + subresources: {} status: acceptedNames: kind: "" @@ -9801,10 +9861,14 @@ spec: codingChunks: description: Number of coding chunks per object in an erasure coded storage pool (required for erasure-coded pool type) + maximum: 9 + minimum: 0 type: integer dataChunks: description: Number of data chunks per object in an erasure coded storage pool (required for erasure-coded pool type) + maximum: 9 + minimum: 0 type: integer required: - codingChunks @@ -9821,8 +9885,7 @@ spec: description: Enabled whether this pool is mirrored or not type: boolean mode: - description: 'Mode is the mirroring mode: either "pool" or - "image"' + description: 'Mode is the mirroring mode: either pool or image' type: string snapshotSchedules: description: SnapshotSchedules is the scheduling of snapshot @@ -10815,6 +10878,8 @@ spec: securePort: description: The port the rgw service will be listening on (https) format: int32 + maximum: 65535 + minimum: 0 type: integer sslCertificateRef: description: The name of the secret that stores the ssl certificate @@ -11005,10 +11070,14 @@ spec: codingChunks: description: Number of coding chunks per object in an erasure coded storage pool (required for erasure-coded pool type) + maximum: 9 + minimum: 0 type: integer dataChunks: description: Number of data chunks per object in an erasure coded storage pool (required for erasure-coded pool type) + maximum: 9 + minimum: 0 type: integer required: - codingChunks @@ -11025,8 +11094,7 @@ spec: description: Enabled whether this pool is mirrored or not type: boolean mode: - description: 'Mode is the mirroring mode: either "pool" or - "image"' + description: 'Mode is the mirroring mode: either pool or image' type: string snapshotSchedules: description: SnapshotSchedules is the scheduling of snapshot @@ -11388,10 +11456,14 @@ spec: codingChunks: description: Number of coding chunks per object in an erasure coded storage pool (required for erasure-coded pool type) + maximum: 9 + minimum: 0 type: integer dataChunks: description: Number of data chunks per object in an erasure coded storage pool (required for erasure-coded pool type) + maximum: 9 + minimum: 0 type: integer required: - codingChunks @@ -11408,8 +11480,7 @@ spec: description: Enabled whether this pool is mirrored or not type: boolean mode: - description: 'Mode is the mirroring mode: either "pool" or - "image"' + description: 'Mode is the mirroring mode: either pool or image' type: string snapshotSchedules: description: SnapshotSchedules is the scheduling of snapshot @@ -11541,10 +11612,14 @@ spec: codingChunks: description: Number of coding chunks per object in an erasure coded storage pool (required for erasure-coded pool type) + maximum: 9 + minimum: 0 type: integer dataChunks: description: Number of data chunks per object in an erasure coded storage pool (required for erasure-coded pool type) + maximum: 9 + minimum: 0 type: integer required: - codingChunks @@ -11561,8 +11636,7 @@ spec: description: Enabled whether this pool is mirrored or not type: boolean mode: - description: 'Mode is the mirroring mode: either "pool" or - "image"' + description: 'Mode is the mirroring mode: either pool or image' type: string snapshotSchedules: description: SnapshotSchedules is the scheduling of snapshot diff --git a/pkg/apis/ceph.rook.io/v1/types.go b/pkg/apis/ceph.rook.io/v1/types.go index 2562e5d8a..5c6c3545c 100755 --- a/pkg/apis/ceph.rook.io/v1/types.go +++ b/pkg/apis/ceph.rook.io/v1/types.go @@ -35,6 +35,13 @@ import ( // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // CephCluster is a Ceph storage cluster +// +kubebuilder:printcolumn:name="DataDirHostPath",type=string,JSONPath=`.spec.dataDirHostPath`,description="Directory used on the K8s nodes" +// +kubebuilder:printcolumn:name="MonCount",type=string,JSONPath=`.spec.mon.count`,description="Number of MONs" +// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` +// +kubebuilder:printcolumn:name="Phase",type=string,JSONPath=`.status.phase`,description="Phase" +// +kubebuilder:printcolumn:name="Message",type=string,JSONPath=`.status.message`,description="Message" +// +kubebuilder:printcolumn:name="Health",type=string,JSONPath=`.status.ceph.health`,description="Ceph Health" +// +kubebuilder:printcolumn:name="External",type=boolean,JSONPath=`.spec.external.enable` type CephCluster struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata"` @@ -129,6 +136,7 @@ type ClusterSpec struct { PriorityClassNames rookv1.PriorityClassNamesSpec `json:"priorityClassNames,omitempty"` // The path on the host where config and data can be persisted + // +kubebuilder:validation:Pattern=`^/(\S+)` // +optional DataDirHostPath string `json:"dataDirHostPath,omitempty"` @@ -259,6 +267,8 @@ type DashboardSpec struct { // +optional URLPrefix string `json:"urlPrefix,omitempty"` // Port is the dashboard webserver port + // +kubebuilder:validation:Minimum=0 + // +kubebuilder:validation:Maximum=65535 // +optional Port int `json:"port,omitempty"` // SSL determines whether SSL should be used @@ -284,6 +294,8 @@ type MonitoringSpec struct { ExternalMgrEndpoints []v1.EndpointAddress `json:"externalMgrEndpoints,omitempty"` // ExternalMgrPrometheusPort Prometheus exporter port + // +kubebuilder:validation:Minimum=0 + // +kubebuilder:validation:Maximum=65535 // +optional ExternalMgrPrometheusPort uint16 `json:"externalMgrPrometheusPort,omitempty"` } @@ -479,6 +491,8 @@ type StretchClusterZoneSpec struct { // MgrSpec represents options to configure a ceph mgr type MgrSpec struct { // Count is the number of manager to run + // +kubebuilder:validation:Minimum=0 + // +kubebuilder:validation:Maximum=2 // +optional Count int `json:"count,omitempty"` // AllowMultiplePerNode allows to run multiple managers on the same node (not recommended) @@ -810,7 +824,7 @@ type MirroringSpec struct { // +optional Enabled bool `json:"enabled,omitempty"` - // Mode is the mirroring mode: either "pool" or "image" + // Mode is the mirroring mode: either pool or image // +optional Mode string `json:"mode,omitempty"` @@ -850,9 +864,13 @@ type QuotaSpec struct { // 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 @@ -865,6 +883,8 @@ type ErasureCodedSpec struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // CephFilesystem represents a Ceph Filesystem +// +kubebuilder:printcolumn:name="ActiveMDS",type=string,JSONPath=`.spec.metadataServer.activeCount`,description="Number of desired active MDS daemons" +// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` type CephFilesystem struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata"` @@ -911,6 +931,7 @@ type FilesystemSpec struct { type MetadataServerSpec struct { // The number of metadata servers that are active. The remaining servers in the cluster will be in standby mode. // +kubebuilder:validation:Minimum=1 + // +kubebuilder:validation:Maximum=10 ActiveCount int32 `json:"activeCount"` // Whether each active MDS instance will have an active standby with a warm metadata cache for faster failover. @@ -1032,6 +1053,8 @@ type GatewaySpec struct { Port int32 `json:"port,omitempty"` // The port the rgw service will be listening on (https) + // +kubebuilder:validation:Minimum=0 + // +kubebuilder:validation:Maximum=65535 // +optional SecurePort int32 `json:"securePort,omitempty"` @@ -1421,6 +1444,7 @@ type CleanupPolicySpec struct { } // CleanupConfirmationProperty represents the cleanup confirmation +// +kubebuilder:validation:Pattern=`^$|^yes-really-destroy-data$` type CleanupConfirmationProperty string // SanitizeDataSourceProperty represents a sanitizing data source @@ -1433,6 +1457,7 @@ type SanitizeMethodProperty string type SanitizeDisksSpec struct { // Method is the method we use to sanitize disks // +optional + // +kubebuilder:validation:Enum=complete;quick Method SanitizeMethodProperty `json:"method,omitempty"` // DataSource is the data source to use to sanitize the disk with // +optional