In this article:

Installing the ingress-nginx Component

Installing the metallb Component

Setting Up Kubernetes External Network

To access the cluster from external network, on the first main node install the components: ingress-nginx and metallb.

Installing the ingress-nginx Component

To install the ingress-nginx component:

  1. Execute the command:

helm upgrade --install ingress-nginx ingress-nginx \
 --repo https://kubernetes.github.io/ingress-nginx \
 --namespace ingress-nginx --create-namespace

  1. Install the ingressclass class by default:

kubectl annotate ingressclass nginx ingressclass.kubernetes.io/is-default-class='true'

After executing the operations, the ingress-nginx component is installed on the main node.

Installing the metallb Component

To install the metallb component:

  1. Execute the command:

helm install metallb metallb/metallb -n metallb-system --create-namespace

  1. Create the metalb-config.yaml file to access the cluster with contents:

apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
 name: first-pool
 namespace: metallb-system
spec:
 addresses:
 - {<IP address master1>}/32

Specify in the file the list of IP addresses (for example, first-pool), at which the cluster will be available. If the list contains several IP addresses, they are placed vertically.

NOTE. Make sure that all IP addresses in the list are linked to interfaces on main nodes. The example uses one main node that is why the unique IP address is specified.

  1. Apply the settings specified in the metalb-config.yaml file:

kubectl apply -f metalb-config.yaml

  1. Check the list of IP addresses:

kubectl get IPAddressPools -n metallb-system

The response should contain the list with the specified IP addresses.

After executing the operations, the metallb component is installed on the main node.

Next, set up persistent volume storage sections.

See also:

Preparation and Deployment of Fault-Tolerant Cluster Based on Kubernetes | Setting Up Persistent Volume Storage Sections