• Stars
    star
    140
  • Rank 261,473 (Top 6 %)
  • Language
    Go
  • License
    MIT License
  • Created about 6 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Merge Ingress Controller for Kubernetes

Merge Ingress Controller

Merge Ingress Controller combines multiple ingress resources into a new one.

Motivation

Different ingress controllers behave differently when creating services/load balancers satisfying the ingress resources of the managed class. Some create single service/LB for all ingress resources, some merge resources according to hosts or TLS certificates, other create separate service/LB per ingress resource.

E.g. AWS ALB Ingress Controller creates a new load balancer for each ingress resource. This can become quite costly. There is an issue to support reusing ALBs across ingress resources, however, it won't be implemented anytime soon.

Merge Ingress Controller allows you to create ingress resources that will be combined together to create a new ingress resource that will be managed by different controller.

Setup

Install via Helm:

helm install --namespace kube-system --name ingress-merge ./helm

Example

Create multiple ingresses & one config map that will provide parameters for the result ingress:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: foo-ingress
  annotations:
    kubernetes.io/ingress.class: merge
    merge.ingress.kubernetes.io/config: merged-ingress
spec:
  rules:
  - host: foo.example.com
    http:
      paths:
      - path: /
        backend:
          serviceName: foo-svc
          servicePort: 80

---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: bar-ingress
  annotations:
    kubernetes.io/ingress.class: merge
    merge.ingress.kubernetes.io/config: merged-ingress
spec:
  rules:
  - host: bar.example.com
    http:
      paths:
      - path: /
        backend:
          serviceName: bar-svc
          servicePort: 80

---
apiVersion: v1
kind: ConfigMap
metadata:
  name: merged-ingress
data:
  annotations: |
    kubernetes.io/ingress.class: other

Merge Ingress Controller will create new ingress resource named by the config map with rules combined together:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: merged-ingress
  annotations:
    kubernetes.io/ingress.class: other
spec:
  rules:
  - host: bar.example.com
    http:
      paths:
      - path: /
        backend:
          serviceName: bar-svc
          servicePort: 80

  - host: foo.example.com
    http:
      paths:
      - path: /
        backend:
          serviceName: foo-svc
          servicePort: 80

Annotations

Annotation Default Value Description Example
kubernetes.io/ingress.class Use merge for this controller to take over. kubernetes.io/ingress.class: merge
merge.ingress.kubernetes.io/config Name of the ConfigMap resource that will be used to merge this ingress with others. Because ingresses do not support to reference services across namespaces, neither does this reference. All ingresses to be merged, the config map & the result ingress use the same namespace. merge.ingress.kubernetes.io/config: merged-ingress
merge.ingress.kubernetes.io/priority 0 Rules from ingresses with higher priority come in the result ingress rules first. merge.ingress.kubernetes.io/priority: 10
merge.ingress.kubernetes.io/result Marks ingress created by the controller. If all source ingress resources are deleted, this ingress is deleted as well. merge.ingress.kubernetes.io/result: "true"

Configuration keys

Key Default Value Description Example
name name of the ConfigMap Name of the result ingress resource. name: my-merged-ingress
labels YAML/JSON-serialized labels to be applied to the result ingress. labels: '{"app": "loadbalancer", "env": "prod"}'
annotations {"merge.ingress.kubernetes.io/result":"true"} YAML/JSON-serialized labels to be applied to the result ingress. merge.ingress.kubernetes.io/result with value true will be always added to the annotations. annotations: '{"kubernetes.io/ingress.class": "alb"}
backend Default backend for the result ingress (spec.backend). Source ingresses must not specify default backend (such ingresses won't be merged). backend: '{"serviceName": "default-backend-svc", "servicePort": 80}

License

Licensed under MIT license. See LICENSE file.

More Repositories

1

bunny

Performant pure-PHP AMQP (RabbitMQ) sync/async (ReactPHP) library
PHP
698
star
2

chrome-devtools-protocol

Chrome Devtools Protocol client for PHP
PHP
170
star
3

btree

Append-only B+Tree implemented purely in PHP.
PHP
76
star
4

hit-server-bench

[ABANDONED] Comparison of many HTTP servers raw hit performance
Java
69
star
5

js2php

Javascript parser, compiler and interpreter written in PHP
PHP
50
star
6

couchdb-php

Simple PHP API to CouchDB
PHP
26
star
7

pacc

[OLD] use PHP7 rewrite https://github.com/axmachado/pacc (orig. description: pacc (PHP yACC), parser generator for PHP)
PHP
19
star
8

shopaholic

Shopaholic is an open-source e-shop based on PHP with Nette Framework and dibi under the hood.
PHP
19
star
9

reactphp-symfony

ReactPHP + Symfony example
PHP
14
star
10

phpeg

PEG for PHP
PHP
10
star
11

jeph

Application framework that runs Javascript on top of regular PHP engine
PHP
8
star
12

xo

Real-time multiplayer five-in-a-row Facebook game
JavaScript
7
star
13

fcgipass

Proxy HTTP requests to FastCGI server
Go
6
star
14

kube-jessie-ansible

[ABANDONED] Kubernetes set-up on Debian Jessie using Ansible
5
star
15

benchmarks

Some PHP benchmarks.
PHP
5
star
16

react-fcgi

[EXPERIMENTAL] Asynchronous FastCGI server built on ReactPHP
PHP
4
star
17

metatable

[ABANDONED] Simple way how to store and retrieve data, written natively in PHP.
PHP
3
star
18

bleve-additions

Some useful tools for Bleve
Go
3
star
19

nette-coffee

Nette Framework application where Presenters are generated from Coffeescript source
PHP
2
star
20

pssh

SSH server for any environment where PHP is
PHP
2
star
21

d4node

school project - simple UDP messaging with (sort of) auto-discovery
C
2
star
22

sally

Javascript library, which emulates some "advanced" CSS selectors (+, >, [attr]) for Microsoft Internet Explorer 6 using Sizzle selector library.
JavaScript
1
star
23

cc16-java-aop-multithreading

Codecamp 2016 AOP/multithreading lecture
Java
1
star
24

go-workshop

Go
1
star
25

sandbox

Puts given program into sandbox.
C
1
star
26

guestbook

Guestbook using PHP and metatable
PHP
1
star
27

cc16-java-elasticsearch

Codecamp 2016 Java Elasticsearch lecture
Java
1
star
28

nbh

neighbour discovery server
Erlang
1
star
29

xsession

xsession script that rewrites home on every X login
1
star
30

bayesian-spam-filter

Bayesian spam filter in Python
Python
1
star
31

dockerfiles

Custom Dockerfiles based on Debian Stretch.
Dockerfile
1
star