Skip to content

Commit

Permalink
Added Sveltos as a subchart of HMC
Browse files Browse the repository at this point in the history
  • Loading branch information
wahabmk committed Sep 9, 2024
1 parent 4f73b87 commit ff7cd33
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 4 deletions.
7 changes: 5 additions & 2 deletions config/dev/aws-managedcluster.yaml
Original file line number Diff line number Diff line change
@@ -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
7 changes: 7 additions & 0 deletions internal/controller/management_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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)
Expand Down
8 changes: 8 additions & 0 deletions internal/helm/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
7 changes: 5 additions & 2 deletions templates/hmc/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
4 changes: 4 additions & 0 deletions templates/hmc/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 4 additions & 0 deletions templates/hmc/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,7 @@ cluster-api-operator:
requests:
cpu: 100m
memory: 150Mi

projectsveltos:
enabled: false
namespace: projectsveltos

0 comments on commit ff7cd33

Please sign in to comment.