Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support DATABASE_CACERTFILE #22

Merged
merged 3 commits into from
Nov 18, 2024
Merged
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
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.3.2
version: 0.3.3
appVersion: 2.1.1
keywords:
- web analytics
Expand Down
27 changes: 26 additions & 1 deletion templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,21 @@ spec:
serviceAccountName: {{ include "plausible-analytics.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
{{- if .Values.plausibleInitContainers.enabled }}
volumes:
{{- if .Values.plausibleInitContainers.enabled }}
- name: scripts-volume
configMap:
name: {{ include "plausible-analytics.fullname" . }}
{{- end }}
{{- if .Values.databaseCA }}
- name: database-ca
secret:
secretName: {{ include "plausible-analytics.secretName" . }}
items:
- key: DATABASE_CA
path: database-ca.pem
{{- end }}
{{- if .Values.plausibleInitContainers.enabled }}
initContainers:
- name: wait-for-postgres
image: "{{ .Values.plausibleInitContainers.postgresql.image.repository }}:{{ .Values.plausibleInitContainers.postgresql.image.tag | default "latest" }}"
Expand Down Expand Up @@ -71,6 +81,11 @@ spec:
volumeMounts:
- name: scripts-volume
mountPath: /scripts
{{- if .Values.databaseCA }}
- name: database-ca
mountPath: /etc/ssl/certs/plausible/
readOnly: true
{{- end }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
Expand All @@ -83,6 +98,12 @@ spec:
- -x
- -c
- /entrypoint.sh db createdb && /entrypoint.sh db migrate && /entrypoint.sh run
volumeMounts:
{{- if .Values.databaseCA }}
- name: database-ca
mountPath: /etc/ssl/certs/plausible/
readOnly: true
{{- end }}
env:
{{- if .Values.baseURL }}
- name: BASE_URL
Expand Down Expand Up @@ -115,6 +136,10 @@ spec:
secretKeyRef:
key: DATABASE_URL
name: {{ include "plausible-analytics.secretName" . }}
{{- if .Values.databaseCA }}
- name: DATABASE_CACERTFILE
value: /etc/ssl/certs/plausible/database-ca.pem
{{- end }}
- name: CLICKHOUSE_DATABASE_URL
valueFrom:
secretKeyRef:
Expand Down
3 changes: 3 additions & 0 deletions templates/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,7 @@ data:
GOOGLE_CLIENT_SECRET: {{ .Values.google.clientSecret | toString | b64enc }}
{{- end }}
{{- end }}
{{- if .Values.databaseCA }}
DATABASE_CA: {{ .Values.databaseCA | toString | b64enc }}
{{- end }}
{{- end }}
6 changes: 4 additions & 2 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ logFailedLoginAttempts: false # Controls whether to log warnings about failed l

### The URL to the Postgres Database Connection String see -> https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING
databaseURL: "postgres://postgres:postgres@plausible-analytics-postgresql:5432/plausible_db"
### CA certificate for the database connection in PEM format. If not provided, the database connection will not use SSL.
databaseCA: null

### The URL Connection String to clickhouse DB see -> https://clickhouse.tech/docs/en/interfaces/http/
clickhouseDatabaseURL: "http://clickhouse:password@plausible-analytics-clickhouse:8123/plausible_events_db"
Expand Down Expand Up @@ -143,10 +145,10 @@ clickhouse:
replicaCount: 1

image:
repository: plausible/community-edition
repository: ghcr.io/plausible/community-edition
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: "v2.1.1"
tag: "v2.1.4"

imagePullSecrets: []
nameOverride: ""
Expand Down