Configuring the provider cluster for external client access

Configure the provider cluster to expose storage services and generate an onboarding token for client access.

Procedure

  1. Install the MetalLB operator.
    To install the MetalLB operator, complete the following steps:
    1. Log in to the Red Hat® OpenShift® Container Platform web console.
    2. Go to the Ecosystem > Software Catalog page.
    3. Scroll or type MetalLB into the Filter by keyword box.
    4. Select MetalLB Operator from the results.
    5. Click Install.
    6. On the Install Operator page, complete the following configuration:
      1. Select stable from the Update channel list.
      2. Select the required version from the Version list.
      3. For Installation mode, select All namespaces on the cluster (default).
      4. For Installed Namespace, select Operator recommended Namespace.
      5. For Update approval, select either Automatic (recommended) or Manual.
    7. Click Install.
    8. Go to the Installed Operators page and confirm that:
      • The MetalLB Operator appears in the list
      • Status is Succeeded
  2. Create a MetalLB instance.

    Apply the following configuration:

    apiVersion: metallb.io/v1beta1
    kind: MetalLB
    metadata:
      name: metallb
      namespace: metallb-system
  3. Configure an IP address pool.

    Define a range of IP addresses to be assigned by MetalLB:

    apiVersion: metallb.io/v1beta1
    kind: IPAddressPool
    metadata:
      name: metallb
      namespace: metallb-system
    spec:
      addresses:
      - 10.0.0.138-10.0.0.142
  4. Create an L2 advertisement.

    Apply the following configuration:

    apiVersion: metallb.io/v1beta1
    kind: L2Advertisement
    metadata:
      name: l2advertisement
      namespace: metallb-system
    spec:
      ipAddressPools:
      - metallb
  5. Create a LoadBalancer service.

    Expose the provider API using a LoadBalancer:

    apiVersion: v1
    kind: Service
    metadata:
      name: ocs-provider-server-load-balancer
      namespace: openshift-storage
      annotations:
        metallb.universe.tf/ip-allocated-from-pool: metallb
    spec:
      type: LoadBalancer
      selector:
        app: ocsProviderApiServer
      ports:
        - name: provider
          protocol: TCP
          port: 50051
          targetPort: ocs-provider
          nodePort: 30756
    Important:

    Record the LoadBalancer IP address and port. For example: storageProviderEndpoint: 10.0.0.138:50051. You need this information when onboarding the client cluster.

  6. Create a storage consumer instance.
    To create a storage consumer instance, complete the following steps:
    1. On the Red Hat OpenShift Container Platform web console, navigate to the Storage > Data Foundation > Storage Consumers page.
    2. Click Create Storage Consumer.
    3. Provide the required details, such as name and quota.
    4. Click Create.
  7. Generate the onboarding token.
    To generate the onboarding token of the created storage consumer instance, complete the following steps:
    1. Click the overflow menu icon for the new storage consumer instance.
    2. Select Generate client onboarding token.
    3. Copy the onboarding token for use on the client cluster.

Results

The provider cluster is configured, and the onboarding token and LoadBalancer endpoint are available for onboarding the client cluster.