-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
189 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
apiVersion: v1 | ||
name: ingress-merge | ||
version: 0.1-alpha1 | ||
description: Merge Ingress Controller combines multiple ingress resorces into a new one. | ||
keywords: | ||
- ingress | ||
home: https://github.com/jakubkulhan/ingress-merge | ||
maintainers: | ||
- name: Jakub Kulhan | ||
email: [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "ingress-merge.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
If release name contains chart name it will be used as a full name. | ||
*/}} | ||
{{- define "ingress-merge.fullname" -}} | ||
{{- if .Values.fullnameOverride -}} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- $name := default .Chart.Name .Values.nameOverride -}} | ||
{{- if contains $name .Release.Name -}} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "ingress-merge.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
{{ if .Values.rbac.create }} | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: {{ include "ingress-merge.fullname" . }} | ||
labels: | ||
app: {{ include "ingress-merge.name" . }} | ||
chart: {{ include "ingress-merge.chart" . }} | ||
heritage: {{ .Release.Service }} | ||
release: {{ .Release.Name }} | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1beta1 | ||
kind: ClusterRole | ||
metadata: | ||
name: {{ include "ingress-merge.fullname" . }} | ||
labels: | ||
app: {{ include "ingress-merge.name" . }} | ||
chart: {{ include "ingress-merge.chart" . }} | ||
heritage: {{ .Release.Service }} | ||
release: {{ .Release.Name }} | ||
rules: | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- configmaps | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- apiGroups: | ||
- extensions | ||
resources: | ||
- ingresses | ||
- ingresses/status | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- create | ||
- update | ||
- patch | ||
- delete | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1beta1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: {{ include "ingress-merge.fullname" . }} | ||
labels: | ||
app: {{ include "ingress-merge.name" . }} | ||
chart: {{ include "ingress-merge.chart" . }} | ||
heritage: {{ .Release.Service }} | ||
release: {{ .Release.Name }} | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: {{ include "ingress-merge.fullname" . }} | ||
subjects: | ||
- kind: ServiceAccount | ||
name: {{ include "ingress-merge.fullname" . }} | ||
namespace: {{ .Release.Namespace }} | ||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ include "ingress-merge.fullname" . }} | ||
labels: | ||
app: {{ include "ingress-merge.name" . }} | ||
chart: {{ include "ingress-merge.chart" . }} | ||
heritage: {{ .Release.Service }} | ||
release: {{ .Release.Name }} | ||
spec: | ||
replicas: 1 | ||
strategy: | ||
type: Recreate | ||
selector: | ||
matchLabels: | ||
app: {{ include "ingress-merge.name" . }} | ||
release: {{ .Release.Name }} | ||
template: | ||
metadata: | ||
labels: | ||
app: {{ include "ingress-merge.name" . }} | ||
release: {{ .Release.Name }} | ||
spec: | ||
serviceAccountName: {{ if .Values.rbac.create }}{{ include "ingress-merge.fullname" . }}{{ else }}"{{ .Values.rbac.serviceAccountName }}"{{ end }} | ||
containers: | ||
- name: {{ .Chart.Name }} | ||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" | ||
imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
args: | ||
- --logtostderr | ||
- --ingress-class={{ .Values.ingressClass }} | ||
{{- if .Values.configMapSelector }} | ||
- --configmap-selector={{ .Values.configMapSelector }}{{ end }} | ||
{{- if .Values.ingressSelector }} | ||
- --ingress-selector={{ .Values.ingressSelector }}{{ end }} | ||
{{- range .Values.configMapWatchIgnore }} | ||
- --configmap-watch-ignore={{ . }}{{ end }} | ||
{{- range .Values.ingressWatchIgnore }} | ||
- --ingress-watch-ignore={{ . }}{{ end }} | ||
resources: | ||
{{ toYaml .Values.resources | indent 12 }} | ||
{{- with .Values.nodeSelector }} | ||
nodeSelector: | ||
{{ toYaml . | indent 8 }} | ||
{{- end }} | ||
{{- with .Values.affinity }} | ||
affinity: | ||
{{ toYaml . | indent 8 }} | ||
{{- end }} | ||
{{- with .Values.tolerations }} | ||
tolerations: | ||
{{ toYaml . | indent 8 }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Ingress-class annotation to manage | ||
ingressClass: merge | ||
|
||
# Label selector for ConfigMap objects to be monitored for changes | ||
# e.g. "merge.ingress.kubernetes.io=owned" | ||
configMapSelector: "" | ||
|
||
# Label selector for Ingress objects to be monitored for changes | ||
ingressSelector: "" | ||
|
||
# List of annotations that will cause a ConfigMap to be ignored if present | ||
# e.g. "control-plane.alpha.kubernetes.io/leader" | ||
configMapWatchIgnore: [] | ||
|
||
# List of annotations that will cause an Ingress to be ignored if present | ||
ingressWatchIgnore: [] | ||
|
||
rbac: | ||
create: true | ||
serviceAccountName: default | ||
|
||
image: | ||
repository: tsuru/ingress-merge | ||
tag: latest | ||
pullPolicy: Always | ||
|
||
resources: {} | ||
|
||
nodeSelector: {} | ||
|
||
tolerations: [] | ||
|
||
affinity: {} |