Skip to content

Commit

Permalink
feat: onboard umami (#792)
Browse files Browse the repository at this point in the history
* fix/fix-dagster

* fix: fix pr comment

* feat: onboard umami

* feat: upgrade umami to latest version (v2)
  • Loading branch information
walkoss authored Aug 10, 2023
1 parent 4395493 commit 763b1b6
Show file tree
Hide file tree
Showing 32 changed files with 460 additions and 0 deletions.
6 changes: 6 additions & 0 deletions umami/Pluralfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
REPO umami
ATTRIBUTES Plural repository.yaml

TF terraform/*
HELM helm/*
RECIPE plural/recipes/*
23 changes: 23 additions & 0 deletions umami/helm/umami/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
9 changes: 9 additions & 0 deletions umami/helm/umami/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
dependencies:
- name: umami
repository: https://christianknell.github.io/helm-charts
version: 1.14.0
- name: postgres
repository: https://pluralsh.github.io/module-library
version: 0.1.5
digest: sha256:e7efcaf3f2611252330a76bf731458913b17c028512f00f6111b2e0d40bd69b8
generated: "2023-07-29T20:47:45.966701+02:00"
13 changes: 13 additions & 0 deletions umami/helm/umami/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v2
name: umami
description: helm chart for umami
type: application
version: 0.1.0
appVersion: 2.4.1
dependencies:
- name: umami
version: 1.14.0
repository: https://christianknell.github.io/helm-charts
- name: postgres
version: 0.1.5
repository: https://pluralsh.github.io/module-library
1 change: 1 addition & 0 deletions umami/helm/umami/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
A helm chart for umami
Binary file added umami/helm/umami/charts/postgres-0.1.5.tgz
Binary file not shown.
Binary file added umami/helm/umami/charts/umami-1.14.0.tgz
Binary file not shown.
34 changes: 34 additions & 0 deletions umami/helm/umami/deps.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
apiVersion: plural.sh/v1alpha1
kind: Dependencies
metadata:
application: true
description: Deploys umami crafted for the target cloud
spec:
dependencies:
- type: helm
name: bootstrap
repo: bootstrap
version: '>= 0.5.1'
- type: helm
name: ingress-nginx
repo: ingress-nginx
version: ">= 0.1.2"
- type: helm
name: postgres
repo: postgres
version: ">= 0.1.6"
- type: terraform
name: aws
repo: umami
version: '>= 0.1.0'
optional: true
- type: terraform
name: azure
repo: umami
version: '>= 0.1.0'
optional: true
- type: terraform
name: gcp
repo: umami
version: '>= 0.1.0'
optional: true
66 changes: 66 additions & 0 deletions umami/helm/umami/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "umami-plural.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 "umami-plural.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 "umami-plural.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

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

{{/*
Selector labels
*/}}
{{- define "umami-plural.selectorLabels" -}}
app.kubernetes.io/name: {{ include "umami-plural.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "umami-plural.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "umami-plural.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{- define "umami-plural.secretName" -}}
{{- printf "%s-secret" (include "umami-plural.fullname" .) }}
{{- end }}
18 changes: 18 additions & 0 deletions umami/helm/umami/templates/postgres-secrets.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: v1
kind: Secret
metadata:
name: umami.plural-postgres-umami.credentials.postgresql.acid.zalan.do
labels:
{{ include "umami-plural.labels" . | indent 4 }}
stringData:
username: umami
password: {{ .Values.postgres.password }}
---
apiVersion: v1
kind: Secret
metadata:
name: umami-postgres-dsn
labels:
{{ include "umami-plural.labels" . | indent 4 }}
stringData:
dsn: {{ .Values.postgres.dsn }}
34 changes: 34 additions & 0 deletions umami/helm/umami/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
postgres:
team: plural
user: umami
dbName: umami
ownerChart: umami
infix: '-postgres'
password: REPLACE_ME

umami:
image:
repository: dkr.plural.sh/umami/umami-software/umami
tag: "postgresql-v2.4.1"

postgresql:
enabled: false

database:
existingSecret: umami-postgres-dsn
databaseUrlKey: dsn

ingress:
enabled: true
className: "nginx"
annotations:
kubernetes.io/tls-acme: "true"
cert-manager.io/cluster-issuer: letsencrypt-prod

umami:
removeDisableLoginEnv: true
disableLogin: "0"

extraEnv:
- name: "DISABLE_BOT_CHECK"
value: "0"
32 changes: 32 additions & 0 deletions umami/helm/umami/values.yaml.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{ $hostname := default "example.com" .Values.hostname }}

{{ $umamiPgPwd := dedupe . "umami.postgres.password" (randAlphaNum 20) }}
{{ $umamiPgDsn := default (printf "postgresql://umami:%s@plural-postgres-umami:5432/umami?sslmode=allow" $umamiPgPwd) .Values.umamiDsn }}

{{ $hashSalt := dedupe . "umami.umami.umami.hash.salt" (randAlphaNum 20) }}

global:
application:
links:
- description: umami web ui
url: {{ $hostname }}

postgres:
password: {{ $umamiPgPwd }}
dsn: {{ $umamiPgDsn }}

umami:
ingress:
hosts:
- host: {{ $hostname }}
paths:
- path: '/'
pathType: ImplementationSpecific
tls:
- secretName: umami-tls
hosts:
- {{ $hostname }}
umami:
hostname: {{ $hostname }}
hash:
salt: {{ $hashSalt }}
14 changes: 14 additions & 0 deletions umami/plural/docs/bring-your-own-postgres.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Bring Your Own Postgres DB

Some users might prefer to use and external or managed postgres instance rather than an on-cluster one. In that case, only a small reconfiguration is required, in `umami/helm/umami/values.yaml` overlay the following:

```yaml
umami:
postgres:
enabled: false # if you'd like to remove the existing db
dsn: 'postgresql://<user>:<password>@<host>:<port>/<db>'
```
You can use any valid postgres connection string, and might need to tweak sslmode and so forth to get the exact correct value. This file will be encrypted, so no worries about secret exposure as well.
Once that reconfiguration has been made, simply run: `plural build --only umami && plural deploy --commit "redeploy umami"` to apply the changes on your cluster.
Binary file added umami/plural/icons/umami.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions umami/plural/notes.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Your umami installation is available at https://{{ .Values.hostname }}

Your initial admin credentials are:
user: admin
password: umami

We recommend to change it at https://{{ .Values.hostname }}/settings/profile
22 changes: 22 additions & 0 deletions umami/plural/recipes/umami-aws.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: umami-aws
description: Installs umami on an aws eks cluster
provider: AWS
primary: true
dependencies:
- repo: bootstrap
name: aws-k8s
- repo: ingress-nginx
name: ingress-nginx-aws
- repo: postgres
name: aws-postgres
sections:
- name: umami
configuration:
- name: hostname
documentation: FQDN to use for your umami installation
type: DOMAIN
items:
- type: TERRAFORM
name: aws
- type: HELM
name: umami
22 changes: 22 additions & 0 deletions umami/plural/recipes/umami-azure.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: umami-azure
description: Installs umami on an azure aks cluster
provider: AZURE
primary: true
dependencies:
- repo: bootstrap
name: azure-k8s
- repo: ingress-nginx
name: ingress-nginx-azure
- repo: postgres
name: azure-postgres
sections:
- name: umami
configuration:
- name: hostname
documentation: FQDN to use for your umami installation
type: DOMAIN
items:
- type: TERRAFORM
name: azure
- type: HELM
name: umami
22 changes: 22 additions & 0 deletions umami/plural/recipes/umami-gcp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: umami-gcp
description: Installs umami on an gcp gke cluster
provider: GCP
primary: true
dependencies:
- repo: bootstrap
name: gcp-k8s
- repo: ingress-nginx
name: ingress-nginx-gcp
- repo: postgres
name: gcp-postgres
sections:
- name: umami
configuration:
- name: hostname
documentation: FQDN to use for your umami installation
type: DOMAIN
items:
- type: TERRAFORM
name: gcp
- type: HELM
name: umami
12 changes: 12 additions & 0 deletions umami/repository.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: umami
description: Umami is a simple, fast, privacy-focused alternative to Google Analytics.
category: PRODUCTIVITY
private: true
releaseStatus: ALPHA
icon: plural/icons/umami.png
notes: plural/notes.tpl
docs: plural/docs
homepage: https://umami.is/
gitUrl: https://github.com/umami-software/umami
contributors:
- walkoss@pm.me
13 changes: 13 additions & 0 deletions umami/terraform/aws/deps.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: plural.sh/v1alpha1
kind: Dependencies
metadata:
description: umami aws setup
version: 0.1.0
spec:
dependencies:
- name: aws-bootstrap
repo: bootstrap
type: terraform
version: '>= 0.1.1'
providers:
- aws
Loading

0 comments on commit 763b1b6

Please sign in to comment.