Light Dark Auto

Setup Multiple Operators In One Cluster

Installing an additional operator and associated mesh is almost identical to installing the first mesh. Reference Getting Started - Install Greymatter on Kubernetes as needed.

Each operator will manage a their respective mesh and the two meshes function independently of each other. As such, the primary concern is ensuring the two installations do not have naming conflicts.

Create a new greymatter-core repository

Create a git repository that is unique from the existing greymatter-core instance(s). Use this repository as the repo in the args block in the operator manifest generated below.

Generate the Kubernetes manifests for the additional operator

At the root of the second greymatter-core project, generate kubernetes manifests for the new operator, including the desired target namespace. Ensure that this file is applied instead of the default operator.yaml.

cue eval -c ./k8s/outputs/ --out text -e operator_manifests_yaml -t operator_namespace=<your new operator namespace> > another_operator.yaml

Note that this variable exists in inputs.cue at config.operator_namespace and is used exclusively used for populating the manifest generated by the above command; updating it after generating the operator’s manifests will have no effect.

Update the namespace for the associated mesh

Before applying the manifests for the new operator, update inputs.cue with the namespace that exists for the second mesh.

mesh.spec.install_namespace: string | *"<your new mesh namespace>"

Changing this variable after the operator is deployed will result in the operator deploying a new mesh, but it will not remove the existing resources.

Update the watched namespaces

Set the list of namespaces that this new operator will watch for sidecar injection.

mesh.spec.watch_namespaces: [...string] | *["<your new tenant namespace(s)>"]

Tenant applications should only be managed by one mesh. Ensure that other meshes in the cluster are not watching the same namespaces.