Chapter 3. Service brokers
3.1. Installing Service Catalog
Service Catalog is deprecated in OpenShift Container Platform 4. Equivalent and better functionality is present in the Operator Framework and Operator Lifecycle Manager (OLM).
Starting in OpenShift Container Platform 4.4, the service-catalog-controller-manager
and service-catalog-apiserver
cluster Operators are now set to Upgradeable=false
. This means that they will block future cluster upgrades to the next minor version, for example 4.5, if they are still installed at that time. Upgrading to z-stream releases such as 4.4.z, however, are still permitted in this state.
3.1.1. About Service Catalog
When developing microservices-based applications to run on cloud native platforms, there are many ways to provision different resources and share their coordinates, credentials, and configuration, depending on the service provider and the platform.
To give developers a more seamless experience, OpenShift Container Platform includes Service Catalog, an implementation of the Open Service Broker API (OSB API) for Kubernetes. This allows users to connect any of their applications deployed in OpenShift Container Platform to a wide variety of service brokers.
Service Catalog allows cluster administrators to integrate multiple platforms using a single API specification. The OpenShift Container Platform web console displays the cluster service classes offered by service brokers in Service Catalog, allowing users to discover and instantiate those services for use with their applications.
As a result, service users benefit from ease and consistency of use across different types of services from different providers, while service providers benefit from having one integration point that gives them access to multiple platforms.
Service Catalog is not installed by default in OpenShift Container Platform 4.
3.1.2. Installing Service Catalog
If you plan on using any of the services from the Template Service Broker, you must install Service Catalog by completing the following steps.
The custom resources for Service Catalog’s API server and controller manager are created by default in OpenShift Container Platform, but initially have a managementState
of Removed
. To install Service Catalog, you must change the managementState
for these resources to Managed
.
Procedure
Enable Service Catalog’s API server.
Use the following command to edit Service Catalog’s API server resource.
$ oc edit servicecatalogapiservers
Under
spec
, set themanagementState
field toManaged
:spec: logLevel: Normal managementState: Managed
Save the file to apply the changes.
The Operator installs Service Catalog’s API server component. As of OpenShift Container Platform 4, this component is installed into the
openshift-service-catalog-apiserver
namespace.
Enable Service Catalog’s controller manager.
Use the following command to edit Service Catalog’s controller manager resource.
$ oc edit servicecatalogcontrollermanagers
Under
spec
, set themanagementState
field toManaged
:spec: logLevel: Normal managementState: Managed
Save the file to apply the changes.
The Operator installs Service Catalog’s controller manager component. As of OpenShift Container Platform 4, this component is installed into the
openshift-service-catalog-controller-manager
namespace.
- Verify that the installation is completed successfully by checking that Service Catalog appears in the left navigation of the web console.
3.2. Uninstalling Service Catalog
Starting in OpenShift Container Platform 4.4, the service-catalog-controller-manager
and service-catalog-apiserver
cluster Operators are now set to Upgradeable=false
. This means that they will block future cluster upgrades to the next minor version, for example 4.5, if they are still installed at that time. Upgrading to z-stream releases such as 4.4.z, however, are still permitted in this state.
You can uninstall Service Catalog if you have installed it previously. Service Catalog must be removed before the cluster can upgrade to future minor versions of OpenShift Container Platform.
3.2.1. Uninstalling Service Catalog
If Service Catalog is installed, cluster administrators can uninstall it by using the following procedure.
Uninstalling Service Catalog will impact any service brokers and provisioned services from those brokers, such as the Template Service Broker, in your cluster.
Prerequisites
- Service Catalog is installed.
Procedure
Using an account with
cluster-admin
privileges, edit theservicecatalogcontrollermanagers
resource:$ oc edit servicecatalogcontrollermanagers
-
Change the
managementState
parameter fromManaged
back to the defaultRemoved
, and save your changes. Edit the
servicecatalogapiservers
resource:$ oc edit servicecatalogapiservers
-
Change the
managementState
parameter fromManaged
back to the defaultRemoved
, and save your changes. - Verify that the removal is completed successfully by checking that Service Catalog is removed from the left navigation of the web console.
3.3. Installing the Template Service Broker
You can install the Template Service Broker to gain access to the template applications that it provides.
The Template Service Broker is deprecated in OpenShift Container Platform 4. Equivalent and better functionality is present in the Operator Framework and Operator Lifecycle Manager (OLM).
By default, the Samples Operator handles Red Hat Enterprise Linux (RHEL)-based OpenShift Container Platform imagestreams and OpenShift Container Platform templates. See Configuring the Samples Operator for details.
3.3.1. About the Template Service Broker
The Template Service Broker gives Service Catalog visibility into the default Instant App and Quickstart templates that have shipped with OpenShift Container Platform since its initial release. The Template Service Broker can also make available as a service anything for which an OpenShift Container Platform template has been written, whether provided by Red Hat, a cluster administrator or user, or a third-party vendor.
By default, the Template Service Broker shows objects that are globally available from the openshift
project. It can also be configured to watch any other project that a cluster administrator chooses.
The Template Service Broker is not installed by default in OpenShift Container Platform 4.
3.3.2. Installing the Template Service Broker Operator
Prerequisites
- Service Catalog is installed.
Procedure
The following procedure installs the Template Service Broker Operator using the web console.
Create a namespace.
-
Using the Administrator perspective, navigate in the web console to Administration
Namespaces and click Create Namespace. Enter the following:
openshift-template-service-broker
in the Name fieldNoteThe namespace must start with
openshift-
.-
openshift.io/cluster-monitoring=true
in the Labels field
- Click Create.
-
Using the Administrator perspective, navigate in the web console to Administration
-
Navigate to the Operators
OperatorHub page. Verify that the openshift-template-service-broker
project is selected. - Select Template Service Broker Operator.
- Read the information about the Operator and click Install.
- Review the default selections and click Subscribe.
Next, you must start the Template Service Broker in order to access the template applications it provides.
3.3.3. Starting the Template Service Broker
After you have installed the Template Service Broker Operator, you can start the Template Service Broker using the following procedure.
Prerequisites
- Service Catalog is installed.
- The Template Service Broker Operator is installed.
Procedure
-
Using the Administrator perspective, navigate in the web console to Operators
Installed Operators and select the openshift-template-service-broker
project. - Select the Template Service Broker Operator.
- Under Provided APIs, click Create Instance for Template Service Broker.
- Review the default YAML and click Create.
Verify that the Template Service Broker starts correctly by checking that the template applications are available.
-
To check from the web console, navigate to Service Catalog
Broker Management Service Classes to view the list of template application service classes. To check from the CLI:
$ oc get ClusterServiceClasses -n openshift-template-service-broker
NoteIt may take a few minutes for the Template Service Broker to start and the template applications to be available.
If you do not yet see these service classes, you can check the status of the following items:
Template Service Broker Pod status
-
From the Workloads
Pods page for the openshift-template-service-broker project, verify that the Pod that starts with apiserver-
has a status of Running and readiness of Ready.
-
From the Workloads
Cluster service broker status
-
From the Service Catalog
Broker Management Service Brokers page, verify that the template-service-broker service broker has a status of Ready.
-
From the Service Catalog
Service Catalog controller manager Pod logs
-
From the Workloads
Pods page for the openshift-service-catalog-controller-manager project, review the logs for each of the Pods and verify that you see a log entry with the message Successfully fetched catalog entries from broker
.
-
From the Workloads
-
To check from the web console, navigate to Service Catalog
3.4. Uninstalling the Template Service Broker
You can uninstall the Template Service Broker if you no longer require access to the template applications that it provides.
The Template Service Broker is deprecated in OpenShift Container Platform 4. Equivalent and better functionality is present in the Operator Framework and Operator Lifecycle Manager (OLM).
By default, the Samples Operator handles Red Hat Enterprise Linux (RHEL)-based OpenShift Container Platform imagestreams and OpenShift Container Platform templates. See Configuring the Samples Operator for details.
3.4.1. Uninstalling the Template Service Broker
The following procedure uninstalls the Template Service Broker and its Operator using the web console.
Do not uninstall the Template Service Broker if there are any provisioned services from it in your cluster, otherwise you might encounter errors when trying to manage the services.
Prerequisites
- The Template Service Broker is installed.
Procedure
This procedure assumes that you installed the Template Service Broker into the openshift-template-service-broker
project.
Uninstall the Template Service Broker.
-
Navigate to Operators
Installed Operators and select the openshift-template-service-broker project from the drop-down menu. - Click Template Service Broker Operator.
- Select the Template Service Broker tab.
- Click template-service-broker.
- From the Actions drop-down menu, select Delete Template Service Broker.
Click Delete from the confirmation pop-up window.
The Template Service Broker is now uninstalled, and template applications will soon be removed from the Developer Catalog.
-
Navigate to Operators
Uninstall the Template Service Broker Operator.
-
From the Operators
Installed Operators page, scroll or type a keyword into the Filter by name to find the Template Service Broker Operator, then click on it. - On the right-hand side of the Operator Details page, select Uninstall Operator from the Actions drop-down menu.
- When prompted by the Remove Operator Subscription window, optionally select the Also completely remove the Operator from the selected namespace check box if you want all components related to the installation to be removed. This removes the CSV, which in turn removes the Pods, Deployments, CRDs, and CRs associated with the Operator.
- Select Remove. This Operator will stop running and no longer receive updates. The Template Service Broker Operator is no longer installed in your cluster.
-
From the Operators
After the Template Service Broker is uninstalled, users will no longer have access to the template applications provided by the Template Service Broker.