Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot access any service Connection timedout #55951

Closed
m1m6 opened this issue Nov 17, 2017 · 2 comments
Closed

Cannot access any service Connection timedout #55951

m1m6 opened this issue Nov 17, 2017 · 2 comments
Labels
sig/network Categorizes an issue or PR as relevant to SIG Network.

Comments

@m1m6
Copy link

m1m6 commented Nov 17, 2017

I've create a deployment and a service and deployed them using kubernetes, and when i tried to access them by curl, always i got a connection timed out error.

Here's my yml files:

Deployment.yml

  apiVersion: extensions/v1beta1
    kind: Deployment
    metadata:
      labels:
        app: locations-service
      name: locations-service
      namespace: default
    spec:
      replicas: 2
      selector:
        matchLabels:
          app: locations-service
      template:
        metadata:
          labels:
            app: locations-service
        spec:
          containers:
            - image: dropwizard:latest
              imagePullPolicy: Never # just for testing!
              name: locations-service
              ports:
                - containerPort: 8080
                  protocol: TCP
                  name: app-port
                - containerPort: 8081
                  protocol: TCP
                  name: admin-port
              resources: {}
          dnsPolicy: ClusterFirst
          restartPolicy: Always
          schedulerName: default-scheduler

Service.yml


  apiVersion: v1
    kind: Service
    metadata:
      labels:
        app: locations-service
      name: locations-service
      namespace: default
    spec:
      type: NodePort
      externalTrafficPolicy: Cluster
      ports:
      - name: "8080"
        port: 8080
        targetPort: 8080
        protocol: TCP
      - name: "8081"
        port: 8081
        targetPort: 8081
        protocol: TCP
      selector:
        app: locations-service

Also i tried to add ingress routes, and tried to hit them but still the same problem occur.

Note that the application is successfully deployed, and i can check the logs from k8s dashboard
image

Another example, i have the following svc


kubectl describe service webapp1-svc
Name:                     webapp1-svc
Namespace:                default
Labels:                   app=webapp1
Annotations:              <none>
Selector:                 app=webapp1
Type:                     NodePort
IP:                       10.0.0.219
Port:                     <unset>  80/TCP
TargetPort:               80/TCP
NodePort:                 <unset>  30080/TCP
Endpoints:                172.17.0.4:80
Session Affinity:         None
External Traffic Policy:  Cluster
Events:                   <none>

and tried to access it using

curl -v 10.0.0.219:30080
* Rebuilt URL to: 10.0.0.219:30080/
*   Trying 10.0.0.219...
* connect to 10.0.0.219 port 30080 failed: Connection timed out
* Failed to connect to 10.0.0.219 port 30080: Connection timed out
* Closing connection 0
curl: (7) Failed to connect to 10.0.0.219 port 30080: Connection timed out
@k8s-github-robot k8s-github-robot added the needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label Nov 17, 2017
@dims
Copy link
Member

dims commented Nov 18, 2017

/sig network

@k8s-ci-robot k8s-ci-robot added the sig/network Categorizes an issue or PR as relevant to SIG Network. label Nov 18, 2017
@k8s-github-robot k8s-github-robot removed the needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label Nov 18, 2017
@thockin
Copy link
Member

thockin commented Jan 6, 2018

@thockin thockin closed this as completed Jan 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/network Categorizes an issue or PR as relevant to SIG Network.
Projects
None yet
Development

No branches or pull requests

5 participants