Skip to content
This repository was archived by the owner on May 27, 2019. It is now read-only.

Commit 7cbf93e

Browse files
committed
docs(readme): Clarify that routable services must expose port 80
1 parent c1585eb commit 7cbf93e

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,27 @@ Requesting http://unknown.example.com should result in a 404 from the router sin
162162

163163
The router is implemented as a simple Go program that manages Nginx and Nginx configuration. It regularly queries the Kubernetes API for services labeled with `router.deis.io/routable: "true"`. Such services are compared to known services resident in memory. If there are differences, new Nginx configuration is generated and Nginx is reloaded.
164164

165+
__Routable services must expose port 80.__ The target port in underlying pods may be anything, but the service itself must expose port 80. For example:
166+
167+
```
168+
apiVersion: v1
169+
kind: Service
170+
metadata:
171+
name: foo
172+
labels:
173+
router.deis.io/routable: "true"
174+
namespace: examples
175+
annotations:
176+
router.deis.io/domains: www.foobar.com
177+
spec:
178+
selector:
179+
app: foo
180+
ports:
181+
- port: 80
182+
targetPort: 3000
183+
# ...
184+
```
185+
165186
When generating configuration, the program reads all annotations of each service prefixed with `router.deis.io`. These annotations describe all the configuration options that allow the program to dynamically construct Nginx configuration, including virtual hosts for all the domain names associated with each routable application.
166187

167188
Similarly, the router watches the annotations on its _own_ replication controller to dynamically construct global Nginx configuration.

0 commit comments

Comments
 (0)