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

Install LVMCluster resource during crc start #4114

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

anjannath
Copy link
Member

@openshift-ci openshift-ci bot requested review from cfergeau and gbraad April 9, 2024 12:30
Copy link

openshift-ci bot commented Apr 9, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from anjannath. For more information see the Kubernetes Code Review Process.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@@ -37,6 +37,7 @@ const (
EmergencyLogin = "enable-emergency-login"
PersistentVolumeSize = "persistent-volume-size"
EnableBundleQuayFallback = "enable-bundle-quay-fallback"
SecondaryDiskSize = "secondary-disk-size"
Copy link
Contributor

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?

Copy link
Member Author

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

Copy link
Contributor

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?

Copy link
Member Author

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

if crcos.FileExists(d.getSecondaryDiskPath()) {
return nil
}
_, err := diskfs.Create(d.getSecondaryDiskPath(), int64(d.SecondaryDiskSize), diskfs.Raw, diskfs.SectorSizeDefault)
Copy link
Contributor

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?

Copy link
Member Author

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

@@ -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(),
Copy link
Contributor

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 ?

Copy link
Member Author

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

@anjannath
Copy link
Member Author

this PR is not needed anymore, the snc PRs:

  1. add LVMS operator to openshift cluster snc#869
  2. add LVMS operator to openshift cluster snc#869
    will take care of all the steps needed to install topolvm entirely on snc

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
Copy link

openshift-ci bot commented Apr 16, 2024

@anjannath: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/security ffc6320 link false /test security
ci/prow/e2e-microshift-crc ffc6320 link true /test e2e-microshift-crc
ci/prow/integration-crc ffc6320 link true /test integration-crc
ci/prow/e2e-crc ffc6320 link true /test e2e-crc

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

create LVMCluster resource on crc start
3 participants