Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eldarion-gondor/k8s-http-router
HTTP router for Kubernetes
https://github.com/eldarion-gondor/k8s-http-router
Last synced: 23 days ago
JSON representation
HTTP router for Kubernetes
- Host: GitHub
- URL: https://github.com/eldarion-gondor/k8s-http-router
- Owner: eldarion-gondor
- Created: 2015-06-20T16:20:34.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-06-20T17:08:50.000Z (over 9 years ago)
- Last Synced: 2024-08-04T04:03:16.363Z (4 months ago)
- Language: Go
- Size: 125 KB
- Stars: 23
- Watchers: 11
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- starred-awesome - k8s-http-router - HTTP router for Kubernetes (Go)
README
# k8s-http-router
> Warning: this project is very new and might have some issues. We have been using it successfully in our testing clusters for a couple of months. Bug reports are welcome!g
This project has been pulled from the new Gondor backend built on Kubernetes. It simply routes HTTP requests to Kubernetes services using the HTTP Host header. Additional configuration can be specified, but nothing else is currently supported.
# Setup
To get k8s-http-router running on your Kubernetes cluster you can use the following replication controller:
kind: ReplicationController
apiVersion: v1beta3
metadata:
name: router
spec:
replicas: 3
selector:
name: router
template:
metadata:
labels:
name: router
spec:
containers:
- name: router
image: quay.io/eldarion/k8s-http-router
ports:
- name: router-http
containerPort: 80
- name: router-https
containerPort: 443and service:
kind: Service
apiVersion: v1beta3
metadata:
name: router
labels:
name: router
spec:
selector:
name: router
ports:
- name: router-http
port: 80
- name: router-https
port: 443
createExternalLoadBalancer: trueTo add a service to route, use the `router` annotation:
kind: Service
apiVersion: v1beta3
metadata:
name: my-website
labels:
name: my-website
annotations:
router: '{"config": {}, "hosts": ["example.com"]}'
spec:
selector:
name: my-website
ports:
- port: 80
targetPort: 8000k8s-http-router will watch for service changes and keep its internal data structures up-to-date with changes in the Kubernetes service objects.
# Credit
Thanks to Google for the amazing [Kubernetes](https://github.com/GoogleCloudPlatform/kubernetes) project.
Thanks to the [flynn](https://github.com/flynn/flynn) project for a great router design this is inspired by, but stripped down and modified for Kubernetes.