MetalLB in Kubernetes Baremetal Cluster

320 views Asked by At

I'm new to Kubernetes and was trying to expose my service (Nginx) via ingress resource. ingress controller is already installed via helm nginx-stable/nginx-ingress. when trying to access the said IP and port from the ingress resource. it is unreachable and by doing some research I saw that I need to install metalLB.

My question is do I really need to install MetalLB or are there any alternative built-in resources that I can configure or use to route the traffic?

2

There are 2 answers

0
Yuyanto On

in short, you don't necessarily need to install metalLB to make a simple kubernetes configuration work. perhaps you could share the services information or error log which is unreachable

2
ariel.chiong On

Sorry for the delay due to holiday season..

I'm using Virtualbox with 3 machine running in

  • Ubuntu 20.04.1 LTS

K8s Version

  • Client Version: v1.20.1
  • Server Version: v1.20.1

Enabling Ingress helm install my-release nginx-stable/nginx-ingress

Deployment kubectl describe deployment --namespace helm-exam

Name:                   node-deployment-1
Namespace:              helm-exam
CreationTimestamp:      Fri, 08 Jan 2021 12:01:22 +0800
Labels:                 app=node-deployment-1
                        app.kubernetes.io/managed-by=Helm
Annotations:            deployment.kubernetes.io/revision: 1
                        meta.helm.sh/release-name: helm-deployment
                        meta.helm.sh/release-namespace: default
Selector:               app=node-deployment-1
Replicas:               3 desired | 3 updated | 3 total | 3 available | 0 unavailable
StrategyType:           RollingUpdate
MinReadySeconds:        0
RollingUpdateStrategy:  25% max unavailable, 25% max surge
Pod Template:
  Labels:  app=node-deployment-1
  Containers:
   nginx:
    Image:      nginx
    Port:       <none>
    Host Port:  <none>
    Environment:
      ENVIRONMENT:  DEV
    Mounts:         <none>
  Volumes:          <none>
Conditions:
  Type           Status  Reason
  ----           ------  ------
  Available      True    MinimumReplicasAvailable
  Progressing    True    NewReplicaSetAvailable
OldReplicaSets:  <none>
NewReplicaSet:   node-deployment-1-78dd8f445b (3/3 replicas created)
Events:          <none>

Service

kubectl describe svc --namespace helm-exam

Name:              node-service-1
Namespace:         helm-exam
Labels:            app=node-service-1
                   app.kubernetes.io/managed-by=Helm
Annotations:       meta.helm.sh/release-name: helm-deployment
                   meta.helm.sh/release-namespace: default
Selector:          app=node-deployment-1
Type:              ClusterIP
IP Families:       <none>
IP:                10.109.148.140
IPs:               10.109.148.140
Port:              <unset>  80/TCP
TargetPort:        80/TCP
Endpoints:         10.244.1.26:80,10.244.1.27:80,10.244.1.28:80
Session Affinity:  None
Events:            <none>

Ingress

kubectl describe ingress --namespace helm-exam

Name:             node-ingress
Namespace:        helm-exam
Address:          
Default backend:  default-http-backend:80 (<error: endpoints "default-http-backend" not found>)
Rules:
  Host            Path  Backends
  ----            ----  --------
  nginx.helm.com  
                  /   node-service-1:80 (10.244.1.26:80,10.244.1.27:80,10.244.1.28:80)
Annotations:      meta.helm.sh/release-name: helm-deployment
                  meta.helm.sh/release-namespace: default
Events:           <none>

kubectl get ingress --namespace helm-exam

NAME           CLASS    HOSTS            ADDRESS   PORTS   AGE
node-ingress   <none>   nginx.helm.com             80      8m57s

Ingress doesn't show or provide any IP ADDRESS