Multicluster global hub Red Hat Advanced Cluster Management for Kubernetes 2.12 Multicluster global hub

Commands:
kind: ImageSetConfiguration apiVersion: mirror.openshift.io/v1alpha2 storageConfig: registry: imageURL: myregistry.example.com:5000/mirror/oc-mirror-metadata mirror: platform: channels: - name: stable-4.x type: ocp operators: - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.x packages: - name: multicluster-global-hub-operator-rh - name: amq-streams additionalImages: [] helm: {}
mirror --config=./imageset-config.yaml docker://myregistry.example.com:5000
patch OperatorHub cluster --type json -p '[{"op": "add", "path": "/spec/disableAllDefaultSources", "value": true}]'
apiVersion: operators.coreos.com/v1alpha1 kind: CatalogSource metadata: name: my-mirror-catalog-source namespace: openshift-marketplace spec: image: myregistry.example.com:5000/mirror/my-operator-index:v4.x sourceType: grpc secrets: - <global-hub-secret>
-n openshift-marketplace get packagemanifests
apiVersion: operator.openshift.io/v1alpha1 kind: ImageContentSourcePolicy metadata: labels: operators.openshift.org/catalog: "true" name: global-hub-operator-icsp spec: repositoryDigestMirrors: - mirrors: - myregistry.example.com:5000/multicluster-globalhub source: registry.redhat.io/multicluster-globalhub - mirrors: - myregistry.example.com:5000/openshift4 source: registry.redhat.io/openshift4 - mirrors: - myregistry.example.com:5000/redhat source: registry.redhat.io/redhat
export USER=<the-registry-user>
export PASSWORD=<the-registry-password>
get secret/pull-secret -n openshift-config --template='{{index .data ".dockerconfigjson" | base64decode}}' > pull_secret.yaml
registry login --registry=USD{REGISTRY} --auth-basic="USDUSER:USDPASSWORD" --to=pull_secret.yaml
set data secret/pull-secret -n openshift-config --from-file=.dockerconfigjson=pull_secret.yaml
rm pull_secret.yaml
create secret generic <secret_name> -n <tenant_namespace> --from-file=.dockerconfigjson=<path/to/registry/credentials> --type=kubernetes.io/dockerconfigjson
secrets link <operator_sa> -n <tenant_namespace> <secret_name> --for=pull
get pods -n multicluster-global-hub NAME READY STATUS RESTARTS AGE multicluster-global-hub-operator-687584cb7c-fnftj 1/1 Running 0 2m12s
create secret generic multicluster-global-hub-transport -n multicluster-global-hub --from-literal=bootstrap_server=<kafka-bootstrap-server-address> --from-file=ca.crt=<CA-cert-for-kafka-server> --from-file=client.crt=<Client-cert-for-kafka-server> --from-file=client.key=<Client-key-for-kafka-server>
create secret generic multicluster-global-hub-storage -n multicluster-global-hub --from-literal=database_uri=<postgresql-uri> --from-literal=database_uri_with_readonlyuser=<postgresql-uri-with-readonlyuser> --from-file=ca.crt=<CA-for-postgres-server>
get secret multicluster-global-hub-grafana-datasources -n multicluster-global-hub -ojsonpath='{.data.datasources\.yaml}' | base64 -d
apiVersion: 1 datasources: - access: proxy isDefault: true name: Global-Hub-DataSource type: postgres url: postgres-primary.multicluster-global-hub.svc:5432 database: hoh user: guest jsonData: sslmode: verify-ca tlsAuth: true tlsAuthWithCACert: true tlsConfigurationMethod: file-content tlsSkipVerify: true queryTimeout: 300s timeInterval: 30s secureJsonData: password: xxxxx tlsCACert: xxxxx
service: type: LoadBalancer
get svc postgres-ha -n multicluster-global-hub NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE postgres-ha LoadBalancer 172.30.227.58 xxxx.us-east-1.elb.amazonaws.com 5432:31442/TCP 128m
get managedclusteraddon multicluster-global-hub-controller -n USD<managed_hub_cluster_name>
create secret generic auto-import-secret --from-file=kubeconfig=./managedClusterKubeconfig -n <Managedhub Namespace>
get route multicluster-global-hub-grafana -n <the-namespace-of-multicluster-global-hub-instance>
deleteRules: - orgId: 1 uid: globalhub_suspicious_policy_change - orgId: 1 uid: globalhub_cluster_compliance_status_change_frequently - orgId: 1 uid: globalhub_high_number_of_policy_events - orgId: 1 uid: globalhub_data_retention_job - orgId: 1 uid: globalhub_local_compliance_job
apiVersion: v1 kind: Secret metadata: name: multicluster-global-hub-custom-grafana-config namespace: multicluster-global-hub type: Opaque stringData: grafana.ini: | [smtp] enabled = true host = smtp.google.com:465 user = <example@google.com> password = <password> ;cert_file = ;key_file = skip_verify = true from_address = <example@google.com> from_name = Grafana ;ehlo_identity = dashboard.example.com 1
apiVersion: v1 data: alerting.yaml: | contactPoints: - orgId: 1 name: globalhub_policy receivers: - uid: globalhub_policy_alert_email type: email settings: addresses: <example@redhat.com> singleEmail: false - uid: globalhub_policy_alert_slack type: slack settings: url: <Slack-webhook-URL> title: | {{ template "globalhub.policy.title" . }} text: | {{ template "globalhub.policy.message" . }} policies: - orgId: 1 receiver: globalhub_policy group_by: ['grafana_folder', 'alertname'] matchers: - grafana_folder = Policy repeat_interval: 1d deleteRules: - orgId: 1 uid: [Alert Rule Uid] muteTimes: - orgId: 1 name: mti_1 time_intervals: - times: - start_time: '06:00' end_time: '23:59' location: 'UTC' weekdays: ['monday:wednesday', 'saturday', 'sunday'] months: ['1:3', 'may:august', 'december'] years: ['2020:2022', '2030'] days_of_month: ['1:5', '-3:-1'] kind: ConfigMap metadata: name: multicluster-global-hub-custom-alerting namespace: multicluster-global-hub
exec -it multicluster-global-hub-postgres-0 -n multicluster-global-hub -- psql -d hoh
-- call the func to generate the initial data of '2023-07-06' by inheriting '2023-07-05' CALL history.generate_local_compliance('2024-07-06');
annotate search search-v2-operator -n open-cluster-management global-search-preview=true
status: conditions: - lastTransitionTime: '2024-05-31T19:49:37Z' message: None reason: None status: 'True' type: GlobalSearchReady