From ff7cd33f27144515ddabec3279b241980c8e5db8 Mon Sep 17 00:00:00 2001 From: Wahab Ali Date: Mon, 9 Sep 2024 16:58:11 -0400 Subject: [PATCH] Added Sveltos as a subchart of HMC --- config/dev/aws-managedcluster.yaml | 7 +++++-- internal/controller/management_controller.go | 7 +++++++ internal/helm/release.go | 8 ++++++++ templates/hmc/Chart.lock | 7 +++++-- templates/hmc/Chart.yaml | 4 ++++ templates/hmc/values.yaml | 4 ++++ 6 files changed, 33 insertions(+), 4 deletions(-) diff --git a/config/dev/aws-managedcluster.yaml b/config/dev/aws-managedcluster.yaml index 7c664e1af..2bf6b6b0d 100644 --- a/config/dev/aws-managedcluster.yaml +++ b/config/dev/aws-managedcluster.yaml @@ -1,16 +1,19 @@ apiVersion: hmc.mirantis.com/v1alpha1 kind: ManagedCluster metadata: - name: aws-dev + name: wali-aws-dev namespace: ${NAMESPACE} spec: template: aws-standalone-cp config: - region: us-east-2 + region: ca-central-1 publicIP: true controlPlaneNumber: 1 workersNumber: 1 controlPlane: + amiID: ami-04e7552b5a2a47e47 instanceType: t3.small worker: + amiID: ami-04e7552b5a2a47e47 instanceType: t3.small + installBeachHeadServices: false diff --git a/internal/controller/management_controller.go b/internal/controller/management_controller.go index 862561012..375a74ef1 100644 --- a/internal/controller/management_controller.go +++ b/internal/controller/management_controller.go @@ -250,6 +250,10 @@ func (r *ManagementReconciler) enableAdditionalComponents(ctx context.Context, m if config["cluster-api-operator"] != nil { capiOperatorValues = config["cluster-api-operator"].(map[string]interface{}) } + sveltosValues := make(map[string]interface{}) + if config["projectsveltos"] != nil { + sveltosValues = config["projectsveltos"].(map[string]interface{}) + } err := certmanager.VerifyAPI(ctx, r.Config, r.Scheme, hmc.ManagementNamespace) if err != nil { @@ -268,6 +272,9 @@ func (r *ManagementReconciler) enableAdditionalComponents(ctx context.Context, m } config["cluster-api-operator"] = capiOperatorValues + sveltosValues["enabled"] = true + config["projectsveltos"] = sveltosValues + updatedConfig, err := json.Marshal(config) if err != nil { return fmt.Errorf("failed to marshal HMC config: %v", err) diff --git a/internal/helm/release.go b/internal/helm/release.go index 2793442e6..284cabece 100644 --- a/internal/helm/release.go +++ b/internal/helm/release.go @@ -62,6 +62,14 @@ func ReconcileHelmRelease( Values: values, DependsOn: dependsOn, } + + // if name == "hmc" { + // fmt.Printf("$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ HMCCCCCC $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\n") + // helmRelease.Spec.Timeout = &metav1.Duration{Duration: time.Minute * 15} + // fmt.Printf(">>>>>>>>>> helmRelease.Spec.Timeout=%s\n", helmRelease.Spec.Timeout) + // fmt.Printf("\n$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ HMCCCCC $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\n") + // } + return nil }) if err != nil { diff --git a/templates/hmc/Chart.lock b/templates/hmc/Chart.lock index 841bb2fda..28665e050 100644 --- a/templates/hmc/Chart.lock +++ b/templates/hmc/Chart.lock @@ -8,5 +8,8 @@ dependencies: - name: cluster-api-operator repository: https://kubernetes-sigs.github.io/cluster-api-operator version: 0.12.0 -digest: sha256:f29162745d3dd876c3e35689b6771faa7b66d5f91c0ac532c28db580deadf218 -generated: "2024-08-21T19:47:21.00915+04:00" +- name: projectsveltos + repository: https://msr.ci.mirantis.com/charts/wali/projectsveltos/ + version: 0.37.0-dev +digest: sha256:425a45ffbca4126dd2ca1aa99d89a05a097e5e07dcb87266cc79efc4b6bcb0c7 +generated: "2024-09-05T22:33:34.328852-04:00" diff --git a/templates/hmc/Chart.yaml b/templates/hmc/Chart.yaml index f99b27224..2fc2f8530 100644 --- a/templates/hmc/Chart.yaml +++ b/templates/hmc/Chart.yaml @@ -35,3 +35,7 @@ dependencies: version: 0.12.0 repository: https://kubernetes-sigs.github.io/cluster-api-operator condition: cluster-api-operator.enabled + - name: projectsveltos + version: 0.37.0-dev + repository: https://msr.ci.mirantis.com/charts/wali/projectsveltos/ + condition: projectsveltos.enabled diff --git a/templates/hmc/values.yaml b/templates/hmc/values.yaml index a0ee6dac7..d3a5eef91 100644 --- a/templates/hmc/values.yaml +++ b/templates/hmc/values.yaml @@ -88,3 +88,7 @@ cluster-api-operator: requests: cpu: 100m memory: 150Mi + +projectsveltos: + enabled: false + namespace: projectsveltos