Skip to content

stolostron/maestro-addon

Repository files navigation

maestro-addon

The maestro addon is used to enable the maestro in the ACM

Build

Build binary

make build

Build Image

make image

Deploy

Prepare a Kafka cluster with AMQ Streams

  1. Follow this doc to install the AMQ Streams Operator from OpenShift OperatorHub
  2. After the operator is installed, create a Kafka CR in one namespace to provision a Kafka cluster, the Kafka CR must enable the authorization with a super user CN=maestro-kafka-admin and a route listener with mTLS, There is an example for Kafka CR.

Install maestro-addon on ACM hub

Run following command to install maestro-addon on ACM hub

helm install maestro-addon ./charts/maestro-addon
  • To use customized images:

    --set global.imageOverrides.maestroImage=<your customized image>
    --set global.imageOverrides.maestroAddOnImage=<your customized image>
    
  • To specify the AMQ Streams Kafka cluster name and namespace (by default, they are kafka and amq-streams):

    --set messageQueue.amqStreams.name=<your AMQ Streams Kafka CR name>
    --set messageQueue.amqStreams.namespace=<your AMQ Streams Kafka CR namespace>
    

More available config values can be found from here.

Using helm uninstall maestro-addon to uninstall the maestro-addon.

Install maestro-addon agent on a managed cluster

Create a ManagedClusterAddOn CR in one managed cluster namespace on an ACM hub to install the maestro-addon agent on that managed cluster.

cat << EOF | oc -n <cluster-name> apply -f -
apiVersion: addon.open-cluster-management.io/v1alpha1
kind: ManagedClusterAddOn
metadata:
  name: maestro-addon
spec:
  installNamespace: open-cluster-management-agent
EOF

Using oc -n <cluster-name> delete ManagedClusterAddOn maestro-addon to uninstall the maestro-addon agent from a managed cluster.

Using ManifestWorkReplicaSet

Enable the ManifestWorkReplicaSet controller with cloudevents on the hub

  1. Prepare the config for ManifestWorkReplicaSet controller
cat << EOF | oc -n multicluster-engine create -f -
apiVersion: v1
kind: Secret
metadata:
  name: work-driver-config
type: Opaque
stringData:
  config.yaml: |
    url: maestro-grpc.maestro:8090
EOF
  1. Enable the ManifestWorkReplicaSet controller
oc patch clustermanager cluster-manager --type=merge -p='{"spec":{"workConfiguration":{"workDriver":"grpc","featureGates":[{"feature":"CloudEventsDrivers","mode":"Enable"},{"feature":"ManifestWorkReplicaSet","mode":"Enable"}]}}}'

Using the following command to disable the ManifestWorkReplicaSet controller:

oc patch clustermanager cluster-manager --type=merge -p='{"spec":{"workConfiguration":{"featureGates":[{"feature":"CloudEventsDrivers","mode":"Disable"},{"feature":"ManifestWorkReplicaSet","mode":"Disable"}]}}}'

Use ManifestWorkReplicaSet to deploy kube resources on managed clusters

Using the following example to deploy a busybox in the namespace mwrs-test on your managed clusters

  1. Prepare the Placement for ManifestWorkReplicaSet in the hub default namespace
oc apply -f contrib/examples/placement
  1. Apply the ManifestWorkReplicaSet CR example in the hub default namespace
oc apply -f contrib/examples/manifestworkreplicaset.yaml
  1. Check the status of the ManifestWorkReplicaSet
oc -n default get manifestworkreplicasets busybox

NAME      PLACEMENT    FOUND   MANIFESTWORKS   APPLIED
busybox   AsExpected   True    AsExpected      True

Using oc delete -f contrib/examples/manifestworkreplicaset.yaml to delete the ManifestWorkReplicaSet