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
Install LVMCluster
resource during crc start
#4114
base: main
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
pkg/crc/config/settings.go
Outdated
@@ -37,6 +37,7 @@ const ( | |||
EmergencyLogin = "enable-emergency-login" | |||
PersistentVolumeSize = "persistent-volume-size" | |||
EnableBundleQuayFallback = "enable-bundle-quay-fallback" | |||
SecondaryDiskSize = "secondary-disk-size" |
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.
Isn't this similar to PersistentVolumeSize
?
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.
yes practically they are the same, one difference is that secondary-disk-size
is at the VM level similar to cpus
,memory
and persistent-volume-size
is at the openshift cluster level
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.
Do we need to expose this difference to the user?
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.
nope, going to use the same config key persistent-volume-size
and remove the newly added one
pkg/drivers/vfkit/driver_darwin.go
Outdated
if crcos.FileExists(d.getSecondaryDiskPath()) { | ||
return nil | ||
} | ||
_, err := diskfs.Create(d.getSecondaryDiskPath(), int64(d.SecondaryDiskSize), diskfs.Raw, diskfs.SectorSizeDefault) |
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 diskfs
required? Could this use os.Truncate
directly to create an empty disk image?
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.
yes, this works, tried using os.Truncate
, we have to first create an empty file and then change the size using os.Truncate
cmd/crc/cmd/start.go
Outdated
@@ -79,6 +79,7 @@ func runStart(ctx context.Context) (*types.StartResult, error) { | |||
IngressHTTPPort: config.Get(crcConfig.IngressHTTPPort).AsUInt(), | |||
IngressHTTPSPort: config.Get(crcConfig.IngressHTTPSPort).AsUInt(), | |||
EnableSharedDirs: config.Get(crcConfig.EnableSharedDirs).AsBool(), | |||
SecondaryDiskSize: config.Get(crcConfig.SecondaryDiskSize).AsInt(), |
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.
Here we assume only a second disk could exist. But what about Disks
?
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.
to make it work with more disks, we'd have to create a separate DiskConfig
type maybe.. containing the path and the size then add that to the drivers, i went with this simpler approach to first take care of the requirements for installing topolvm
this PR is not needed anymore, the snc PRs:
|
apply yaml manifest to create the lvmcluster resource which creates the storage class and csi drivers
to use the LVM Storage Operator we need a separate partition which is created on bundle generation if users wish to use this partition to install the LVMS operator they have to set it to 'true' which is checked during `crc start` and the partition is kept, if this is set to 'false' (default) then the partition is deleted and the free space is merged with the root partition
this uses the config option added in the previous commit to decide if the extra partition should be kept or deleted keeping the partition allows users to easily install LVMS operator
@anjannath: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
fixes #4097
needs crc-org/machine-driver-libvirt#115