Configuring ingress for Bare Metal Hosted cluster

After you deploy the Bare Metal clusters with Fusion Data Foundation, you must configure the ingress for you to view the changes in the user interface.

Before you begin

You must have deployed the Bare Metal cluster successfully. For more information about the deployment procedure, see Deploying Bare Metal clusters with Fusion Data Foundation.

Procedure

  1. If you choose LoadBalancer networking type, then add a load balancer to the newly created Hosted Control Plane cluster.
    You need the load balancer to gain external access to the Hosted Control Plane cluster. Using a load balancer allows the nodes to be resilient as opposed to the nodeport approach. The load balancer gets added to the newly created Hosted Control Plane cluster, and not the IBM Fusion HCI hub cluster. To access the new Hosted Control Plane cluster, download the kubeconfig. Steps to download the kubeconfig:
    1. Log in to the IBM Fusion HCI hub OpenShift console.
    2. Go to the ACM user interface and select Infrastructre > Clusters.
    3. In the clusters list, select the newly created Hosted Control Plane cluster.
    4. In the Cluster nodepools section, click Download kubeconfig. It downloads the kubeconfig for the cluster.
      After the kubeconfig is available, use the OC commands to create YAMLs on the new Hosted Control Plane cluster.
  2. Create metallb operator.
    1. Create a new YAML file.Example YAML:
      apiVersion: v1
      kind: Namespace
      metadata:
        name: metallb
        labels:
          openshift.io/cluster-monitoring: "true"
        annotations:
          workload.openshift.io/allowed: management
      ---
      apiVersion: operators.coreos.com/v1
      kind: OperatorGroup
      metadata:
        name: metallb-operator-operatorgroup
        namespace: metallb
      ---
      apiVersion: operators.coreos.com/v1alpha1
      kind: Subscription
      metadata:
        name: metallb-operator
        namespace: metallb
      spec:
        channel: "stable"
        name: metallb-operator
        source: redhat-operators
        sourceNamespace: openshift-marketplace
    2. Apply the YAML:
      oc --kubeconfig=kubeconfig.yaml apply -f metallb-operator-config.yaml
    3. Wait for all the pods to be up and running. Run the following command to confirm:
      oc --kubeconfig=kubeconfig.yaml get pods -n metallb
  3. Create an instance of metallb
    1. Create a new file metallb-instance-config.yaml.
      Example:
      
      apiVersion: metallb.io/v1beta1
      kind:  MetalLB
      metadata:
         name: metallb
         namespace:  metallb
    2. Apply the file:
      oc --kubeconfig=kubeconfig.yaml apply -f metallb-instance-config.yaml
    3. Wait for the pods to be up and running
      oc --kubeconfig=kubeconfig.yaml get pods -n metallb
  4. Create an IPAddressPool and L2Advertisement.
    1. Create an IPAddressPool named ipaddresspool-l2advertisement-config.yaml.
      Example:
      apiVersion: metallb.io/v1beta1
      kind: IPAddressPool
      metadata:
        name: ippool
        namespace: metallb
      spec:
        protocol: layer2
        autoAssign: false
        addresses:
          - 1.23.45.678-1.23.45.678
      ---
      apiVersion: metallb.io/v1beta1
      kind: L2Advertisement
      metadata:
        name: l2-advertisement
        namespace: metallb
      spec:
        ipAddressPools:
          - ippool

      The name of the IPAddressPool must match the one in the L2Advertisement.

      The addresses must be the IPAddress in the DNS that is the *.apps.NAMEofCluster in the DNS network table set up by the network administrator.

    2. Apply the ipaddresspool-l2advertisement-config.yaml.
      oc --kubeconfig=kubeconfig.yaml apply -f ipaddresspool-l2advertisement-config.yaml
  5. Create a service for the loadbalancer.
    1. Create metallb-loadbalancer-service.yaml.
      Note: The address-pool must match the name of the addresspool in previous step.
      Example:
      kind: Service
      apiVersion: v1
      metadata:
        annotations:
          metallb.universe.tf/address-pool: ippool
        name: metallb-ingress
        namespace: openshift-ingress
      spec:
        ports:
          - name: http
            protocol: TCP
            port: 80
            targetPort: 80
          - name: https
            protocol: TCP
            port: 443
            targetPort: 443
        selector:
          ingresscontroller.operator.openshift.io/deployment-ingresscontroller: default
        type: LoadBalancer
    2. Apply the load balancer service YAML.
      oc --kubeconfig=kubeconfig.yaml apply -f metallb-loadbalancer-service.yaml
    3. Monitor the Cluster Operator console for issues:
      oc --kubeconfig=kubeconfig.yaml get co