Skip to content

Commit

Permalink
Add ingress-merge helm chart
Browse files Browse the repository at this point in the history
  • Loading branch information
wpjunior committed May 25, 2021
1 parent c540ec6 commit 9e9f68c
Show file tree
Hide file tree
Showing 5 changed files with 189 additions and 0 deletions.
10 changes: 10 additions & 0 deletions charts/ingress-merge/Chart.yaml
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]
32 changes: 32 additions & 0 deletions charts/ingress-merge/templates/00_helpers.tpl
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 -}}
61 changes: 61 additions & 0 deletions charts/ingress-merge/templates/01_rbac.yaml
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 }}
53 changes: 53 additions & 0 deletions charts/ingress-merge/templates/02_deployment.yaml
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 }}
33 changes: 33 additions & 0 deletions charts/ingress-merge/values.yaml
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: {}

0 comments on commit 9e9f68c

Please sign in to comment.