Kubernetes Ingress issue baremetal

3/15/2021

I am new to kubernetes, installed 3 nodes k8s cluster through kubeadm in my personal Laptop on top of VMware Workstation a master and 2 worker nodes.

I have deployed nginx ingress controller through below URL, seems nginx ingress pods are working fine, I have deployed a httpd pod, service and ingress to point to the http server, but I am not able to point to the http URL, pasted all files.

But I didn't deploy any LoadBalancers(HAproxy/MetalLB), I am in a dilemma whether LoadBalancer or Proxy required to make ingress working on BareMetal multinode cluster.

# nginx-ingress
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v0.44.0/deploy/static/provider/baremetal/deploy.yaml
[root@kube-master01 ~]# kubectl get nodes
NAME                      STATUS   ROLES    AGE    VERSION
kube-master01             Ready    master   197d   v1.19.0
kube-node01.example.com   Ready    worker   197d   v1.19.0
kube-node02.example.com   Ready    worker   197d   v1.19.0
[root@kube-master01 ~]# kubectl -n ingress-nginx get pods
NAME                                        READY   STATUS      RESTARTS   AGE
ingress-nginx-admission-create-5zcd5        0/1     Completed   0          41h
ingress-nginx-controller-67897c9494-pt5nl   1/1     Running     0          3h4m
[root@minikube01 httpd]# cat httpd-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: httpd-deployment
  labels:
    app: http-server
spec:
  replicas: 1
  selector:
    matchLabels:
      app: http-server
  template:
    metadata:
      labels:
        app: http-server
    spec:
      containers:
      - name: http-server
        image: httpd
        ports:
        - containerPort: 80
[root@minikube01 httpd]# cat httpd-service.yaml
apiVersion: v1
kind: Service
metadata:
  name: httpd-service
spec:
  selector:
    app: http-server
  ports:
    - protocol: TCP
      port: 8081
      targetPort: 80
[root@minikube01 httpd]# cat httpd-ingress.yaml
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: httpd-ingress
spec:
  rules:
  - host: httpd.com
    http:
      paths:
      - backend:
          serviceName: httpd-service
          servicePort: 8081
The same above files works fine in a minikube node without any issues.

Any assiatnace is appreciated. Thanks in Advance Niru

-- Niru
kubernetes

0 Answers