Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions charts/iyp/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: v2
name: iyp
description: Internet Yellow Pages - Neo4j database with TLS support
type: application
version: 0.1.0
appVersion: "5.26.3"
keywords:
- neo4j
- database
- internet
- topology
home: https://github.com/InternetHealthReport/internet-yellow-pages
sources:
- https://github.com/InternetHealthReport/internet-yellow-pages
maintainers:
- name: IHR Team
url: https://github.com/InternetHealthReport
51 changes: 51 additions & 0 deletions charts/iyp/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "iyp.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 "iyp.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 "iyp.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "iyp.labels" -}}
helm.sh/chart: {{ include "iyp.chart" . }}
{{ include "iyp.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "iyp.selectorLabels" -}}
app.kubernetes.io/name: {{ include "iyp.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
18 changes: 18 additions & 0 deletions charts/iyp/templates/certificate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{{- if .Values.certificate.enabled -}}
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: {{ include "iyp.fullname" . }}-cert
labels:
{{- include "iyp.labels" . | nindent 4 }}
spec:
secretName: {{ .Values.certificate.secretName }}
issuerRef:
name: {{ .Values.certificate.issuer }}
kind: ClusterIssuer
commonName: {{ .Values.certificate.commonName }}
dnsNames:
{{- range .Values.certificate.dnsNames }}
- {{ . }}
{{- end }}
{{- end }}
43 changes: 43 additions & 0 deletions charts/iyp/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{{- if .Values.ingress.enabled -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "iyp.fullname" . }}
labels:
{{- include "iyp.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.className }}
ingressClassName: {{ .Values.ingress.className }}
{{- end }}
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ .path }}
{{- if .pathType }}
pathType: {{ .pathType }}
{{- end }}
backend:
service:
name: {{ include "iyp.fullname" $ }}
port:
name: https
{{- end }}
{{- end }}
{{- end }}
17 changes: 17 additions & 0 deletions charts/iyp/templates/pvc-dumps.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{- if .Values.persistence.dumps.enabled -}}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ include "iyp.fullname" . }}-dumps
labels:
{{- include "iyp.labels" . | nindent 4 }}
spec:
accessModes:
- {{ .Values.persistence.dumps.accessMode }}
resources:
requests:
storage: {{ .Values.persistence.dumps.size }}
{{- if .Values.persistence.dumps.storageClass }}
storageClassName: {{ .Values.persistence.dumps.storageClass }}
{{- end }}
{{- end }}
20 changes: 20 additions & 0 deletions charts/iyp/templates/service-headless.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "iyp.fullname" . }}-headless
labels:
{{- include "iyp.labels" . | nindent 4 }}
spec:
type: ClusterIP
clusterIP: None
selector:
{{- include "iyp.selectorLabels" . | nindent 4 }}
ports:
- port: {{ .Values.service.ports.https }}
targetPort: https
protocol: TCP
name: https
- port: {{ .Values.service.ports.bolt }}
targetPort: bolt
protocol: TCP
name: bolt
23 changes: 23 additions & 0 deletions charts/iyp/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "iyp.fullname" . }}
labels:
{{- include "iyp.labels" . | nindent 4 }}
{{- if and (eq .Values.service.type "LoadBalancer") .Values.service.metallb.pool }}
annotations:
metallb.universe.tf/address-pool: {{ .Values.service.metallb.pool }}
{{- end }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.ports.https }}
targetPort: https
protocol: TCP
name: https
- port: {{ .Values.service.ports.bolt }}
targetPort: bolt
protocol: TCP
name: bolt
selector:
{{- include "iyp.selectorLabels" . | nindent 4 }}
Loading