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

[BOP-951] Introduce dependencies for helm chart addons #92

Merged
merged 3 commits into from
Sep 24, 2024

Conversation

byDimasik
Copy link
Contributor

@byDimasik byDimasik commented Sep 24, 2024

Description

Allow specifying dependencies for helm chart addons. FluxCD supports dependencies and asks for the name and the namespace of the HelmRelease. In BOP, we create the HelmRelease objects, so, in the blueprint, it's enough to specify the addon name without the need to set a namespace which is always blueprint-system.

Testing

Deployed MKE Dashboard addon with nginx as in the dependencies, the blueprint looked like this

    - chart:
        dependsOn:
        - nginx
        name: mke-dashboard-chart
        repo: oci://ghcr.io/mirantiscontainers

The resulting HelmRelease

% kb get helmrelease ui -oyaml
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
  <...>
spec:
  chart:
    <...>
  dependsOn:
  - name: nginx
    namespace: blueprint-system

@byDimasik byDimasik requested a review from a team September 24, 2024 16:40
@@ -30,8 +30,9 @@ type ChartInfo struct {
// +kubebuilder:validation:Required
Version string `json:"version"`

Set map[string]intstr.IntOrString `json:"set,omitempty"`
Values string `json:"values,omitempty"`
DependsOn []string `json:"dependsOn,omitempty"`
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should be of type NamespacedObjectReference so we can depend on a addon from another namespace?

Copy link
Contributor Author

@byDimasik byDimasik Sep 24, 2024

Choose a reason for hiding this comment

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

@ranyodh

Nope, FluxCD needs the HelmRelease name and namespace. BOP generates all helm releases with the following values:

&helmv2.HelmRelease{
    ObjectMeta: metav1.ObjectMeta{
        Name:      addon.Spec.Name,
        Namespace: consts.NamespaceBoundlessSystem,
    },
},

here the namespace is always blueprint-system, and the release name is the addon name, so, all we need to allow dependencies between addons is the addon name.

@byDimasik byDimasik requested a review from ranyodh September 24, 2024 18:44
Copy link
Collaborator

@nwneisen nwneisen left a comment

Choose a reason for hiding this comment

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

Just one thought

api/v1alpha1/blueprint_webhook.go Show resolved Hide resolved
api/v1alpha1/blueprint_webhook.go Show resolved Hide resolved
@byDimasik byDimasik merged commit 7f33bc5 into Mirantis:main Sep 24, 2024
5 checks passed
@byDimasik byDimasik deleted the addon_dependencies branch September 24, 2024 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants