Kubernetes Cluster | Unable to launch the application using Master Node

Cluster information:

Kubernetes version: v1.14
Cloud being used: (put bare-metal if not on a public cloud) Microsoft Azure
Installation method: kubeadm
Host OS: Linux-Ubuntu
CNI and version: Calico
CRI and version: Docker

Problem Statement:

I have two Virtual Machines (Linux-Ubuntu) on Microsoft Azure one as a master node and other as a worker node. In my kubernetes cluster I have deployed a Nginx server which has been assigned to worker Node.

The problem is I am able to access the Nginx server on worker node ip i.e using command: curl ip_address_of_Nginx_pod but when I try to run the same command on Master Node its not working.

There is some issue with Inbound Rules I think. However I have already allowed all traffic on both master and worker node.

On Master Node:

Once I run Command : kubectl get pods

NAME         READY   STATUS    RESTARTS   AGE   IP            NODE              
myfirstpod   1/1     Running   1          23h   192.168.2.10   demo-my-worker 

Once I run Command : curl 192.168.2.10 , It does not display anything…

root@Demo-my-master:~/demo# curl 192.168.2.10

On Worker Node:

Once I run Command : curl 192.168.2.10, it runs perfectly fine.

root@Demo-my-worker:~/demo# curl 192.168.2.10


<head>
<title>Welcome to nginx!</title>
<style>
body {
    width: 35em;
    margin: 0 auto;
    font-family: Tahoma, Verdana, Arial, sans-serif;
}
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed 
and
working. Further configuration is required.</p>

<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>

<p><em>Thank you for using nginx.</em></p>
</body>
</html>

Can please someone help here and let me know why I am not able to get the same result on master node ?

Can you share me your nginx_deployment.yml?

I face the same issue. I am trying not to use AKS but a simple cluster with two Azure Ubuntu 20.04 VMs, one for the Master node and one for the Worker node. I deployed nginx, exposed it as a loadbalancer with external IP my VM’s IP, and while curl-ing on the master I get “connection timed out”, trying the same on the worker I get the nginx default site answer.

My deployment yaml is as follows:

apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
deployment.kubernetes.io/revision: “1”
creationTimestamp: “2022-01-06T07:00:33Z”
generation: 1
labels:
app: nginx
name: nginx
namespace: eg
resourceVersion: “3690”
uid: 55d4cadb-88f7-42ef-86c6-631b9469bfb5
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
app: nginx
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
creationTimestamp: null
labels:
app: nginx
spec:
containers:
- image: nginx
imagePullPolicy: Always
name: nginx
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
status:
availableReplicas: 1
conditions:

  • lastTransitionTime: “2022-01-06T07:00:35Z”
    lastUpdateTime: “2022-01-06T07:00:35Z”
    message: Deployment has minimum availability.
    reason: MinimumReplicasAvailable
    status: “True”
    type: Available
  • lastTransitionTime: “2022-01-06T07:00:33Z”
    lastUpdateTime: “2022-01-06T07:00:35Z”
    message: ReplicaSet “nginx-85b98978db” has successfully progressed.
    reason: NewReplicaSetAvailable
    status: “True”
    type: Progressing
    observedGeneration: 1
    readyReplicas: 1
    replicas: 1
    updatedReplicas: 1

Does anyone know what is going on?