Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hxquangnhat/kubernetes-auto-ingress
Dynamically create an ingress for an associated service for Kubernetes, works with nginx ingress controller
https://github.com/hxquangnhat/kubernetes-auto-ingress
auto-ingress dynamic ingress-controller kubernetes
Last synced: 10 days ago
JSON representation
Dynamically create an ingress for an associated service for Kubernetes, works with nginx ingress controller
- Host: GitHub
- URL: https://github.com/hxquangnhat/kubernetes-auto-ingress
- Owner: hxquangnhat
- License: apache-2.0
- Created: 2017-05-13T21:19:30.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-01-20T22:18:56.000Z (almost 7 years ago)
- Last Synced: 2024-06-20T03:48:27.392Z (5 months ago)
- Topics: auto-ingress, dynamic, ingress-controller, kubernetes
- Language: Go
- Homepage:
- Size: 18.6 KB
- Stars: 43
- Watchers: 5
- Forks: 12
- Open Issues: 2
-
Metadata Files:
- Readme: README.MD
- License: LICENSE
Awesome Lists containing this project
- awesome-kubernetes - Kubernetes Auto-Ingress - Dynamically create an ingress for an associated service for Kubernetes, works with NGNIX ingress controller. (Tools)
README
kubernetes-auto-ingress
=======================[![Build Status](https://travis-ci.org/hxquangnhat/kubernetes-auto-ingress.svg?branch=master)](https://travis-ci.org/hxquangnhat/kubernetes-auto-ingress)
[![Go Report Card](https://goreportcard.com/badge/github.com/hxquangnhat/kubernetes-auto-ingress)](https://goreportcard.com/report/github.com/hxquangnhat/kubernetes-auto-ingress)Description
-----------Dynamically create an ingress for a service which specifies "autoingress: true" label, for associated namespace of the service.
Use `TLS/SSL` and backend is `/` by default.
Works with [nginx-ingress-controller](https://github.com/kubernetes/ingress/tree/master/controllers/nginx).
How to use it
-------------Require nginx-ingress-controller running.
Below describes how to run auto-ingress with your `secret` for domain `example.com`
```
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout tls.key -out tls.crt -subj "/CN=*.example.com"
kubectl create secret tls secret --key tls.key --cert tls.crt
kubectl create -f hack/deployment.yaml
```If you want to use it outside of the cluster, provide the `kubeconfig` with config file:
`./kubernetes-auto-ingress -kubeconfig=./config`
Then, for every services you want to be ingressed need to put label **auto-ingress/enabled: enabled**.
Service which is already ingressed can be un-ingressed by setting **auto-ingress/enabled: disabled**.
```yaml
apiVersion: v1
kind: Service
metadata:
name: myapp-service
labels:
app: myapp
auto-ingress/enabled: 'enabled'
spec:
type: LoadBalancer
ports:
- name: http
port: 80
targetPort: http
selector:
app: myapp
```The ingress for this `myapp-service` will have the same name `myapp-service`. The servername to access this service would be `myapp-service.example.com`.
How to build it
---------------Clone the repository and build the container
```
$ go get github.com/hxquangnhat/kubernetes-auto-ingress
$ cd $GOPATH/github.com/hxquangnhat/kubernetes-auto-ingress
$ make container
```