Installing Data Grid Operator

Guide
  • Red Hat Data Grid 8.3
  • Updated 08 February 2022
  • Published 02 December 2021

Installing Data Grid Operator

Guide
Red Hat Data Grid 8.3
  • Updated 08 February 2022
  • Published 02 December 2021

Install Data Grid Operator into a OpenShift namespace to create and manage Data Grid clusters.

Data Grid Operator deployments

When you install Data Grid Operator, it extends the Kubernetes API with Custom Resource Definitions (CRDs) for deploying and managing Data Grid clusters on Red Hat OpenShift.

To interact with Data Grid Operator, OpenShift users apply Custom Resources (CRs) through the OpenShift Web Console or oc client. Data Grid Operator listens for Infinispan CRs and automatically provisions native resources, such as StatefulSets and Secrets, that your Data Grid deployment requires. Data Grid Operator also configures Data Grid services according to the specifications in Infinispan CRs, including the number of pods for the cluster and backup locations for cross-site replication.

This illustration depicts how OpenShift users pass custom resources to Data Grid Operator.
Figure 1. Custom resources

A single Data Grid Operator installation can manage multiple Data Grid clusters in separate namespaces. Each time a user applies CRs to modify the deployment, Data Grid Operator applies the changes globally to all Data Grid clusters.

This illustration depicts how Data Grid Operator manages multiple clusters on OpenShift.
Figure 2. Operator-managed clusters

Installing Data Grid Operator on Red Hat OpenShift

Create subscriptions to Data Grid Operator on OpenShift so you can install different Data Grid versions and receive automatic updates.

Automatic updates apply to Data Grid Operator first and then for each Data Grid node. Data Grid Operator updates clusters one node at a time, gracefully shutting down each node and then bringing it back online with the updated version before going on to the next node.

Prerequisites
  • Access to OperatorHub running on OpenShift. Some OpenShift environments, such as OpenShift Container Platform, can require administrator credentials.

  • Have an OpenShift project for Data Grid Operator if you plan to install it into a specific namespace.

Procedure
  1. Log in to the OpenShift Web Console.

  2. Navigate to OperatorHub.

  3. Find and select Data Grid Operator.

  4. Select Install and continue to Create Operator Subscription.

  5. Specify options for your subscription.

    Installation Mode
    You can install Data Grid Operator into a Specific namespace or All namespaces.
    Update Channel
    Get updates for Data Grid Operator 8.3.x.
    Approval Strategies
    Automatically install updates from the 8.3.x channel or require approval before installation.
  6. Select Subscribe to install Data Grid Operator.

  7. Navigate to Installed Operators to verify the Data Grid Operator installation.

Installing Data Grid Operator with the native CLI plugin

Install Data Grid Operator with the native Data Grid CLI plugin, kubectl-infinispan.

Prerequisites
  • Have kubectl-infinispan on your PATH.

Procedure
  1. Run the oc infinispan install command to create Data Grid Operator subscriptions, for example:

    $ oc infinispan install --channel=8.3.x
                                 --source=redhat-operators
                                 --source-namespace=openshift-marketplace
  2. Verify the installation.

    $ oc get pods -n openshift-operators | grep infinispan-operator
    NAME                                   READY   STATUS
    infinispan-operator-<id>               1/1     Running

Use oc infinispan install --help for command options and descriptions.

Installing Data Grid Operator with an OpenShift client

You can use the oc client to create Data Grid Operator subscriptions as an alternative to installing through the OperatorHub or with the native Data Grid CLI.

Prerequisites
  • Have an oc client.

Procedure
  1. Set up projects.

    1. Create a project for Data Grid Operator.

    2. If you want Data Grid Operator to control a specific Data Grid cluster only, create a project for that cluster.

      $ oc new-project ${INSTALL_NAMESPACE} 1
      $ oc new-project ${WATCH_NAMESPACE} 2
      1. Creates a project into which you install Data Grid Operator.

      2. Optionally creates a project for a specific Data Grid cluster if you do not want Data Grid Operator to watch all projects.

  2. Create an OperatorGroup resource.

    Control all Data Grid clusters
    $ oc apply -f - << EOF
    apiVersion: operators.coreos.com/v1
    kind: OperatorGroup
    metadata:
     name: datagrid
     namespace: ${INSTALL_NAMESPACE}
    EOF
    Control a specific Data Grid cluster
    $ oc apply -f - << EOF
    apiVersion: operators.coreos.com/v1
    kind: OperatorGroup
    metadata:
     name: datagrid
     namespace: ${INSTALL_NAMESPACE}
    spec:
     targetNamespaces:
     - ${WATCH_NAMESPACE}
    EOF
  3. Create a subscription for Data Grid Operator.

    $ oc apply -f - << EOF
    apiVersion: operators.coreos.com/v1alpha1
    kind: Subscription
    metadata:
     name: datagrid-operator
     namespace: ${INSTALL_NAMESPACE}
    spec:
     channel: 8.3.x
     installPlanApproval: Automatic
     name: datagrid
     source: redhat-operators
     sourceNamespace: openshift-marketplace
    EOF

    If you want to manually approve updates from the 8.3.x channel, change the value of the spec.installPlanApproval field to Manual.

  4. Verify the installation.

    $ oc get pods -n ${INSTALL_NAMESPACE}
    NAME                                   READY   STATUS
    infinispan-operator-<id>               1/1     Running