-
Notifications
You must be signed in to change notification settings - Fork 200
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
feat(localpv-device): allow local pv device on select devices #1648
Merged
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
f555f88
feat(localpv-device): allow local pv device on select devices
kmova 2f1d263
ut(blockdeviceclaim): for method WithBlockDevicePoolName
kmova 41a4a8b
feat(localpv-device): rename Block Device Pool to Tag
kmova 9da0aa7
docs(localpv): update instruction on running bdd
kmova 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 |
---|---|---|
|
@@ -65,6 +65,10 @@ type HelperBlockDeviceOptions struct { | |
bdcName string | ||
// volumeMode of PVC | ||
volumeMode corev1.PersistentVolumeMode | ||
|
||
//bdPoolName is the value passed for | ||
// BlockDevicePoolName via StorageClass config | ||
bdPoolName string | ||
} | ||
|
||
// validate checks that the required fields to create BDC | ||
|
@@ -120,14 +124,20 @@ func (p *Provisioner) createBlockDeviceClaim(blkDevOpts *HelperBlockDeviceOption | |
return nil | ||
} | ||
|
||
bdcObj, err := blockdeviceclaim.NewBuilder(). | ||
bdcObjBuilder := blockdeviceclaim.NewBuilder(). | ||
WithNamespace(p.namespace). | ||
WithName(bdcName). | ||
WithHostName(blkDevOpts.nodeHostname). | ||
WithCapacity(blkDevOpts.capacity). | ||
WithFinalizer(LocalPVFinalizer). | ||
WithBlockVolumeMode(blkDevOpts.volumeMode). | ||
Build() | ||
WithBlockVolumeMode(blkDevOpts.volumeMode) | ||
|
||
// If bdPoolName is configure, set it on the BDC | ||
if len(blkDevOpts.bdPoolName) > 0 { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we make poolName as compulsory? This will avoid for any race between app/pvc deployment and labeling of BDs. |
||
bdcObjBuilder.WithBlockDevicePoolName(blkDevOpts.bdPoolName) | ||
} | ||
|
||
bdcObj, err := bdcObjBuilder.Build() | ||
|
||
if err != nil { | ||
//TODO : Need to relook at this error | ||
|
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
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.
can this be called as 'LocalPVPoolName'?
Not sure how BlockDevicePoolName makes sense here
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.
The name is being derived from label
openebs.io/block-device-pool
, is set on the block devices.Just thinking out loud, the
pool
concept can be implemented using this label selector. We need a fixed label key that is shared by NDM and all its consumers. "Pool" may be a over-loaded term.How about using "openebs.io/block-device-tag"? And make the corresponding naming changes to the above Key, and other method names and variables.
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.
Is this understood by NDM? If yes then label key should have some indication.
I could think of below label key
blockdevice.ndm.openebs.io/tag
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.
If we want to go with pool then
blockdevice.ndm.openebs.io/pool-name
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.
If this label is applicable to BlockDevice & BlockDeviceClaim then NDM is not required in the label key. Sorry for above confusions.
So we can have
openebs.io/block-device-tag
. The one you had suggested initially.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.
with this stmt,
We need a fixed label key that is shared by NDM and all its consumers
are we saying - every NDM consumer should be fixed to this label? We don't need this as there is 'Selector' in spec of BD. If it was part of some labels of BD, it might be the case.By fixing it to fixed string, 'Selector' in 'spec' of BD can be removed and moved to label of 'BD'.
If this is just for local pv, this key has to get into StorageClass, and in the 'Selector' of BD.
Is my understanding correct?
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 will be understood by NDM and Local PV (and other storage engines possibly in future):
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.
is this the same tag for every consumer of NDM?
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.
can we get example of BD for above example?
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.
I meant - example mentioned in PR