1

First of all, I am setting up the cluster with kubernetes on premise.
As displayed at https://metallb.universe.tf/installation/, I installed MetalLB as followed and configured configmap, deployment, and service.

kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.9.3/manifests/namespace.yaml
kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.9.3/manifests/metallb.yaml
# On first install only
kubectl create secret generic -n metallb-system memberlist --from-literal=secretkey="$(openssl rand -base64 128)"

configmap.yaml

apiVersion: v1
kind: ConfigMap
metadata:
  namespace: metallb-system
  name: config
data:
  config: |
    address-pools:
    - name: default
      protocol: layer2
      addresses:
      - 192.168.1.240-192.168.1.250

tutorial.yaml

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx
spec:
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:1
        ports:
        - name: http
          containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
  name: nginx
spec:
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: 80
  selector:
    app: nginx
  type: LoadBalancer

After configuration, when I check the services with the command kubectl get svc, there is a nginx service with EXTERNAL-IP.

NAME         TYPE           CLUSTER-IP      EXTERNAL-IP       PORT(S)        AGE
kubernetes   ClusterIP      10.96.0.1       <none>            443/TCP        8d
nginx        LoadBalancer   10.101.179.72   192.168.143.230   80:32190/TCP   22s

And when I enter "192.168.143.230", I can't access that page with the message, "This site can’t be reached 192.168.143.230 took too long to respond".
What should I do for accessing that page with EXTERNAL-IP?

yhshin
  • 75
  • 2
  • Is your firewall open to allow you access on port 80 to that machine? – paulopontesm Aug 17 '20 at 09:21
  • 3
    Where is your Kubernetes cluster deployed? `192.168.0.0/16` is a private network and can be only accessed if you are inside the machine running the cluster. – Aziz Alfoudari Aug 17 '20 at 10:45
  • @paulopontesm All port is open. – yhshin Aug 17 '20 at 11:09
  • @AzizAlfoudari Well, I'm sorry I'm not good at english, so, I don't understand what you say... I set up the cluster in one machine, and I do something in the same machine such as running the command ,`kubectl get svc`, or accessing the IP of the service. I didn't configure anything except above thing. So, I'm not sure, but I think I can't access the EXTERNAL-IP because I didn't set up something... – yhshin Aug 17 '20 at 11:41
  • When I started 'minikube' with 'virtualBox' driver, I can access the page. I think this problem is related to 'minikube network'. So, if I find out what's the problem exactly, then I'll write about that. – yhshin Aug 18 '20 at 13:35
  • Where are you accessing this external IP from ? @yhshin, I guess English shouldn't be a big problem today and you don't have to worry if you don't know it perfectly. You can always use e.g. [Google Translator](https://translate.google.com/). Usually it does its job pretty well. @Aziz added a very impornant point. Could you try to run on the machine from which you are trying to access this External IP the following command: `ip route get 192.168.143.230` ? – mario Aug 18 '20 at 18:47
  • Hi Yhshin, Did you find any solution ? I am having similar issues – Shamim Dec 01 '21 at 06:52

1 Answers1

0

I guess it will be accessible through 192.168.143.230:32190

Nurhun
  • 475
  • 1
  • 9
  • 21