https://github.com/topfreegames/mystack-router
The router for mystack
https://github.com/topfreegames/mystack-router
kubernetes mystack nginx ops router stack
Last synced: about 2 months ago
JSON representation
The router for mystack
- Host: GitHub
- URL: https://github.com/topfreegames/mystack-router
- Owner: topfreegames
- License: apache-2.0
- Created: 2017-03-28T17:13:39.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2018-09-24T14:05:08.000Z (over 7 years ago)
- Last Synced: 2025-07-27T23:47:32.845Z (11 months ago)
- Topics: kubernetes, mystack, nginx, ops, router, stack
- Language: Go
- Size: 79.1 KB
- Stars: 2
- Watchers: 15
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
mystack-router
==============
[](https://travis-ci.org/topfreegames/mystack-router)
The router for mystack.
## About
This is the mystack router component, it will discover new services of apps deployed by mystack on Kubernetes cluster and creates routes on [Nginx](http://nginx.org) for your specific domain.
The routes are filtered by namespace (one for each user) and service.
## Dependencies
* Go 1.7
* Docker
## Building
#### Build a linux binary
```shell
make cross-build-linux-amd64
```
## Running
This router must run inside Kubernetes cluster. So you need to create a docker image, push it to Dockerhub and run a service using this image.
Here is an example of how to do it.
#### Build a docker image
On project root, run (mind the dot):
```shell
docker build -t dockerhub-user/mystack-router:v1 .
```
#### Push it to Dockerhub
```shell
docker push dockerhub-user/mystack-router:v1
```
#### Create a yaml file for the router
```
kubectl create -f ./manifests
```
#### Configure your domain
If you have the domain `yourdomain.com` registered, you can point `*.yourdomain.com` to your mystack-router loadbalancer external-ip and access your service with:
```shell
curl -v {{appname}}.{{user}}.yourdomain.com
```
#### Access your services
Given that you've pointed `*.yourdomain.com` to the router's LB address, access a service with:
```
example:
app: testapp
user: test-user
curl testapp.test-user.yourdomain.com
```