On OpenShift#
This document contains instructions on installing, uninstalling and configuring Multi Tenant Operator using OpenShift MarketPlace.
Requirements#
- An OpenShift cluster [v4.8 - v4.15]
Installing via OperatorHub UI#
- After opening OpenShift console click on
Operators
, followed byOperatorHub
from the side menu
- Now search for
Multi Tenant Operator
and then click onMulti Tenant Operator
tile
- Click on the
install
button
- Select
Updated channel
. Selectmulti-tenant-operator
to install the operator inmulti-tenant-operator
namespace fromInstalled Namespace
dropdown menu. After configuringUpdate approval
click on theinstall
button.
Note: Use
stable
channel for seamless upgrades. ForProduction Environment
preferManual
approval and useAutomatic
forDevelopment Environment
- Wait for the operator to be installed
- Once successfully installed, MTO will be ready to enforce multi-tenancy in your cluster
Note: MTO will be installed in
multi-tenant-operator
namespace.
Installing via CLI OR GitOps#
- Create namespace
multi-tenant-operator
oc create namespace multi-tenant-operator
namespace/multi-tenant-operator created
- Create an OperatorGroup YAML for MTO and apply it in
multi-tenant-operator
namespace.
oc create -f - << EOF
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
name: tenant-operator
namespace: multi-tenant-operator
EOF
operatorgroup.operators.coreos.com/tenant-operator created
- Create a subscription YAML for MTO and apply it in
multi-tenant-operator
namespace. To enable console set.spec.config.env[].ENABLE_CONSOLE
totrue
. This will create a route resource, which can be used to access the Multi-Tenant-Operator console.
oc create -f - << EOF
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: tenant-operator
namespace: multi-tenant-operator
spec:
channel: stable
installPlanApproval: Automatic
name: tenant-operator
source: certified-operators
sourceNamespace: openshift-marketplace
startingCSV: tenant-operator.v0.10.0
EOF
subscription.operators.coreos.com/tenant-operator created
Note: To bring MTO via GitOps, add the above files in GitOps repository.
- After creating the
subscription
custom resource open OpenShift console and click onOperators
, followed byInstalled Operators
from the side menu
- Wait for the installation to complete
- Once the installation is complete click on
Workloads
, followed byPods
from the side menu and selectmulti-tenant-operator
project
- Once pods are up and running, MTO will be ready to enforce multi-tenancy in your cluster
For more details and configurations check out IntegrationConfig.
Enabling Console#
To enable console GUI for MTO, go to Search
-> IntegrationConfig
-> tenant-operator-config
and make sure the following fields are set to true
:
spec:
components:
console: true
showback: true
Note: If your
InstallPlan
approval is set toManual
then you will have to manually approve theInstallPlan
for MTO console components to be installed.
Manual Approval#
- Open OpenShift console and click on
Operators
, followed byInstalled Operators
from the side menu.
- Now click on
Upgrade available
in front ofmto-opencost
ormto-prometheus
.
- Now click on
Preview InstallPlan
on top.
- Now click on
Approve
button.
- Now the
InstallPlan
will be approved, and MTO console components will be installed.
Uninstall via OperatorHub UI#
You can uninstall MTO by following these steps:
-
Decide on whether you want to retain tenant namespaces and ArgoCD AppProjects or not. If yes, please set
spec.onDelete.cleanNamespaces
tofalse
for all those tenants whose namespaces you want to retain, andspec.onDelete.cleanAppProject
tofalse
for all those tenants whose AppProject you want to retain. For more details check out onDelete -
After making the required changes open OpenShift console and click on
Operators
, followed byInstalled Operators
from the side menu
- Now click on uninstall and confirm uninstall.
-
Now the operator has been uninstalled.
-
Optional:
you can also manually remove MTO's CRDs and its resources from the cluster.
Notes#
- For details on licensing of MTO please refer Pricing.
- For more details on how to use MTO please refer Tenant tutorial.
- For details on how to extend your MTO manager ClusterRole please refer extend-default-clusterroles.