NodePort is not working

Asking for help? Comment out what you need so we can get more information to help you!

Cluster information:

Kubernetes version: 1.22
Cloud being used: aws
Installation method: eks
Host OS: linux
CNI and version:
CRI and version: Docker version 20.10.12

You can format your yaml by highlighting it and pressing Ctrl-Shift-C, it will make your output easier to read.

apiVersion: apps/v1
kind: ReplicaSet
metadata:
name: MYAPP
labels:
app: MYAPP
spec:
replicas: 3
selector:
matchLabels:
app: MYAPP
template:
metadata:
labels:
app: MYAPP
spec:
containers:
- name: MYAPP
image: jenkins
ports:
- name: web
containerPort: 8080

apiVersion: v1
kind: Service
metadata:
name: myapp
spec:
type: NodePort
selector:
app: myapp
ports:

  • port: 80
    targetPort: 8080

Hi
NodePort service is not working in workloads like replicaset,deployment
even the pods are running and the service(NodePort) is connected
if I use LoadBalancer then I am able to browse the application which is running

but if I deploy only pod in k8s yaml manifests it’s working using NodePort

https://kubernetes.io/docs/tasks/debug/debug-application/debug-service/