Skip to content

Commit

Permalink
Merge pull request #8 from MaikuMori:add-ingress
Browse files Browse the repository at this point in the history
Add ingress resource
  • Loading branch information
MaikuMori authored Jan 22, 2023
2 parents 82b8ef7 + 61f7739 commit aa45e00
Show file tree
Hide file tree
Showing 5 changed files with 96 additions and 3 deletions.
6 changes: 5 additions & 1 deletion charts/gotenberg/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# Changelog

## 0.4.0

- Add `Ingress` resource.

## 0.3.1

- Bump `gotenberg` version `7.7.2` -> `7.8.0`
- Bump `gotenberg` version `7.7.2` -> `7.8.0`.

## 0.3.0

Expand Down
2 changes: 1 addition & 1 deletion charts/gotenberg/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: '0.3.1'
version: '0.4.0'

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
7 changes: 6 additions & 1 deletion charts/gotenberg/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Gotenberg

[![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/gotenberg)](https://artifacthub.io/packages/search?repo=gotenberg)
![Version: 0.3.1](https://img.shields.io/badge/Version-0.3.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 7.8.0](https://img.shields.io/badge/AppVersion-7.8.0-informational?style=flat-square)
![Version: 0.4.0](https://img.shields.io/badge/Version-0.4.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 7.8.0](https://img.shields.io/badge/AppVersion-7.8.0-informational?style=flat-square)

This is a HELM chart for Gotenberg.

Expand Down Expand Up @@ -75,6 +75,11 @@ helm upgrade my-release maikumori/gotenberg --install
| image.repository | string | `"gotenberg/gotenberg"` | |
| image.tag | string | `""` | Overrides the image tag whose default is the chart appVersion. |
| imagePullSecrets | list | `[]` | |
| ingress.annotations | object | `{}` | Set the annotations of the ingress |
| ingress.className | string | `""` | Set the class name of the ingress |
| ingress.enabled | bool | `false` | Set to true to enable ingress record generation. WARNING: Gotenberg shouldn't be exposed to the internet. |
| ingress.hosts | list | `[]` | Set the hostnames of the ingress, see values.yaml for an example. |
| ingress.tls | list | `[]` | Set the TLS configuration for the ingress, see values.yaml for an example. |
| libreOffice.disableRoutes | bool | `false` | Disable the routes |
| libreOffice.unoListenerRestartThreshold | string | `""` | Conversions limit after which the LibreOffice listener is restarted - 0 means no long-running LibreOffice listener (default 10) |
| libreOffice.unoListenerStartTimeout | string | `""` | Time limit for starting the LibreOffice listener (default 10s) |
Expand Down
61 changes: 61 additions & 0 deletions charts/gotenberg/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "gotenberg.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
{{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
{{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}}
{{- end }}
{{- end }}
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
{{- include "gotenberg.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
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 and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
pathType: {{ .pathType }}
{{- end }}
backend:
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
service:
name: {{ $fullName }}
port:
number: {{ $svcPort }}
{{- else }}
serviceName: {{ $fullName }}
servicePort: {{ $svcPort }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
23 changes: 23 additions & 0 deletions charts/gotenberg/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,29 @@ tolerations: []

affinity: {}

ingress:
# -- Set to true to enable ingress record generation. WARNING: Gotenberg shouldn't be exposed to the internet.
enabled: false
# -- Set the class name of the ingress
className: ''
# -- Set the annotations of the ingress
annotations:
{}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
# -- Set the hostnames of the ingress, see values.yaml for an example.
hosts:
[]
# - host: chart-example.local
# paths:
# - path: /
# pathType: ImplementationSpecific
# -- Set the TLS configuration for the ingress, see values.yaml for an example.
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local

# The API module is an HTTP/1 and HTTP/2 (H2C) server. Other modules may add routes, middlewares, and health checks.
# https://gotenberg.dev/docs/modules/api
api:
Expand Down

0 comments on commit aa45e00

Please sign in to comment.