-
Notifications
You must be signed in to change notification settings - Fork 8
feat(v3): headless install orchestrator implementation #3173
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(v3): headless install orchestrator implementation #3173
Conversation
|
This PR has been released (on staging) and is available for download with a embedded-cluster-smoke-test-staging-app license ID. Online Installer: Airgap Installer (may take a few minutes before the airgap bundle is built): Happy debugging! |
2e00122 to
2fc9e43
Compare
7b94ab5 to
86be12d
Compare
|
|
||
| // --- validate registry --- // | ||
| expectedRegistryIP := "10.2.128.11" // lower band index 10 | ||
| validateCustomCIDR(t, &dr, hcli) |
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.
this was moved to install_common.go and user for both v2 and v3 tests
| } | ||
|
|
||
| if dryrun.Enabled() { | ||
| hcli, err := helm.NewClient(helm.HelmOptions{}) |
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.
shouldn't this be coming from the dryrun package?
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.
seems to work as is
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 uses the factory pattern and returns a helm client singleton for now when dryrun. this will not work for tests in parallel but its something we can fix 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.
i'm sure it'll work because dryrun overrides globals. but it's still confusing. any reason not to expose the dryrun's helm client via a "HelmClient" public method like the dryrun.KubeClient method below?
|
|
||
| func TestV3InstallHeadless_HappyPath(t *testing.T) { | ||
| licenseFile, configFile := setupV3HeadlessTest(t) | ||
| func TestV3InstallHeadless_HappyPathAirgap(t *testing.T) { |
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.
so this test doesn't validate anything? just that there is no error? feels like it should validate many things similar to the v2 tests that have airgap bundles
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.
there are no airgap tests in v2. if you look in the TODO section of the description I intend to add more dryrun tests but it will drag this pull request out especially if im chasing full coverage.
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.
im going to vaildate airgap things like the registry addon and certain preflight checks...
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.
added
| var ( | ||
| //go:embed assets/real-license.yaml | ||
| realLicenseData string | ||
| func TestV3InstallHeadless_HappyPathOnline(t *testing.T) { |
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.
feels like these functions should be validating more than just "no error was returned"
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 seems like that should be up to the targeted tests. What would you have this validate?
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.
ok, im going to vaildate non-airgap things like the registry addon and certain preflight checks...
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.
added
| k0s.Set(client.K0sClient) | ||
| k0s.SetClientFactory(func() k0s.K0sInterface { | ||
| return &K0s{} | ||
| }) |
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.
Bug: Factory creates broken objects, causing crashes.
The k0s.SetClientFactory returns an uninitialized dryrun.K0s struct with a nil k0s field. When any method like Install, NewK0sConfig, WriteK0sConfig, or PatchK0sConfig is called on the returned instance, it will panic with a nil pointer dereference because these methods call c.k0s.Method(...). The factory should initialize the k0s field with new(k0s.K0s) like the direct initialization does on line 76.
tests/dryrun/install_common.go
Outdated
| found := false | ||
| extraEnvValue := operatorOpts.Values["extraEnv"] | ||
| switch extraEnv := extraEnvValue.(type) { | ||
| case []any: |
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.
something is wrong here that needs to be fixed
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 think it's the yaml marshal / unmarshal that's ruining this, and that only happens when end user overrides are specified maybe? either way, maybe we should create a helper function so this logic isn't duplicated everywhere
* feat(v3): headless install orchestrator implementation * f * f * f * feedback * feedback * feedback * f * f * f * f * f * f * f * f * f * f
Summary
This PR implements the headless install orchestrator for Embedded Cluster v3, enabling automated installations without interactive UI prompts. The orchestrator coordinates the full installation flow including host preflights, infrastructure setup, airgap processing, application configuration, app preflights, and final application installation.
Changes
API & Client Enhancements
POST /api/linux/install/host-preflights/runGET /api/linux/install/host-preflights/statusPOST /api/linux/install/airgap/processGET /api/linux/install/airgap/statusController Architecture
api/api.go:124,138: AddedWithKubeClient()andWithMetadataClient()optionsHeadless Install Orchestrator
Dry Run Support
cmd/installer/cli/api.go:112-130)Other Changes
*.tgzfiles (helm chart dependencies now tracked)Example Usage
Testing
api/client/client_test.go)TODO (for follow up PRs)
Related
Part of v3 headless install implementation work.