Can't access my service in a remote Kubernetes

Yaakov Shami

I've been looking for a similar question for a while but I haven't found one. I have a remote Kubernetes cluster with the architecture of one master and two workers. The versions installed are as following: Kubernetes: 1.15.1-0 Docker: 18.09.1-3.el7 I'm trying to deploy & expose a JAR file of Spring project that has one REST endpoint.

Deployment.yaml:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: microservices-deployment
  labels:
    app: microservices-deployment
spec:
  replicas: 3
  template:
    metadata:
      name: microservices-deployment
      labels:
        app: microservices-deployment
    spec:
      containers:
        - name: microservices-deployment
          image: **my_repo**/*repo_name*:latest
          imagePullPolicy: Always
          ports:
            - containerPort: 8085
      restartPolicy: Always
  selector:
    matchLabels:
      app: microservices-deployment

service.yaml:

apiVersion: v1
kind: Service
metadata:
  name: microservices-service
spec:
  selector:
    app: microservices-deployment
  ports:
    - port: 8085
      targetPort: 8085
  type: NodePort

my application.properties:

server.port=8085

Dockerfile:

FROM openjdk:8
ADD target/microservices.jar microservices.jar
EXPOSE 8085
ENTRYPOINT ["java", "-jar", "microservices.jar"]

It looks like my pods are ready and everything looks good, but I can't access the service I exposed even from the master's terminal. Does anyone have any idea? Thanks in advance.

UPDATE

I'm able to telnet from my master to port 30000 on my nodes (after I specified 30000 as my NodePort), as well as telnet to my pods on port 8085. When I'm trying to telnet from the master to any other port in the nodes\pods I get refuse, so I think that's a good start. Still, I'm unable to access the rest endpoint I specified although it is working on Docker locally: docker run -p 8085:8085 IMAGE_NAME

Yaakov Shami

The problem was a network problem. Accessing the endpoint from one of the workers did the trick. Thanks for all.

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

Can't access my service in my controller (undefined)

分類Dev

Not able to access Kubernetes Service

分類Dev

Can't access returned object - resource service

分類Dev

Why can't I see remote video in my WebRTC app?

分類Dev

Why can't Angular2 inject my service?

分類Dev

PHP - Can't post an image to my restful service

分類Dev

Why can't I access my objects member variable?

分類Dev

Configure kubectl command to access remote kubernetes cluster on azure

分類Dev

Configure kubectl command to access remote kubernetes cluster on azure

分類Dev

Configure kubectl command to access remote kubernetes cluster on azure

分類Dev

Airflow scheduler can not connect to Kubernetes service api

分類Dev

git doesn't really update my remote

分類Dev

Kubernetes: Cannot access mongodb replicaset service from a different namespace

分類Dev

How can I allow a service account to access my REST API when using Roles-based Authorization in Azure?

分類Dev

Changed the user password, but now I can't access my encrypted folder

分類Dev

Why can't I access my JavaScript array by index outside of the d3 then function?

分類Dev

Why can't I access my private variable inside a function in PHP?

分類Dev

why I can't access my 3rd level CoreData data in swift?

分類Dev

How to get remote access to a MySQL database on my computer?

分類Dev

MySql server “Error No. 2003 Can't connect to Mysql server”, I can't connect, I've already changed my.cnf and created remote users

分類Dev

Can anyone with physical access to my computer access my files?

分類Dev

Can't use RDP with remote desktop user

分類Dev

Metricbeat kubernetes module can’t connect to kubelet

分類Dev

can't find my files

分類Dev

Can't boot my PC

分類Dev

Why can I directly access my JSP?

分類Dev

How can I secure my SSH commands to a remote server in Laravel?

分類Dev

I can't access property on my object via Expression.Property unless the type of the fed expression is strongly-typed

分類Dev

On Windows 7, my account says "standard profile has been loaded", can't access files. What to do?

Related 関連記事

  1. 1

    Can't access my service in my controller (undefined)

  2. 2

    Not able to access Kubernetes Service

  3. 3

    Can't access returned object - resource service

  4. 4

    Why can't I see remote video in my WebRTC app?

  5. 5

    Why can't Angular2 inject my service?

  6. 6

    PHP - Can't post an image to my restful service

  7. 7

    Why can't I access my objects member variable?

  8. 8

    Configure kubectl command to access remote kubernetes cluster on azure

  9. 9

    Configure kubectl command to access remote kubernetes cluster on azure

  10. 10

    Configure kubectl command to access remote kubernetes cluster on azure

  11. 11

    Airflow scheduler can not connect to Kubernetes service api

  12. 12

    git doesn't really update my remote

  13. 13

    Kubernetes: Cannot access mongodb replicaset service from a different namespace

  14. 14

    How can I allow a service account to access my REST API when using Roles-based Authorization in Azure?

  15. 15

    Changed the user password, but now I can't access my encrypted folder

  16. 16

    Why can't I access my JavaScript array by index outside of the d3 then function?

  17. 17

    Why can't I access my private variable inside a function in PHP?

  18. 18

    why I can't access my 3rd level CoreData data in swift?

  19. 19

    How to get remote access to a MySQL database on my computer?

  20. 20

    MySql server “Error No. 2003 Can't connect to Mysql server”, I can't connect, I've already changed my.cnf and created remote users

  21. 21

    Can anyone with physical access to my computer access my files?

  22. 22

    Can't use RDP with remote desktop user

  23. 23

    Metricbeat kubernetes module can’t connect to kubelet

  24. 24

    can't find my files

  25. 25

    Can't boot my PC

  26. 26

    Why can I directly access my JSP?

  27. 27

    How can I secure my SSH commands to a remote server in Laravel?

  28. 28

    I can't access property on my object via Expression.Property unless the type of the fed expression is strongly-typed

  29. 29

    On Windows 7, my account says "standard profile has been loaded", can't access files. What to do?

ホットタグ

アーカイブ