Skip to content

Commit

Permalink
Hub metrics collector feature (stolostron#1316)
Browse files Browse the repository at this point in the history
* install Metrics Without Addon

Signed-off-by: clyang82 <[email protected]>

* install Metrics Without Addon

Signed-off-by: clyang82 <[email protected]>

* install Metrics Without Addon

Signed-off-by: clyang82 <[email protected]>

* modify endpoint operator

Signed-off-by: clyang82 <[email protected]>

* modify endpoint operator

Signed-off-by: clyang82 <[email protected]>

* check for global hub operator and prevent observability from installing in the spokes

Signed-off-by: Coleen Iona Quadros <[email protected]>

---------

Signed-off-by: clyang82 <[email protected]>
Signed-off-by: Coleen Iona Quadros <[email protected]>
Co-authored-by: clyang82 <[email protected]>
  • Loading branch information
coleenquadros and clyang82 committed Feb 10, 2024
1 parent 8603ec0 commit e6c815c
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,6 @@ func (r *PlacementRuleReconciler) Reconcile(ctx context.Context, req ctrl.Reques
return ctrl.Result{}, nil
}

//Check for MulticlusterGlobalHub CRD
mcghCrdExists := r.CRDMap[config.MCGHCrdName]
log.Info("Coleen MulticlusterGlobalHub CRD exists", "exists", mcghCrdExists)
//if Multicluster Global hub exists we block metrics-collector creation in spokes
if mcghCrdExists {
mco.Spec.ObservabilityAddonSpec.EnableMetrics = false
}

if !deleteAll && !mco.Spec.ObservabilityAddonSpec.EnableMetrics {
reqLogger.Info("EnableMetrics is set to false. Delete Observability addons")
deleteAll = true
Expand Down
9 changes: 0 additions & 9 deletions operators/multiclusterobservability/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ package main
import (
"flag"
"fmt"
"github.com/cloudflare/cfssl/log"
"os"

// Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
Expand Down Expand Up @@ -261,18 +260,10 @@ func main() {
os.Exit(1)
}

mcghCrdExists, err := operatorsutil.CheckCRDExist(crdClient, config.MCGHCrdName)
log.Info("Coleen Checking if MCGH CRD exists", "exists", mcghCrdExists)
if err != nil {
setupLog.Error(err, "Coleen")
os.Exit(1)
}

crdMaps := map[string]bool{
config.MCHCrdName: mchCrdExists,
config.StorageVersionMigrationCrdName: svmCrdExists,
config.IngressControllerCRD: ingressCtlCrdExists,
config.MCGHCrdName: mcghCrdExists,
}

if err = (&mcoctrl.MultiClusterObservabilityReconciler{
Expand Down
1 change: 0 additions & 1 deletion operators/multiclusterobservability/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,6 @@ const (
IngressControllerCRD = "ingresscontrollers.operator.openshift.io"
MCHCrdName = "multiclusterhubs.operator.open-cluster-management.io"
MCOCrdName = "multiclusterobservabilities.observability.open-cluster-management.io"
MCGHCrdName = "multiclusterglobalhubs.operator.open-cluster-management.io"
StorageVersionMigrationCrdName = "storageversionmigrations.migration.k8s.io"
)

Expand Down

0 comments on commit e6c815c

Please sign in to comment.