{"action":"opened","issue":{"url":"https://api.github.com/repos/nginxinc/kubernetes-ingress/issues/442","repository_url":"https://api.github.com/repos/nginxinc/kubernetes-ingress","labels_url":"https://api.github.com/repos/nginxinc/kubernetes-ingress/issues/442/labels{/name}","comments_url":"https://api.github.com/repos/nginxinc/kubernetes-ingress/issues/442/comments","events_url":"https://api.github.com/repos/nginxinc/kubernetes-ingress/issues/442/events","html_url":"https://github.com/nginxinc/kubernetes-ingress/issues/442","id":380768328,"node_id":"MDU6SXNzdWUzODA3NjgzMjg=","number":442,"title":"Route 53 compability in daemonset mode","user":{"login":"dmitriy-myz","id":4669929,"node_id":"MDQ6VXNlcjQ2Njk5Mjk=","avatar_url":"https://avatars2.githubusercontent.com/u/4669929?v=4","gravatar_id":"","url":"https://api.github.com/users/dmitriy-myz","html_url":"https://github.com/dmitriy-myz","followers_url":"https://api.github.com/users/dmitriy-myz/followers","following_url":"https://api.github.com/users/dmitriy-myz/following{/other_user}","gists_url":"https://api.github.com/users/dmitriy-myz/gists{/gist_id}","starred_url":"https://api.github.com/users/dmitriy-myz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmitriy-myz/subscriptions","organizations_url":"https://api.github.com/users/dmitriy-myz/orgs","repos_url":"https://api.github.com/users/dmitriy-myz/repos","events_url":"https://api.github.com/users/dmitriy-myz/events{/privacy}","received_events_url":"https://api.github.com/users/dmitriy-myz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-14T16:04:37Z","updated_at":"2018-11-14T16:04:37Z","closed_at":null,"author_association":"NONE","body":"**Describe situation**\r\nI have a bare metal cluster, running nginx-ingress as daemonset. Also have route 53 with health checks.\r\nWant to update daemonset or maintain node.\r\nCurrently if I just stop pod with nginx-ingress daemon, it just immediately kill it and run new one. All requests, that send to it will be lost it that period.\r\nI want to pod serve requests, but fail route 53 checks.\r\n\r\n**Describe the solution you'd like**\r\nAllow to add custom locations to default server directive\r\nThen this can be done by adding this to default server directive.\r\n```\r\nlocation /aws-health {\r\n    if ( -e /tmp/maintenance ) {\r\n        return 404;\r\n    }\r\n    return 200;\r\n}\r\n```\r\n\r\nand lifecycle rule like this\r\n\r\n```\r\n    lifecycle:\r\n      preStop:\r\n        exec:\r\n          command: [\"bash\", \"-c\", \"touch /tmp/maintenance && sleep 120\"]\r\n    terminationGracePeriodSeconds: 125\r\n```\r\n\r\n\r\n**Describe alternatives you've considered**\r\n\r\nCurrent workaround:\r\ncreate an ingress rule on some namespace with some service (e.g. `nginx-ingress`)\r\n\r\n```\r\napiVersion: v1\r\nkind: Service\r\nmetadata:\r\n  name: dummy-service\r\n  namespace: nginx-ingress\r\n  labels:\r\n    app: dummy-service\r\nspec:\r\n  ports:\r\n  - port: 80\r\n    protocol: TCP\r\n  selector:\r\n    app: dummy-service\r\n---\r\napiVersion: extensions/v1beta1\r\nkind: Ingress\r\nmetadata:\r\n  name: aws-health-checks\r\n  namespace: nginx-ingress\r\n  annotations:\r\n    nginx.org/server-snippets: |\r\n      location /aws-health {\r\n          if ( -e /tmp/maintenance ) {\r\n              return 404;\r\n          }\r\n          return 200;\r\n      }\r\nspec:\r\n  rules:\r\n  - host: aws.checks\r\n    http:\r\n      paths:\r\n      - path: /\r\n        backend:\r\n          serviceName: dummy-service\r\n          servicePort: 80\r\n```\r\n"}}
{"actor":{"display_login":"dmitriy-myz"}}