Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nfs: remove poolConfig #9356

Merged
merged 1 commit into from
Dec 8, 2021
Merged

Conversation

BlaineEXE
Copy link
Member

Remove the poolConfig in CephNFS to prevent different CephNFS CRs from
contending to change the replication spec of the default NFS pool.

Resolves #9355

Signed-off-by: Blaine Gardner blaine.gardner@redhat.com

Description of your changes:

Which issue is resolved by this Pull Request:
Resolves #

Checklist:

  • Commit Message Formatting: Commit titles and messages follow guidelines in the developer guide.
  • Skip Tests for Docs: Add the flag for skipping the build if this is only a documentation change. See here for the flag.
  • Skip Unrelated Tests: Add a flag to run tests for a specific storage provider. See test options.
  • Reviewed the developer guide on Submitting a Pull Request
  • Documentation has been updated, if necessary.
  • Unit tests have been added, if necessary.
  • Integration tests have been added, if necessary.
  • Pending release notes updated with breaking and/or notable changes, if necessary.
  • Upgrade from previous release is tested and upgrade user guide is updated, if necessary.
  • Code generation (make codegen) has been run to update object specifications, if necessary.

@@ -4,12 +4,9 @@ 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
rados:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cluster-test.yaml uses 16.2.7 now, shall we still leave a comment here about rados being ignored in that case?

Comment on lines 294 to 307
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{}

args := []string{"osd", "pool", "create", poolName}
output, err := cephclient.NewCephCommand(r.context, r.clusterInfo, args).Run()
if err != nil {
return errors.Wrapf(err, "failed to create default NFS pool %q. %s", poolName, string(output))
}
err := cephclient.CreateReplicatedPoolForApp(r.context, r.clusterInfo, r.cephClusterSpec, poolName, *n.Spec.RADOS.PoolConfig, cephclient.DefaultPGCount, "nfs")

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 err
return errors.Wrapf(err, "failed to enable application 'nfs' on pool %q", poolName)
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to update this function before. With manual testing, this all looks good. The .nfs pool is created with the nfs application, and I verified that it doesn't fail if the operator is restarted and this is run again.

Remove the poolConfig in CephNFS to prevent different CephNFS CRs from
contending to change the replication spec of the default NFS pool.

Resolves rook#9355

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
@@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If rook doesn't create this pool, will ceph create it automatically? If so, seems like we could stop creating it explicitly since after #9209 is available, they should be creating the .nfs pool with the pool CR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe ceph creates it automatically, no. At least it doesn't for all versions.

The operation is idempotent though AFAIK. If the pool exists, Ceph won't fail the command. Same for setting the application. Since the command doesn't specify a crush rule, I do wonder if it might reset the pool to defaults or not. That would be an integration we'd have to investigate a bit I think.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, let's leave this for now to ensure the pool is created by default. With #9209 perhaps we require that they define the .nfs CephBlockPool.

@BlaineEXE BlaineEXE merged commit 6ad2026 into rook:master Dec 8, 2021
@BlaineEXE BlaineEXE deleted the nfs-remove-poolconfig branch December 8, 2021 22:35
mergify bot added a commit that referenced this pull request Dec 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CephNFS v1.8 beta CRD poolConfig could contend between resources
2 participants