{"action":"reopened","issue":{"url":"https://api.github.com/repos/kubernetes/contrib/issues/342","labels_url":"https://api.github.com/repos/kubernetes/contrib/issues/342/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/contrib/issues/342/comments","events_url":"https://api.github.com/repos/kubernetes/contrib/issues/342/events","html_url":"https://github.com/kubernetes/contrib/issues/342","id":123795725,"number":342,"title":"\"Not Found\" when accessing service","user":{"login":"ramonrue","id":16387735,"avatar_url":"https://avatars.githubusercontent.com/u/16387735?v=3","gravatar_id":"","url":"https://api.github.com/users/ramonrue","html_url":"https://github.com/ramonrue","followers_url":"https://api.github.com/users/ramonrue/followers","following_url":"https://api.github.com/users/ramonrue/following{/other_user}","gists_url":"https://api.github.com/users/ramonrue/gists{/gist_id}","starred_url":"https://api.github.com/users/ramonrue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ramonrue/subscriptions","organizations_url":"https://api.github.com/users/ramonrue/orgs","repos_url":"https://api.github.com/users/ramonrue/repos","events_url":"https://api.github.com/users/ramonrue/events{/privacy}","received_events_url":"https://api.github.com/users/ramonrue/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-12-24T11:53:08Z","updated_at":"2016-01-06T14:12:30Z","closed_at":null,"body":"I went through the Readme and tried out the proxy. \r\nI had to edit the haproxy.cfg file because I got the following error-messages when running /haproxy_reload:\r\n```shell\r\n[ALERT] 357/114415 (26) : parsing [/etc/haproxy/haproxy.cfg:32] : 'listen' cannot handle unexpected argument ':1936'.\r\n[ALERT] 357/114415 (26) : parsing [/etc/haproxy/haproxy.cfg:32] : please use the 'bind' keyword for listening addresses.\r\n[ALERT] 357/114415 (26) : Error(s) found in configuration file : /etc/haproxy/haproxy.cfg\r\n[WARNING] 357/114415 (26) : config : proxy 'stats' has no 'bind' directive. Please declare it as a backend if this was intended.\r\n[WARNING] 357/114415 (26) : config : missing timeouts for proxy 'stats'.\r\n   | While not properly invalid, you will certainly encounter various problems\r\n   | with such a configuration. To fix this, please ensure that all following\r\n   | timeouts are set to a non-zero value: 'client', 'connect', 'server'.\r\n[WARNING] 357/114415 (26) : config : log format ignored for frontend 'httpfrontend' since it has no log address.\r\n[ALERT] 357/114415 (26) : Fatal errors found in configuration.\r\n```\r\n\r\nAs of these errors, I changed my /etc/haproxy/haproxy.cfg to:\r\n```shell\r\n# Default haprxy config file. The service-loadbalancer uses\r\n# go templates (http://golang.org/pkg/text/template/) to\r\n# generate the config dynamically.\r\nglobal\r\n    daemon\r\n    stats socket /tmp/haproxy\r\n    server-state-file global\r\n    server-state-base /var/state/haproxy/\r\n\r\ndefaults\r\n        log     global\r\n        mode    http\r\n        option  httplog\r\n        option  dontlognull\r\n    timeout connect 5000\r\n    timeout client 50000\r\n    timeout server 50000\r\n        errorfile 400 /etc/haproxy/errors/400.http\r\n        errorfile 403 /etc/haproxy/errors/403.http\r\n        errorfile 408 /etc/haproxy/errors/408.http\r\n        errorfile 500 /etc/haproxy/errors/500.http\r\n        errorfile 502 /etc/haproxy/errors/502.http\r\n        errorfile 503 /etc/haproxy/errors/503.http\r\n        errorfile 504 /etc/haproxy/errors/504.http\r\n    # default default_backend. This allows custom default_backend in frontends\r\n    default_backend default-backend\r\n\r\nbackend default-backend\r\n  server localhost 127.0.0.1:8081\r\n\r\nfrontend httpfrontend\r\n    # Frontend bound on all network interfaces on port 80\r\n    bind *:80\r\n    mode        http\r\n```\r\nWhen running the /haproxy_reload again, the haproxy started, but with the following errors:\r\n```shell\r\nbash-4.3# /haproxy_reload\r\ncat: can't open '/var/run/haproxy.pid': No such file or directory\r\n[WARNING] 357/114616 (36) : config : log format ignored for frontend 'httpfrontend' since it has no log address.\r\n```\r\n\r\nNonetheless, ps was showing the haproxy working:\r\n```shell\r\nbash-4.3# ps -ef\r\nPID   USER     TIME   COMMAND\r\n    1 root       0:00 /service_loadbalancer --tcp-services=nginxsvc:80\r\n   18 root       0:00 bash\r\n   37 root       0:00 haproxy -f /etc/haproxy/haproxy.cfg -p /var/run/haproxy.pid -D -sf\r\n   38 root       0:00 ps -ef\r\n```\r\nAnd I could reach the proxy in my browser, the message was \"not found\".\r\nAfter starting the nginx-service (from the template), I could reach it via it's private Pod-IP.\r\n```shell\r\ncurl 10.1.101.3\r\n<html>\r\n<body style=\"background:red\">\r\n<h1>1.0.0</h1>\r\n</body>\r\n</html>\r\n```\r\n(Note here: I changed the default container to the coreos/example:1.0.0 because the other didn't start correctly)\r\n\r\nWhen going back to my browser and trying to access it under /nginxsvc, I just get \"Not Found\"...\r\nIt seems like the nginx-Pod does not get registered in the haproxy.\r\n\r\nI used the following files:\r\n**nginx-app.yml**\r\n```shell\r\napiVersion: v1\r\nkind: Service\r\nmetadata:\r\n  name: nginxsvc\r\n  labels:\r\n    app: nginx\r\nspec:\r\n  ports:\r\n  - port: 80\r\n    protocol: TCP\r\n    name: http\r\n  - port: 443\r\n    protocol: TCP\r\n    name: https\r\n  selector:\r\n    app: nginx\r\n---\r\napiVersion: v1\r\nkind: ReplicationController\r\nmetadata:\r\n  name: my-nginx\r\nspec:\r\n  replicas: 1\r\n  template:\r\n    metadata:\r\n      labels:\r\n        app: nginx\r\n    spec:\r\n      containers:\r\n      - name: nginxhttps\r\n        image: coreos/example:1.0.0\r\n        ports:\r\n        - containerPort: 443\r\n        - containerPort: 80\r\n```\r\n\r\n**rc.yaml**\r\n```shell\r\napiVersion: v1\r\nkind: ReplicationController\r\nmetadata:\r\n  name: service-loadbalancer\r\n  labels:\r\n    app: service-loadbalancer\r\n    version: v1\r\nspec:\r\n  replicas: 1\r\n  selector:\r\n    app: service-loadbalancer\r\n    version: v1\r\n  template:\r\n    metadata:\r\n      labels:\r\n        app: service-loadbalancer\r\n        version: v1\r\n    spec:\r\n      nodeSelector:\r\n        role: loadbalancer\r\n      containers:\r\n      - image: gcr.io/google_containers/servicelb:0.2\r\n        imagePullPolicy: IfNotPresent\r\n        name: haproxy\r\n        ports:\r\n        # All http services\r\n        - containerPort: 80\r\n          hostPort: 80\r\n          protocol: TCP\r\n        # haproxy stats\r\n        - containerPort: 1936\r\n          hostPort: 1936\r\n          protocol: TCP\r\n        resources: {}\r\n        args:\r\n        - --tcp-services=nginxsvc:80\r\n```\r\n\r\nEvery help would be appreciated."}}