deis / router

Edge router for Deis Workflow
https://deis.com
MIT License
80 stars 57 forks source link

404 errors on beta2 #169

Closed jeremyjh closed 8 years ago

jeremyjh commented 8 years ago

I've installed deis-workflow on a bare-metal Ubuntu 14.04 box using the kubernetes docker setup and helm to install deis-workflow.

All the deis services are in a running status, but I get 404s for any request.

NAME                          READY     STATUS    RESTARTS   AGE
deis-builder-13ppc            1/1       Running   2          54m
deis-controller-axkqi         1/1       Running   4          54m
deis-database-mz33p           1/1       Running   2          54m
deis-logger-9y52y             1/1       Running   0          54m
deis-logger-fluentd-0cfza     1/1       Running   0          54m
deis-minio-ilmh9              1/1       Running   0          54m
deis-registry-12fte           1/1       Running   1          54m
deis-router-rz5o5             1/1       Running   0          54m
deis-workflow-manager-k4fpa   1/1       Running   0          54m

56m     56m     1   {default-scheduler }            Normal      Scheduled   Successfully assigned deis-router-rz5o5 to 127.0.0.1
...
  33m   33m 1   {kubelet 127.0.0.1} spec.containers{deis-router}    Normal  Pulling     pulling image "quay.io/deis/router:v2.0.0-beta2"
  31m   31m 1   {kubelet 127.0.0.1} spec.containers{deis-router}    Normal  Pulled      Successfully pulled image "quay.io/deis/router:v2.0.0-beta2"
  31m   31m 1   {kubelet 127.0.0.1} spec.containers{deis-router}    Normal  Created     Created container with docker id 1ab50f2d9eef
  31m   31m 1   {kubelet 127.0.0.1} spec.containers{deis-router}    Normal  Started     Started container with docker id 1ab50f2d9eef

Name:           deis-router
Namespace:      deis
Labels:         heritage=deis
Selector:       app=deis-router
Type:           LoadBalancer
IP:         10.0.0.124
Port:           http    80/TCP
NodePort:       http    32642/TCP
Endpoints:      172.17.0.11:8080
Port:           https   443/TCP
NodePort:       https   31722/TCP
Endpoints:      172.17.0.11:6443
Port:           builder 2222/TCP
NodePort:       builder 31702/TCP
Endpoints:      172.17.0.11:2222
Port:           healthz 9090/TCP
NodePort:       healthz 30617/TCP
Endpoints:      172.17.0.11:9090
Session Affinity:   None
No events.

[(ruby-2.1.3)] ~/Downloads curl http://10.0.0.124/v2
<html>
<head><title>404 Not Found</title></head>
<body bgcolor="white">
<center><h1>404 Not Found</h1></center>
<hr><center>nginx/1.9.6</center>
</body>
</html>

[(ruby-2.1.3)] ~/Downloads curl http://127.0.0.1/v2 
<html>
<head><title>404 Not Found</title></head>
<body bgcolor="white">
<center><h1>404 Not Found</h1></center>
<hr><center>nginx/1.9.6</center>
</body>
</html>
jeremyjh commented 8 years ago

Adding full describe output:

[(ruby-2.1.3)] ~/.helm/workspace/charts/workflow-beta2 kubectl describe pod deis-router --namespace=deis                                                                                                        <<<
Name:       deis-router-rz5o5
Namespace:  deis
Node:       127.0.0.1/127.0.0.1
Start Time: Sat, 23 Apr 2016 09:55:36 -0400
Labels:     app=deis-router
Status:     Running
IP:     172.17.0.6
Controllers:    ReplicationController/deis-router
Containers:
  deis-router:
    Container ID:   docker://d8cee25347d0d8618fb7016f2a6d964c188e118a7464dd2fdc8dec7267a6e962
    Image:      quay.io/deis/router:v2.0.0-beta2
    Image ID:       docker://sha256:933998723fc6ad10a8d44c6a3dc4bc185e4416a7b2aba17a1c0cfc6cdc29f0d5
    Ports:      8080/TCP, 6443/TCP, 2222/TCP, 9090/TCP
    QoS Tier:
      cpu:      BestEffort
      memory:       BestEffort
    State:      Running
      Started:      Sat, 23 Apr 2016 12:00:29 -0400
    Ready:      True
    Restart Count:  0
    Liveness:       http-get http://:9090/healthz delay=1s timeout=1s period=10s #success=1 #failure=3
    Readiness:      http-get http://:9090/healthz delay=1s timeout=1s period=10s #success=1 #failure=3
    Environment Variables:
      POD_NAMESPACE:    deis (v1:metadata.namespace)
Conditions:
  Type      Status
  Ready     True 
Volumes:
  deis-router-token-b4jjb:
    Type:   Secret (a volume populated by a Secret)
    SecretName: deis-router-token-b4jjb
Events:
  FirstSeen LastSeen    Count   From            SubobjectPath           Type        Reason  Message
  --------- --------    -----   ----            -------------           --------    ------  -------
  3m        3m      1   {kubelet 127.0.0.1} spec.containers{deis-router}    Normal      Pulled  Container image "quay.io/deis/router:v2.0.0-beta2" already present on machine
  3m        3m      1   {kubelet 127.0.0.1} spec.containers{deis-router}    Normal      Created Created container with docker id d8cee25347d0
  3m        3m      1   {kubelet 127.0.0.1} spec.containers{deis-router}    Normal      Started Started container with docker id d8cee25347d0
jeremyjh commented 8 years ago

Found some errors in the workflow manager - could these be implicated?

[(ruby-2.1.3)] ~/.helm/workspace/charts/workflow-beta2 kubectl logs --namespace=deis deis-workflow-manager-k4fpa
2016/04/23 16:01:09 periodic job ran and returned error:
2016/04/23 16:01:09 Get https://versions.deis.com/v2/versions: dial tcp: lookup versions.deis.com on 10.0.0.10:53: read udp 172.17.0.5:60425->10.0.0.10:53: i/o timeout
2016/04/23 16:01:49 Get https://versions.deis.com/v2/versions: dial tcp: lookup versions.deis.com on 10.0.0.10:53: read udp 172.17.0.5:45828->10.0.0.10:53: i/o timeout
2016/04/23 16:01:49 Get https://versions.deis.com/v2/versions: dial tcp: lookup versions.deis.com on 10.0.0.10:53: read udp 172.17.0.5:45828->10.0.0.10:53: i/o timeout
2016/04/23 16:02:29 error sending diagnostic data
2016/04/23 16:02:29 periodic job ran and returned error:
2016/04/23 16:02:29 Post https://versions.deis.com/v2/clusters/f00c4423-4a7e-46ae-9da4-2fc95df33438: dial tcp: lookup versions.deis.com on 10.0.0.10:53: read udp 172.17.0.5:48311->10.0.0.10:53: i/o timeout
krancour commented 8 years ago

@jeremyjh the problem is that the router directs traffic within the cluster based on the value of the HTTP Host header. That header is implicitly set by curl when you use a URL that contains a fully qualified domain name, e.g. curl http://foo.example.com. If you use a URL containing an IP, as you have in your examples here, you need to explicitly set that header yourself.

Try this... assuming an application named foo:

$ curl --header 'Host: foo.example.com' http://<ip>
jeremyjh commented 8 years ago

Thanks, you told me what I needed to know!

I was able to register with the controller by using the xip.io domain:

deis register http://deis.127.0.0.1.xip.io
krancour commented 8 years ago

Yup. I always forget to suggest xip.io. Glad you are up and running.