8

eks server endpoint is xxxxxxxxxxx.xxx.eks.amazonaws.com and I've created a yml file with a deployment and service object.

[ec2-user@ip-]$ kubectl get svc
NAME         TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)          AGE
fakeserver   NodePort    10.100.235.246   <none>        6311:30002/TCP   1h
kubernetes   ClusterIP   10.100.0.1       <none>        443/TCP          1d

When I browse xxxxxxxxxxx.xxx.eks.amazonaws.com:30002 returns too long to respond. security groups have all traffic in inbound rules.

Nisarg
  • 1,579
  • 6
  • 16
  • 27
Ratul
  • 398
  • 4
  • 13
  • There's not enough info here. Please post your deployment manifest, service manifest and any logs you can get from fakeserver – jaxxstorm Jul 25 '18 at 21:24

3 Answers3

1

For temp solution

you need run kubectl port-forward to redirect it to your local and access with https://localhost:30002

Remember: kubectl port-forward command binds the address 127.0.0.1 only, which means you can't visit the forward port from outside the server. So you have to run it locally

$ kubectl port-forward $(kubectl get pod -l "app=fakeserver" -o jsonpath={.items[0].metadata.name}) 30002

Access via loadbalancer

If you need access it permanently, you need change service type to LoadBalancer, then access this service via its loadbalancer url or you can you define another route53 DNS to redirect to this loadbalancer.

BMW
  • 34,279
  • 9
  • 81
  • 95
1

You should be using your Worker Node's IP (one of the nodes if you have more than one), not the EKS server endpoint. The EKS server endpoint is the master plane, meant to process requests pertaining to creating/deleting pods, etc.

You also need to make sure that the Security Group of your Node's will allow the traffic.

With this in place you should be able to make the request to your NodePort service. For Example:

http://your-workernodeIp:NodePortNumber

nacho10f
  • 5,266
  • 5
  • 35
  • 70
0

The service that you have created is of type - Node-Port. Did you try with :30002

If it also returns the same error, then its an issue that your deployment. Check the port exposed on the container and the target port. It should be same.

RAMNEEK GUPTA
  • 485
  • 1
  • 3
  • 12