Using the Skupper Operator on OpenShift

The Skupper Operator creates and manages Skupper sites in OpenShift.

There are two options when deploying the Skupper Operator:

All namespaces

All Skupper sites created in the cluster share a common site controller pod for co-ordination.

A specific namespace

A site controller pod is created in each namespace that you apply the site ConfigMap. This is equivalent to the skupper init as described in Configuring Skupper sites using the CLI.

You can deploy the Skupper Operator using any of the following methods:

Installing an Operator requires administrator-level privileges for your OpenShift cluster.

After installing the Operator, you can create a site by deploying a ConfigMap as described in Creating a site using the Skupper Operator

Because OpenShift Container Platform is a certified Kubernetes distribution, you can use the supported kubectl binaries that are included with OpenShift as described in this documentation, or you can use the oc binary.

See the OpenShift documentation for more information about oc and kubectl.

Installing the Operator using the CLI

The steps in this section show how to use the kubectl command-line interface (CLI) to install and deploy the latest version of the Skupper Operator in a given OpenShift cluster.

Procedure
  1. Log in to OpenShift as a cluster administrator. For example:

    $ kubectl login -u system:admin
  2. Complete the steps described in Red Hat Container Registry Authentication.

  3. To create a operator subscription for all namespaces:

    1. Create a file named subscription.yaml with the following:

      apiVersion: operators.coreos.com/v1alpha1
      kind: Subscription
      metadata:
        name: skupper-operator
        namespace: openshift-operators
      spec:
        channel: alpha
        installPlanApproval: Automatic
        name: skupper-operator
        source: redhat-operators
        sourceNamespace: openshift-marketplace
        startingCSV: skupper-operator.v1.0
    2. Apply the subscription YAML:

      $ kubectl apply -f subscription.yaml
  4. To create a operator subscription for a specific namespace, you must create an Operator group in that namespace and then create the subscription:

    1. Create a file named operator-group.yaml with the following:

      kind: OperatorGroup
      apiVersion: operators.coreos.com/v1
      metadata:
        name: skupper-operator
        namespace: my-namespace
      spec:
        targetNamespaces:
        - my-namespace

      where my-namespace is the name of the namespace you want to create the site.

    2. Apply the Operator group YAML:

      $ kubectl apply -f operator-group.yaml
    3. Create a file named subscription.yaml with the following:

      apiVersion: operators.coreos.com/v1alpha1
      kind: Subscription
      metadata:
        name: skupper-operator
        namespace: my-namespace
      spec:
        channel: alpha
        installPlanApproval: Automatic
        name: skupper-operator
        source: redhat-operators
        sourceNamespace: openshift-marketplace
        startingCSV: skupper-operator.v1.0

      where my-namespace is the name of the namespace you want to create the site.

    4. Apply the subscription YAML:

      $ kubectl apply -f subscription.yaml

Installing the Skupper Operator using the OpenShift console

The procedures in this section show how to use the OperatorHub from the OpenShift console to install and deploy the latest version of the Skupper Operator in a given OpenShift namespace.

Prerequisites
  • Access to an OpenShift {OpenShiftVersion} cluster using a cluster-admin account.

Procedure
  1. In the OpenShift web console, navigate to menu:Operators[OperatorHub].

  2. Choose Skupper Operator from the list of available Operators, and then click btn:[Install].

  3. On the Operator Installation page, two Installation mode options are available:

    • All namespaces on the cluster

    • A specific namespace on the cluster

      For this example, choose A specific namespace on the cluster.

  4. Select the namespace into which you want to install the Operator, and then click btn:[Install].

    The Installed Operators page appears displaying the status of the Operator installation.

  5. Verify that the Skupper Operator is displayed and wait until the Status changes to Succeeded.

  6. If the installation is not successful, troubleshoot the error:

    1. Click Skupper Operator on the Installed Operators page.

    2. Select the Subscription tab and view any failures or errors.

For more information about installing Operators, see the OpenShift Documentation

Creating a site using the Skupper Operator

  1. Create a YAML file defining the ConfigMap of the site you want to create.

    For example, create skupper-site.yaml:

    apiVersion: v1
    kind: ConfigMap
    metadata:
      name: skupper-site
      namespace: my-namespace

    You can later retrieve the console credentials as described in Using the Skupper console or specify them now by adding the username and optionally the password to skupper-site.yaml as follows:

    data:
      console-user: "admin"
      console-password: "changeme"
  2. Apply the YAML to create a ConfigMap named skupper-site in the namespace you want to use:

    $ kubectl apply -f skupper-site.yaml
  3. Verify that the site is created by checking that the Skupper router and service controller pods are running:

    $ kubectl get pods
    
    NAME                                          READY   STATUS    RESTARTS   AGE
    skupper-router-8c6cc6d76-27562                1/1     Running   0          40s
    skupper-service-controller-57cdbb56c5-vc7s2   1/1     Running   0          34s
    If you deployed the Operator to a single namespace, an additional site controller pod is also running.