---
# System prepended metadata

title: Setear observabilidad en RHACM 2.5

---

# Setear observabilidad en RHACM 2.5

Al setear la observabilidad, por defecto, tomara la data de todos los cluster. Si necesitamos limitar esto, se debe agregar el label 'observability: disabled' al cluster.

## Crear Namespace

```
$ oc create namespace open-cluster-management-observability
```

## Generar la pull-secret

```
$ DOCKER_CONFIG_JSON=`oc extract secret/pull-secret -n openshift-config --to=-`
$ oc create secret generic multiclusterhub-operator-pull-secret \
    -n open-cluster-management-observability \
    --from-literal=.dockerconfigjson="$DOCKER_CONFIG_JSON" \
    --type=kubernetes.io/dockerconfigjson
```

## Crear el OBC

Se debe descargar previamente el [administrador de noobaa](https://access.redhat.com/downloads/content/547/ver=4/rhel---8/4.10.0/x86_64/product-software). 

```
$ oc project open-cluster-management-observability
$ oc describe noobaa -n openshift-storage
$ noobaa obc create thanos-rhacm-observability -n openshift-storage
```

## Obtener la infromación necesaria para crear la secret del bucket:
* Bucket Name

```
$ oc get -n openshift-storage cm thanos-rhacm-observability -o yaml | grep BUCKET_NAME
```
* S3 endpoint

```
$ noobaa status -n openshift-storage | grep InternalDNS
```
* Access Key & Secret key

```
$ oc get -n openshift-storage secret thanos-rhacm-observability -o yaml | grep AWS
```

## Crear la secret del bucket

```

$ vim thanos-object-storage.yaml
apiVersion: v1
kind: Secret
metadata:
  name: thanos-object-storage
  namespace: open-cluster-management-observability
type: Opaque
stringData:
  thanos.yaml: |
    type: s3
    config:
      bucket: <bucket>
      endpoint: <endpoint>
      insecure: true
      access_key: <access_key>
      secret_key: <secret_key>
$ oc create -f thanos-object-storage.yaml -n open-cluster-management-observability
```

## Crear la cr

```
$ vim multiclusterobservability_cr.yaml
apiVersion: observability.open-cluster-management.io/v1beta2
kind: MultiClusterObservability
metadata:
  name: observability
spec:
  observabilityAddonSpec: {}
  storageConfig:
    metricObjectStorage:
      name: thanos-object-storage
      key: thanos.yaml
$ oc create -f multiclusterobservability_cr.yaml -n open-cluster-management-observability
```
