Skip to content

Addon upgrade flux 2.4 - #766

Open
bugbuilder wants to merge 5 commits into
kubevela:masterfrom
bugbuilder:master
Open

bugbuilder wants to merge 5 commits into
kubevela:masterfrom
bugbuilder:master

Conversation

@bugbuilder

Copy link
Copy Markdown

This update includes all the necessary changes to upgrade Flux to its 2.4 GA version, ensuring compatibility and enhanced functionality for the addon. The key changes are:

  • Integration of the Notification Controller: The Notification Controller is now included, enabling centralized event management within Flux and adding associated parameters for proper configuration.
  • Resource Parameter Customization: Support for customizing requests and limits values has been implemented to optimize resource usage for controllers.
  • CRD Updates: Custom Resource Definitions (CRDs) have been updated to reflect changes and improvements introduced in Flux 2.4 GA, ensuring compatibility with the new version.

Some practices, such as priorityClassName, securityContext, and terminationGracePeriodSeconds, were not implemented as they are currently not supported by the webservice component type. Discussions regarding their support are still ongoing in the community, as referenced in kubevela/kubevela#5580.

I would appreciate clarification on what types of tests should be run to ensure the changes meet the project's merge requirements. This would help validate the implementation further and ensure compatibility across different environments.

@gsmartino23 gsmartino23 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

wonderflow
wonderflow previously approved these changes Nov 29, 2024

@wonderflow wonderflow left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

appreciate the contribution, please help sign the DCO

Signed-off-by: bugbuilder <nelson@v7n.cl>
Signed-off-by: bugbuilder <nelson@v7n.cl>
Signed-off-by: bugbuilder <nelson@v7n.cl>
Signed-off-by: bugbuilder <nelson@v7n.cl>
wonderflow
wonderflow previously approved these changes Dec 4, 2024
@wonderflow

Copy link
Copy Markdown
Collaborator

oops, sorry the conflict happen when I merged other PR

Signed-off-by: bugbuilder <nelson@v7n.cl>
@bugbuilder

Copy link
Copy Markdown
Author

oops, sorry the conflict happen when I merged other PR

No worries, already fixed it

@bugbuilder
bugbuilder requested a review from wonderflow December 4, 2024 18:51

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

mrge found 17 issues across 25 files. View them in mrge.io

memory: "1Gi"
}
requests: {
cpu: "100m"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

CPU resource request (100m) is significantly lower than the limit (1000m) with a 10:1 ratio, which could lead to resource overcommitment and potential container throttling

}
requests: {
cpu: "100m"
memory: "64Mi"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Memory resource request (64Mi) is significantly lower than the limit (1Gi) with a 16:1 ratio, which could lead to pod evictions if actual usage exceeds requests

value: _targetNamespace
},
{
name: "GOMAXPROCS"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

GOMAXPROCS set to limits.cpu might cause performance issues if container is throttled

properties: {
if parameter.imageAutomationControllerOptions != _|_ {
args: controllerArgs + parameter.imageAutomationControllerOptions
args: eventAddrArgs + parameter.imageAutomationControllerOptions

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The code replaces controllerArgs with eventAddrArgs but doesn't properly handle case when notification-controller (which eventAddrArgs depends on) is not deployed

value: _targetNamespace
},
{
name: "GOMAXPROCS"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing validation for CPU limits when setting GOMAXPROCS

@@ -1,5 +1,5 @@
name: fluxcd
version: 3.0.1
version: 3.1.0

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The version bump is correct, but there's a bug in the newly added notification-controller.cue file

if parameter.notificationControllerResourceLimits.memory != _|_ {
memory: parameter.notificationControllerResourceLimits.memory
}
if parameter.sourceControllerResourceLimits.memory == _|_ {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Incorrect variable reference: using sourceControllerResourceLimits when checking notification controller memory limits

type: "object"
}
served: true
storage: true

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Setting v1 as the storage version while keeping older versions served could lead to data loss if not handled properly during upgrade

type: "date"
}]
name: "v1beta1"
deprecated: true

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Deprecating v1beta1 and v1beta2 without a migration path might lead to breaking changes for existing users

type: "string"
}
required: ["name"]
type: "object"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The schema for v1 introduces several new fields without specifying defaults that might cause issues for existing resources

@Jetiaime

Copy link
Copy Markdown

Still Have #785

@briankane

Copy link
Copy Markdown
Member

Thanks @bugbuilder, and sorry this sat so long. I gave it a go on k3d with vela-core 1.11 and hit a wall that isn't down to you: with the 2.4 CRDs inlined, the addon's Application is ~800 KB and vela-core 1.11's Application webhook can't validate it inside its 10s timeout, so the enable fails (fresh and upgrading from 3.0.2). Master is fine (~1s). That's kubevela/kubevela#7681, with a 1.11 backport asked for.

Installing Flux from its Helm chart with the native helmchart component (#787) keeps the Application tiny, but on 1.11 it hits two helmchart bugs that are only fixed on master (kubevela/kubevela#7683).

So for now this waits on one of those landing in a 1.11.x. A few things for whenever you pick it back up:

  • it needs a rebase: Fix: velaux addon change for upgraded cue compatibility #788 moved the template to list.Concat (CUE 0.11+ breaks list +), and the new args should use it too
  • the notification controller's memory limit is checked against sourceControllerResourceLimits, and the kustomize controller's requests read the limits parameter
  • source-controller is still on v1.1.0; Flux 2.4.0 ships v1.4.1
  • set system: vela to the release that carries the fix, so older clusters stay on 3.0.2

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/fluxcd FluxCD addon issue-required PR has no linked issue type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants