Skip to content

Commit

Permalink
[MOD] ingress definition & bump chart to 0.1.2
Browse files Browse the repository at this point in the history
Squashed commit of the following:

commit a3152f0
Author: Alexandre Nuttinck <alexandre.nuttinck@imio.be>
Date:   Mon Aug 28 10:34:42 2023 +0200

    [MOD] ingress definition
  • Loading branch information
alexnuttinck committed Aug 28, 2023
1 parent 0d308d8 commit 167f87a
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 32 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ jobs:
uses: helm/kind-action@v1.7.0

- name: Run chart-testing (install)
run: ct install --chart-dirs . --charts . --target-branch ${{ github.event.repository.default_branch }}

# run: ct install --chart-dirs . --charts . --target-branch ${{ github.event.repository.default_branch }}
# can't use it until https://github.com/helm/chart-testing/issues/310 is resolved
run: helm install plausible-analytics . -f values.yaml --namespace plausible-analytics --create-namespace
2 changes: 1 addition & 1 deletion Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: v2
name: plausible-analytics
description: A Helm Chart for Plausible Analytics - Simple, open-source, lightweight (< 1 KB) and privacy-friendly web analytics alternative to Google Analytics.
type: application
version: 0.1.1
version: 0.1.2
appVersion: 2.0.0
keywords:
- web analytics
Expand Down
6 changes: 0 additions & 6 deletions templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,6 @@ spec:
- name: http
containerPort: 8000
protocol: TCP
startupProbe:
httpGet:
path: /
port: http
failureThreshold: 30
periodSeconds: 5
livenessProbe:
httpGet:
path: /
Expand Down
25 changes: 7 additions & 18 deletions templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,8 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "plausible-analytics.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
{{- $ingressPath := .Values.ingress.path -}}
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 }}
Expand All @@ -24,6 +19,9 @@ metadata:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.className }}
ingressClassName: {{ .Values.ingress.className | quote }}
{{- end }}
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
Expand All @@ -36,24 +34,15 @@ spec:
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ .host | quote }}
- host: {{ . }}
http:
paths:
{{- range .paths }}
- path: {{ . }}
{{ if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion -}}
pathType: ImplementationSpecific
{{- end }}
- path: {{ $ingressPath }}
pathType: Prefix
backend:
{{ if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion -}}
service:
name: {{ $fullName }}
port:
number: {{ $svcPort }}
{{ else -}}
serviceName: {{ $fullName }}
servicePort: {{ $svcPort }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
7 changes: 2 additions & 5 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,8 @@ ingress:
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: chart-example.local
paths:
- path: /
pathType: ImplementationSpecific
hosts: []
path: /
tls: []
# - secretName: chart-example-tls
# hosts:
Expand Down

0 comments on commit 167f87a

Please sign in to comment.