diff --git a/Documentation/ceph-nfs-crd.md b/Documentation/ceph-nfs-crd.md index 37dac3d64..8f7a9e6dc 100644 --- a/Documentation/ceph-nfs-crd.md +++ b/Documentation/ceph-nfs-crd.md @@ -28,23 +28,15 @@ metadata: name: my-nfs namespace: rook-ceph spec: - # For Ceph v16, use the block here. - # rados settings aren't necessary in Ceph Versions equal to or greater than Pacific 16.2.7 + # For Ceph v15, the rados block is required. It is ignored for Ceph v16. rados: - poolConfig: - failureDomain: host - replicated: - size: 3 - - # For Ceph v15, use the block here. - # rados: - # # RADOS pool where NFS configs are stored. - # # In this example the data pool for the "myfs" filesystem is used. - # # If using the object store example, the data pool would be "my-store.rgw.buckets.data". - # # Note that this has nothing to do with where exported file systems or object stores live. - # pool: myfs-data0 - # # RADOS namespace where NFS client recovery data is stored in the pool. - # namespace: nfs-ns + # RADOS pool where NFS configs are stored. + # In this example the data pool for the "myfs" filesystem is used. + # If using the object store example, the data pool would be "my-store.rgw.buckets.data". + # Note that this has nothing to do with where exported file systems or object stores live. + pool: myfs-data0 + # RADOS namespace where NFS client recovery data is stored in the pool. + namespace: nfs-ns # Settings for the NFS server server: diff --git a/deploy/charts/rook-ceph/templates/resources.yaml b/deploy/charts/rook-ceph/templates/resources.yaml index 5923e746c..6a1926421 100644 --- a/deploy/charts/rook-ceph/templates/resources.yaml +++ b/deploy/charts/rook-ceph/templates/resources.yaml @@ -6013,169 +6013,6 @@ spec: pool: description: Pool used to represent the Ganesha's pool name in version older than 16.2.7 As of Ceph Pacific 16.2.7, NFS Ganesha's pool name is hardcoded to ".nfs", so this setting will be ignored. type: string - poolConfig: - description: PoolConfig is the RADOS pool where Ganesha data is stored. - nullable: true - properties: - compressionMode: - description: 'DEPRECATED: use Parameters instead, e.g., Parameters["compression_mode"] = "force" The inline compression mode in Bluestore OSD to set to (options are: none, passive, aggressive, force) Do NOT set a default value for kubebuilder as this will override the Parameters' - enum: - - none - - passive - - aggressive - - force - - "" - nullable: true - type: string - crushRoot: - description: The root of the crush hierarchy utilized by the pool - nullable: true - type: string - deviceClass: - description: The device class the OSD should set to for use in the pool - nullable: true - type: string - enableRBDStats: - description: EnableRBDStats is used to enable gathering of statistics for all RBD images in the pool - type: boolean - erasureCoded: - description: The erasure code settings - properties: - algorithm: - description: The algorithm for erasure coding - type: string - codingChunks: - description: Number of coding chunks per object in an erasure coded storage pool (required for erasure-coded pool type). This is the number of OSDs that can be lost simultaneously before data cannot be recovered. - minimum: 0 - type: integer - dataChunks: - description: Number of data chunks per object in an erasure coded storage pool (required for erasure-coded pool type). The number of chunks required to recover an object when any single OSD is lost is the same as dataChunks so be aware that the larger the number of data chunks, the higher the cost of recovery. - minimum: 0 - type: integer - required: - - codingChunks - - dataChunks - type: object - failureDomain: - description: 'The failure domain: osd/host/(region or zone if available) - technically also any type in the crush map' - type: string - mirroring: - description: The mirroring settings - properties: - enabled: - description: Enabled whether this pool is mirrored or not - type: boolean - mode: - description: 'Mode is the mirroring mode: either pool or image' - type: string - peers: - description: Peers represents the peers spec - nullable: true - properties: - secretNames: - description: SecretNames represents the Kubernetes Secret names to add rbd-mirror or cephfs-mirror peers - items: - type: string - type: array - type: object - snapshotSchedules: - description: SnapshotSchedules is the scheduling of snapshot for mirrored images/pools - items: - description: SnapshotScheduleSpec represents the snapshot scheduling settings of a mirrored pool - properties: - interval: - description: Interval represent the periodicity of the snapshot. - type: string - path: - description: Path is the path to snapshot, only valid for CephFS - type: string - startTime: - description: StartTime indicates when to start the snapshot - type: string - type: object - type: array - type: object - parameters: - additionalProperties: - type: string - description: Parameters is a list of properties to enable on a given pool - nullable: true - type: object - x-kubernetes-preserve-unknown-fields: true - quotas: - description: The quota settings - nullable: true - properties: - maxBytes: - description: MaxBytes represents the quota in bytes Deprecated in favor of MaxSize - format: int64 - type: integer - maxObjects: - description: MaxObjects represents the quota in objects - format: int64 - type: integer - maxSize: - description: MaxSize represents the quota in bytes as a string - pattern: ^[0-9]+[\.]?[0-9]*([KMGTPE]i|[kMGTPE])?$ - type: string - type: object - replicated: - description: The replication settings - properties: - hybridStorage: - description: HybridStorage represents hybrid storage tier settings - nullable: true - properties: - primaryDeviceClass: - description: PrimaryDeviceClass represents high performance tier (for example SSD or NVME) for Primary OSD - minLength: 1 - type: string - secondaryDeviceClass: - description: SecondaryDeviceClass represents low performance tier (for example HDDs) for remaining OSDs - minLength: 1 - type: string - required: - - primaryDeviceClass - - secondaryDeviceClass - type: object - replicasPerFailureDomain: - description: ReplicasPerFailureDomain the number of replica in the specified failure domain - minimum: 1 - type: integer - requireSafeReplicaSize: - description: RequireSafeReplicaSize if false allows you to set replica 1 - type: boolean - size: - description: Size - Number of copies per object in a replicated storage pool, including the object itself (required for replicated pool type) - minimum: 0 - type: integer - subFailureDomain: - description: SubFailureDomain the name of the sub-failure domain - type: string - targetSizeRatio: - description: TargetSizeRatio gives a hint (%) to Ceph in terms of expected consumption of the total cluster capacity - type: number - required: - - size - type: object - statusCheck: - description: The mirroring statusCheck - properties: - mirror: - description: HealthCheckSpec represents the health check of an object store bucket - nullable: true - properties: - disabled: - type: boolean - interval: - description: Interval is the internal in second or minute for the health check to run like 60s for 60 seconds - type: string - timeout: - type: string - type: object - type: object - x-kubernetes-preserve-unknown-fields: true - type: object required: - namespace type: object diff --git a/deploy/examples/crds.yaml b/deploy/examples/crds.yaml index 103a11d8e..d8200eb3a 100644 --- a/deploy/examples/crds.yaml +++ b/deploy/examples/crds.yaml @@ -6009,169 +6009,6 @@ spec: pool: description: Pool used to represent the Ganesha's pool name in version older than 16.2.7 As of Ceph Pacific 16.2.7, NFS Ganesha's pool name is hardcoded to ".nfs", so this setting will be ignored. type: string - poolConfig: - description: PoolConfig is the RADOS pool where Ganesha data is stored. - nullable: true - properties: - compressionMode: - description: 'DEPRECATED: use Parameters instead, e.g., Parameters["compression_mode"] = "force" The inline compression mode in Bluestore OSD to set to (options are: none, passive, aggressive, force) Do NOT set a default value for kubebuilder as this will override the Parameters' - enum: - - none - - passive - - aggressive - - force - - "" - nullable: true - type: string - crushRoot: - description: The root of the crush hierarchy utilized by the pool - nullable: true - type: string - deviceClass: - description: The device class the OSD should set to for use in the pool - nullable: true - type: string - enableRBDStats: - description: EnableRBDStats is used to enable gathering of statistics for all RBD images in the pool - type: boolean - erasureCoded: - description: The erasure code settings - properties: - algorithm: - description: The algorithm for erasure coding - type: string - codingChunks: - description: Number of coding chunks per object in an erasure coded storage pool (required for erasure-coded pool type). This is the number of OSDs that can be lost simultaneously before data cannot be recovered. - minimum: 0 - type: integer - dataChunks: - description: Number of data chunks per object in an erasure coded storage pool (required for erasure-coded pool type). The number of chunks required to recover an object when any single OSD is lost is the same as dataChunks so be aware that the larger the number of data chunks, the higher the cost of recovery. - minimum: 0 - type: integer - required: - - codingChunks - - dataChunks - type: object - failureDomain: - description: 'The failure domain: osd/host/(region or zone if available) - technically also any type in the crush map' - type: string - mirroring: - description: The mirroring settings - properties: - enabled: - description: Enabled whether this pool is mirrored or not - type: boolean - mode: - description: 'Mode is the mirroring mode: either pool or image' - type: string - peers: - description: Peers represents the peers spec - nullable: true - properties: - secretNames: - description: SecretNames represents the Kubernetes Secret names to add rbd-mirror or cephfs-mirror peers - items: - type: string - type: array - type: object - snapshotSchedules: - description: SnapshotSchedules is the scheduling of snapshot for mirrored images/pools - items: - description: SnapshotScheduleSpec represents the snapshot scheduling settings of a mirrored pool - properties: - interval: - description: Interval represent the periodicity of the snapshot. - type: string - path: - description: Path is the path to snapshot, only valid for CephFS - type: string - startTime: - description: StartTime indicates when to start the snapshot - type: string - type: object - type: array - type: object - parameters: - additionalProperties: - type: string - description: Parameters is a list of properties to enable on a given pool - nullable: true - type: object - x-kubernetes-preserve-unknown-fields: true - quotas: - description: The quota settings - nullable: true - properties: - maxBytes: - description: MaxBytes represents the quota in bytes Deprecated in favor of MaxSize - format: int64 - type: integer - maxObjects: - description: MaxObjects represents the quota in objects - format: int64 - type: integer - maxSize: - description: MaxSize represents the quota in bytes as a string - pattern: ^[0-9]+[\.]?[0-9]*([KMGTPE]i|[kMGTPE])?$ - type: string - type: object - replicated: - description: The replication settings - properties: - hybridStorage: - description: HybridStorage represents hybrid storage tier settings - nullable: true - properties: - primaryDeviceClass: - description: PrimaryDeviceClass represents high performance tier (for example SSD or NVME) for Primary OSD - minLength: 1 - type: string - secondaryDeviceClass: - description: SecondaryDeviceClass represents low performance tier (for example HDDs) for remaining OSDs - minLength: 1 - type: string - required: - - primaryDeviceClass - - secondaryDeviceClass - type: object - replicasPerFailureDomain: - description: ReplicasPerFailureDomain the number of replica in the specified failure domain - minimum: 1 - type: integer - requireSafeReplicaSize: - description: RequireSafeReplicaSize if false allows you to set replica 1 - type: boolean - size: - description: Size - Number of copies per object in a replicated storage pool, including the object itself (required for replicated pool type) - minimum: 0 - type: integer - subFailureDomain: - description: SubFailureDomain the name of the sub-failure domain - type: string - targetSizeRatio: - description: TargetSizeRatio gives a hint (%) to Ceph in terms of expected consumption of the total cluster capacity - type: number - required: - - size - type: object - statusCheck: - description: The mirroring statusCheck - properties: - mirror: - description: HealthCheckSpec represents the health check of an object store bucket - nullable: true - properties: - disabled: - type: boolean - interval: - description: Interval is the internal in second or minute for the health check to run like 60s for 60 seconds - type: string - timeout: - type: string - type: object - type: object - x-kubernetes-preserve-unknown-fields: true - type: object required: - namespace type: object diff --git a/deploy/examples/nfs-test.yaml b/deploy/examples/nfs-test.yaml index 3bbc5d665..76bc1afd8 100644 --- a/deploy/examples/nfs-test.yaml +++ b/deploy/examples/nfs-test.yaml @@ -4,12 +4,10 @@ metadata: name: my-nfs namespace: rook-ceph # namespace:cluster spec: - # rados settings aren't necessary in Ceph Versions equal to or greater than Pacific 16.2.7 + # this setting is ignored for Ceph v16+ rados: - poolConfig: - failureDomain: osd - replicated: - size: 1 + pool: myfs-data0 + namespace: nfs-ns # Settings for the NFS server server: # the number of active NFS servers diff --git a/deploy/examples/nfs.yaml b/deploy/examples/nfs.yaml index a17b7b10f..0fd3eb731 100644 --- a/deploy/examples/nfs.yaml +++ b/deploy/examples/nfs.yaml @@ -4,23 +4,15 @@ metadata: name: my-nfs namespace: rook-ceph # namespace:cluster spec: - # For Ceph v16, use the block here. - # rados settings aren't necessary in Ceph Versions equal to or greater than Pacific 16.2.7 + # For Ceph v15, the rados block is required. It is ignored for Ceph v16. rados: - poolConfig: - failureDomain: host - replicated: - size: 3 - - # For Ceph v15, use the block here. - # rados: - # # RADOS pool where NFS configs are stored. - # # In this example the data pool for the "myfs" filesystem is used. - # # If using the object store example, the data pool would be "my-store.rgw.buckets.data". - # # Note that this has nothing to do with where exported file systems or object stores live. - # pool: myfs-data0 - # # RADOS namespace where NFS client recovery data is stored in the pool. - # namespace: nfs-ns + # RADOS pool where NFS configs are stored. + # In this example the data pool for the "myfs" filesystem is used. + # If using the object store example, the data pool would be "my-store.rgw.buckets.data". + # Note that this has nothing to do with where exported file systems or object stores live. + pool: myfs-data0 + # RADOS namespace where NFS client recovery data is stored in the pool. + namespace: nfs-ns # Settings for the NFS server server: diff --git a/pkg/apis/ceph.rook.io/v1/types.go b/pkg/apis/ceph.rook.io/v1/types.go index e6f2e227a..e03891335 100755 --- a/pkg/apis/ceph.rook.io/v1/types.go +++ b/pkg/apis/ceph.rook.io/v1/types.go @@ -1818,11 +1818,6 @@ type GaneshaRADOSSpec struct { // +optional Pool string `json:"pool,omitempty"` - // PoolConfig is the RADOS pool where Ganesha data is stored. - // +nullable - // +optional - PoolConfig *PoolSpec `json:"poolConfig,omitempty"` - // Namespace is the RADOS namespace where NFS client recovery data is stored. Namespace string `json:"namespace"` } diff --git a/pkg/apis/ceph.rook.io/v1/zz_generated.deepcopy.go b/pkg/apis/ceph.rook.io/v1/zz_generated.deepcopy.go index 054381d12..424d4df92 100644 --- a/pkg/apis/ceph.rook.io/v1/zz_generated.deepcopy.go +++ b/pkg/apis/ceph.rook.io/v1/zz_generated.deepcopy.go @@ -1986,11 +1986,6 @@ func (in *FilesystemsSpec) DeepCopy() *FilesystemsSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GaneshaRADOSSpec) DeepCopyInto(out *GaneshaRADOSSpec) { *out = *in - if in.PoolConfig != nil { - in, out := &in.PoolConfig, &out.PoolConfig - *out = new(PoolSpec) - (*in).DeepCopyInto(*out) - } return } @@ -2465,7 +2460,7 @@ func (in *MonitoringSpec) DeepCopy() *MonitoringSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NFSGaneshaSpec) DeepCopyInto(out *NFSGaneshaSpec) { *out = *in - in.RADOS.DeepCopyInto(&out.RADOS) + out.RADOS = in.RADOS in.Server.DeepCopyInto(&out.Server) return } diff --git a/pkg/operator/ceph/nfs/nfs.go b/pkg/operator/ceph/nfs/nfs.go index 83f322e2d..e68968e39 100644 --- a/pkg/operator/ceph/nfs/nfs.go +++ b/pkg/operator/ceph/nfs/nfs.go @@ -293,14 +293,17 @@ func validateGanesha(context *clusterd.Context, clusterInfo *cephclient.ClusterI // create and enable default RADOS pool func (r *ReconcileCephNFS) createDefaultNFSRADOSPool(n *cephv1.CephNFS) error { poolName := n.Spec.RADOS.Pool - // Settings are not always declared and CreateReplicatedPoolForApp does not accept a pointer for - // the pool spec - if n.Spec.RADOS.PoolConfig == nil { - n.Spec.RADOS.PoolConfig = &cephv1.PoolSpec{} - } - err := cephclient.CreateReplicatedPoolForApp(r.context, r.clusterInfo, r.cephClusterSpec, poolName, *n.Spec.RADOS.PoolConfig, cephclient.DefaultPGCount, "nfs") + + args := []string{"osd", "pool", "create", poolName} + output, err := cephclient.NewCephCommand(r.context, r.clusterInfo, args).Run() if err != nil { - return err + return errors.Wrapf(err, "failed to create default NFS pool %q. %s", poolName, string(output)) + } + + args = []string{"osd", "pool", "application", "enable", poolName, "nfs", "--yes-i-really-mean-it"} + _, err = cephclient.NewCephCommand(r.context, r.clusterInfo, args).Run() + if err != nil { + return errors.Wrapf(err, "failed to enable application 'nfs' on pool %q", poolName) } return nil