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

Use recert for proxy seed reconfiguration #410

Merged
merged 1 commit into from
Apr 15, 2024

Conversation

omertuc
Copy link
Collaborator

@omertuc omertuc commented Mar 25, 2024

Overview

LCA will now use recert's new proxy feature. This will allow us to
support environments where the seed proxy is different than the upgraded
cluster's proxy. It will also allow us to perform a rollout-free seed
proxy reconfiguration.

Clusters with a proxy can only be upgraded using seeds that have a
proxy. Clusters without a proxy can only be upgraded using seeds that
don't have a proxy.

Notes

Two new fields have been added to SeedReconfiguration, Proxy and
StatusProxy - see commit diff for an explanation of why we need both
and how they're determined in every scenario.

Added a new HasProxy field to the seed cluster info struct.

Seed images will now contain a com.openshift.lifecycle-agent.seed_cluster_info
OCI label which will contain a JSON serialized seed cluster info struct.
This label will allow LCA (and maybe IBIO in the future?) to make
informed decisions about the compatibility of a particular seed image
with the cluster being upgraded. For example, LCA will refuse to upgrade
a cluster that has a proxy with a seed that doesn't. This label helps
LCA knows whether the seed has a proxy or not (through the new
HasProxy field), and block the upgrade appropriately before the image
even gets pulled.

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 25, 2024
Copy link
Contributor

openshift-ci bot commented Mar 25, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci openshift-ci bot added the cluster-config-api-changed Cluster config API changed. It's used by other projects. Review to ensure your change is nonbreaking label Mar 25, 2024
@omertuc omertuc force-pushed the proxy branch 2 times, most recently from d51fb0c to 9f3b439 Compare March 25, 2024 14:23
if !ok {
return fmt.Errorf(
"seed image %s is missing the %s label, please build a new image using the latest version of the lca-cli",
seedImageRef, common.SeedFormatOCILabel)
"seed image is missing the %s label, please build a new image using the latest version of the lca-cli",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not necessarily "latest version", but seed was generated from "incompatible version of LCA" maybe?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I agree, but unrelated to PR. Created #423

}

clusterInfoJSON := string(clusterInfoJSONSBytes)
if err := s.createAndPushSeedImage(clusterInfoJSON); err != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we really want all this in a label? Why not just validate the data from the manifest.json after pulling the image? I get that it would save the pull, but is there some other benefit?

Copy link
Collaborator

Choose a reason for hiding this comment

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

That said, I do like the idea of this being an easy way to access the manifest.json data without pulling the image, for expanded image validation. Are there any cons to it? Like would we end up with restrictions on what could get added to the manifest.json? I think no, but I'm not sure

Copy link
Collaborator Author

@omertuc omertuc Mar 27, 2024

Choose a reason for hiding this comment

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

Yeah exactly, it's nice to have. Couldn't think of any cons. It's information that's already in the seed, just now duplicated to different location as well (previously just a file inside a layer, now also in the manifest), so I don't see any additional compatibility restrictions this would add.

Like would we end up with restrictions on what could get added to the manifest.json?

Perhaps in terms of size. I guess at that point in the future where we need something huge in there, it would be an obvious problem and we could redact that huge thing we put in manifest.json before we serialize it to put inside the label

@omertuc omertuc marked this pull request as ready for review March 27, 2024 18:59
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 27, 2024
@openshift-ci openshift-ci bot requested review from donpenney and leo8a March 27, 2024 18:59
@leo8a
Copy link
Collaborator

leo8a commented Apr 2, 2024

/retest

Copy link
Collaborator

@leo8a leo8a left a comment

Choose a reason for hiding this comment

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

overall this looks great to me, thanks for adding it

controllers/prep_handlers.go Outdated Show resolved Hide resolved
controllers/prep_handlers.go Show resolved Hide resolved
internal/clusterconfig/clusterconfig.go Outdated Show resolved Hide resolved
@omertuc omertuc force-pushed the proxy branch 2 times, most recently from 7baeb49 to fc48508 Compare April 2, 2024 13:13
@leo8a
Copy link
Collaborator

leo8a commented Apr 2, 2024

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 2, 2024
@omertuc
Copy link
Collaborator Author

omertuc commented Apr 2, 2024

/test ibu-e2e-flow

@omertuc
Copy link
Collaborator Author

omertuc commented Apr 4, 2024

/test ibu-e2e-flow

1 similar comment
@omertuc
Copy link
Collaborator Author

omertuc commented Apr 4, 2024

/test ibu-e2e-flow

@omertuc
Copy link
Collaborator Author

omertuc commented Apr 11, 2024

/test ibu-e2e-flow

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 11, 2024
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Apr 11, 2024
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 11, 2024
@omertuc
Copy link
Collaborator Author

omertuc commented Apr 12, 2024

/test ibu-e2e-flow

@omertuc
Copy link
Collaborator Author

omertuc commented Apr 15, 2024

/remove-label cluster-config-api-changed

@openshift-ci openshift-ci bot removed the cluster-config-api-changed Cluster config API changed. It's used by other projects. Review to ensure your change is nonbreaking label Apr 15, 2024
# Overview

LCA will now use recert's new proxy feature. This will allow us to
support environments where the seed proxy is different than the upgraded
cluster's proxy. It will also allow us to perform a rollout-free seed
proxy reconfiguration.

Clusters with a proxy can only be upgraded using seeds that have a
proxy. Clusters without a proxy can only be upgraded using seeds that
don't have a proxy.

# Notes

Two new fields have been added to `SeedReconfiguration`, `Proxy` and
`StatusProxy` - see commit diff for an explanation of why we need both
and how they're determined in every scenario.

Added a new `HasProxy` field to the seed cluster info struct.

Seed images will now contain a `com.openshift.lifecycle-agent.seed_cluster_info`
OCI label which will contain a JSON serialized seed cluster info struct.
This label will allow LCA (and maybe IBIO in the future?) to make
informed decisions about the compatibility of a particular seed image
with the cluster being upgraded. For example, LCA will refuse to upgrade
a cluster that has a proxy with a seed that doesn't. This label helps
LCA knows whether the seed has a proxy or not (through the new
`HasProxy` field), and block the upgrade appropriately before the image
even gets pulled.

# install-config

On top of proxy, we're also going to be using recert's new
install-config option. See comment about the new InstallConfig field in
the seed reconfiguration struct for more information about why.
@openshift-ci openshift-ci bot added the cluster-config-api-changed Cluster config API changed. It's used by other projects. Review to ensure your change is nonbreaking label Apr 15, 2024
@omertuc
Copy link
Collaborator Author

omertuc commented Apr 15, 2024

/remove-label cluster-config-api-changed

@openshift-ci openshift-ci bot removed the cluster-config-api-changed Cluster config API changed. It's used by other projects. Review to ensure your change is nonbreaking label Apr 15, 2024
@omertuc
Copy link
Collaborator Author

omertuc commented Apr 15, 2024

/test ibu-e2e-flow

Copy link
Collaborator

@donpenney donpenney left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 15, 2024
@omertuc
Copy link
Collaborator Author

omertuc commented Apr 15, 2024

/approve

Copy link
Contributor

openshift-ci bot commented Apr 15, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: omertuc

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:

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 15, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit 0cf7fed into openshift-kni:main Apr 15, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants