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

Extending Runtime Custom Resource with Additional Workers #601

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

Conversation

koala7659
Copy link
Contributor

@koala7659 koala7659 commented Jan 13, 2025

Add ability to define and modify multiple workers for a Gardener shoot in the additionalWorkers collection

Description:

Changes proposed in this pull request:

  • Extending Runtime Custom Resource with additionalWorkers collection - it will allow to define more worker groups in Gardener Shoot for Kyma Runtime
  • Update logic of NewProviderExtenderPatchOperation to patch Zones and version information for each Worker separately.
  • Improve logic to provide provider configuration by SRE and apply on created shoot.
  • InfrastructureConfig and ControlPlaneConfig are treated as immutable during update unless they are specified in the RuntimeCR

Logic flow operation update:

On shoot create:

  • There must be single main worker and optional set of additional workers in additionalWorkers collection
  • Additional workers can have different set of networking zones specified than main worker
  • InfrastructureConfig and controlPlaneConfig are created to include ALL zones used in ALL provided workers .
  • If infrastructureConfig and controlPlaneConfig are provided in RuntimeCR they will be used to create Shoot
    • If in such predefined infrastructureConfig zones cannot match with worker zones - the operation will fail

On shoot update:

  • There must be single main worker and optional set of additional workers
  • User can add new or remove existing workers from additionalWorkers collection. This operation will not affect existing infrastructureConfig and controlPlaneConfig
  • InfrastructureConfig and ControlPlaneConfig shoot data are immutable
  • For Azure and AWS shoots every zone used for each worker must be included into the set of zones used in the infrastructureConfig
  • As networking zones for updated workers cannot be changed - they will be overriden with zones from Gardener on the fly fly based on the Worker name
  • If infrastructureConfig and controlPlaneConfig are provided in RuntimeCR they will be used to create Shoot
    • If in such predefined infrastructureConfig zones cannot match with worker zones - the operation will fail

Additional:

  • Update logic for Workers image version update during Patch operation to be aligned based on existing Gardener shoot Worker name

Related issue(s)
#46

@koala7659 koala7659 requested a review from a team as a code owner January 13, 2025 15:04
@kyma-bot kyma-bot added cla: yes Indicates the PR's author has signed the CLA. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jan 13, 2025
@koala7659 koala7659 marked this pull request as draft January 13, 2025 15:14
@kyma-bot kyma-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 13, 2025
@kyma-bot kyma-bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jan 17, 2025
@koala7659 koala7659 marked this pull request as ready for review January 18, 2025 18:39
@kyma-bot kyma-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 18, 2025
var controlPlaneConf, infraConfig *runtime.RawExtension
zones := getZones(rt.Spec.Shoot.Provider.Workers)
infraConfig, controlPlaneConf, err = getConfig(rt.Spec.Shoot, zones)
if len(rt.Spec.Shoot.Provider.Workers) != 1 {
Copy link
Contributor

Choose a reason for hiding this comment

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

NOTE: we can have this code moved to validation webhook later on

infraConfig, controlPlaneConf, err = getConfig(rt.Spec.Shoot, zones)
if err != nil {
return err
if len(rt.Spec.Shoot.Provider.Workers) != 1 {
Copy link
Contributor

Choose a reason for hiding this comment

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

NOTE: we can have this code moved to validation webhook later on

Comment on lines +254 to +266
// uncomment if we decide to require to validate to have all same zones in all workers
//
//if len(workers) == 1 {
// return zones, nil
//}
//
//for _, worker := range workers {
// if !slices.Equal(worker.Zones, zones) {
// return nil, errors.New("workers have specified different zones set, or zones are in different order")
// }
//}

return zones, nil
Copy link
Contributor

Choose a reason for hiding this comment

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

We can clean up this part.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Indicates the PR's author has signed the CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants