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
Procedure
-
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:
- Log in to the IBM Fusion HCI hub OpenShift console.
- Go to the ACM user interface and select Infrastructre > Clusters.
- In the clusters list, select the newly created Hosted Control Plane cluster.
- 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.
- Create metallb operator.
- 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
- Apply the YAML:
oc --kubeconfig=kubeconfig.yaml apply -f metallb-operator-config.yaml
- Wait for all the pods to be up and running. Run the following command to confirm:
oc --kubeconfig=kubeconfig.yaml get pods -n metallb
- Create a new YAML file.Example YAML:
- Create an instance of metallb
- Create a new file metallb-instance-config.yaml.
Example:
apiVersion: metallb.io/v1beta1 kind: MetalLB metadata: name: metallb namespace: metallb
- Apply the file:
oc --kubeconfig=kubeconfig.yaml apply -f metallb-instance-config.yaml
- Wait for the pods to be up and running
oc --kubeconfig=kubeconfig.yaml get pods -n metallb
- Create a new file metallb-instance-config.yaml.
- Create an
IPAddressPool
andL2Advertisement
.- 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 theL2Advertisement
.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. - Apply the ipaddresspool-l2advertisement-config.yaml.
oc --kubeconfig=kubeconfig.yaml apply -f ipaddresspool-l2advertisement-config.yaml
- Create an
- Create a service for the
loadbalancer
.- Create metallb-loadbalancer-service.yaml. Note: The
address-pool
must match the name of theaddresspool
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
- Apply the load balancer service YAML.
oc --kubeconfig=kubeconfig.yaml apply -f metallb-loadbalancer-service.yaml
- Monitor the Cluster Operator console for issues:
oc --kubeconfig=kubeconfig.yaml get co
- Create metallb-loadbalancer-service.yaml.