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

Add a provision for handling image based bootstrap #406

Merged
merged 3 commits into from
Apr 11, 2024

Conversation

yanhua121
Copy link
Contributor

@yanhua121 yanhua121 commented Apr 5, 2024

AHV has a limit of 32KB for cloud-init userdata. In Openshift, the ignition can be rather large (a magnitude over the limit). In order to support larger userdata files, we allow mounting the customization as an image. This can be done using the BootstrapRef property of the NutanixMachine spec.

apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: NutanixMachine
metadata:
  name: machine-name
  namespace: cluster-namespace
spec:
  ...
  bootstrapRef:
    kind: Image
    name: cluster-bootstrap.iso

@deepakm-ntnx
Copy link
Contributor

pls add unit-test and e2e tests (tracker if want to do it in separate PR) to verify

api/v1beta1/nutanixmachine_types.go Outdated Show resolved Hide resolved
controllers/nutanixmachine_controller.go Outdated Show resolved Hide resolved
Copy link
Contributor

@thunderboltsid thunderboltsid left a comment

Choose a reason for hiding this comment

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

we need to solve this more generically than we are in this change.

@thunderboltsid thunderboltsid changed the title Fix KRBN-8120: add optional field bootstrapImageName to NutanixMachine Add a provision for handling image based bootstrap Apr 9, 2024
Base automatically changed from jira/krbn-8115 to main April 9, 2024 20:10
AHV has a limit of 32KB for cloud-init userdata. In Openshift, the
ignition can be rather large (a magnitude over the limit). In
order to support larger userdata files, we allow mounting the customization
as an image.
Copy link

codecov bot commented Apr 9, 2024

Codecov Report

Attention: Patch coverage is 0% with 53 lines in your changes are missing coverage. Please review.

Project coverage is 25.07%. Comparing base (92800d9) to head (4d05296).

Files Patch % Lines
controllers/nutanixmachine_controller.go 0.00% 53 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #406      +/-   ##
==========================================
- Coverage   25.63%   25.07%   -0.56%     
==========================================
  Files          19       19              
  Lines        1303     1332      +29     
==========================================
  Hits          334      334              
- Misses        969      998      +29     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@thunderboltsid
Copy link
Contributor

/retest

@thunderboltsid
Copy link
Contributor

/test e2e-capx-controller-upgrade

Copy link
Contributor Author

@yanhua121 yanhua121 left a comment

Choose a reason for hiding this comment

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

LGTM. The code changes look good to me. And my local integration test using this branch with the OCP installer passed.

Copy link
Contributor

@deepakm-ntnx deepakm-ntnx left a comment

Choose a reason for hiding this comment

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

can we document the yaml input for review as well

@yanhua121 yanhua121 self-assigned this Apr 10, 2024
@yanhua121 yanhua121 removed their assignment Apr 10, 2024
Copy link
Contributor

@thunderboltsid thunderboltsid left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@nutanix-cn-prow-bot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: deepakm-ntnx, dkoshkin, thunderboltsid, yanhua121

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [deepakm-ntnx,thunderboltsid]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@thunderboltsid thunderboltsid merged commit 25ba78f into main Apr 11, 2024
10 of 13 checks passed
@thunderboltsid thunderboltsid deleted the jira/krbn-8120 branch April 11, 2024 22:07
thunderboltsid added a commit that referenced this pull request Apr 11, 2024
* Add a provision for handling image based bootstrap

AHV has a limit of 32KB for cloud-init userdata. In Openshift, the
ignition can be rather large (a magnitude over the limit). In
order to support larger userdata files, we allow mounting the customization
as an image.

* Only set guestcustomization explicitly when bootstrap ref is secret

* Use lowercase for data_source_reference kind.

---------

Co-authored-by: Sid Shukla <[email protected]>
thunderboltsid added a commit that referenced this pull request Apr 11, 2024
* Add a provision for handling image based bootstrap

AHV has a limit of 32KB for cloud-init userdata. In Openshift, the
ignition can be rather large (a magnitude over the limit). In
order to support larger userdata files, we allow mounting the customization
as an image.

* Only set guestcustomization explicitly when bootstrap ref is secret

* Use lowercase for data_source_reference kind.

---------

Co-authored-by: Sid Shukla <[email protected]>
thunderboltsid added a commit that referenced this pull request Apr 11, 2024
* Add a provision for handling image based bootstrap

AHV has a limit of 32KB for cloud-init userdata. In Openshift, the
ignition can be rather large (a magnitude over the limit). In
order to support larger userdata files, we allow mounting the customization
as an image.

* Only set guestcustomization explicitly when bootstrap ref is secret

* Use lowercase for data_source_reference kind.

---------

Co-authored-by: Sid Shukla <[email protected]>
thunderboltsid added a commit that referenced this pull request Apr 16, 2024
* Add a provision for handling image based bootstrap

AHV has a limit of 32KB for cloud-init userdata. In Openshift, the
ignition can be rather large (a magnitude over the limit). In
order to support larger userdata files, we allow mounting the customization
as an image.

* Only set guestcustomization explicitly when bootstrap ref is secret

* Use lowercase for data_source_reference kind.

---------

Co-authored-by: Yanhua Li <[email protected]>
thunderboltsid added a commit that referenced this pull request May 7, 2024
* Add a provision for handling image based bootstrap

AHV has a limit of 32KB for cloud-init userdata. In Openshift, the
ignition can be rather large (a magnitude over the limit). In
order to support larger userdata files, we allow mounting the customization
as an image.

* Only set guestcustomization explicitly when bootstrap ref is secret

* Use lowercase for data_source_reference kind.

---------

Co-authored-by: Sid Shukla <[email protected]>
thunderboltsid added a commit that referenced this pull request May 8, 2024
* Ensure fallback config is only read when prismCentral is absent (#403)

Skip reading fallback config file from /etc/nutanix/config/prismCentral
if NutanixCluster has prismCentral set.

Co-authored-by: Sid Shukla <[email protected]>

* Add a provision for handling image based bootstrap (#406)

* Add a provision for handling image based bootstrap

AHV has a limit of 32KB for cloud-init userdata. In Openshift, the
ignition can be rather large (a magnitude over the limit). In
order to support larger userdata files, we allow mounting the customization
as an image.

* Only set guestcustomization explicitly when bootstrap ref is secret

* Use lowercase for data_source_reference kind.

---------

Co-authored-by: Sid Shukla <[email protected]>

* Introduce a nutanix prism client cache (#415)

* Introduce a nutanix prism client cache

The cache stores a prismgoclient.V3 client instance for each NutanixCluster instance.
The cache is shared between nutanixcluster and nutanixmachine controllers.

* Address review comments

* Update CAPI version in go.mod

This is to ensure newer versions of interfaces from SharedIndexInformers
don't cause compile failures.

Update go version to v1.22 becasue cmp.Or is only available in go v1.22

update prism-go-client

---------

Co-authored-by: Deepak Muley <[email protected]>
Co-authored-by: Yanhua Li <[email protected]>
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.

4 participants