Giter Site home page Giter Site logo

plausible-analytics-helm-chart's Introduction

Plausible Analytics Helm Chart for Kubernetes

Plausible Analytics is a Simple, lightweight privacy-friendly website analytics alternative to Google Analytics.

Artifact HUB

Install Chart

helm repo add 8gears https://8gears.container-registry.com/chartrepo/library
helm repo update

# Helm 3
$ helm install [RELEASE_NAME] 8gears/plausible-analytics

Source Code for this Helm Chart is located at: 8gears/plausible-analytics-helm-chart

View Chart in 8gears Chart Museum: 8gears.container-registry.com/harbor/projects/1/helm-charts/plausible-analytics/versions/0.1.0

Requirements

Before you start make sure you have the following dependencies ready and working:

  • Helm > 3
  • Postgres DB
  • ClickHouse (Recommended Helm Chart -> liwenhe1993/charts)
  • Helmfile (Optional)

Configuration

Plausible specific values. The shown values represent defaults and comments provide a better description if needed.

# Plausible specific values

disableAuth: false # Disables authentication completely, no registration, login will be shown.
disableRegistration: false # Disables registration of new users, keep your admin credentials handy ;)
baseURL: # The hosting url of the server, used for URL generation. In production systems, this should be your ingress host.

adminUser:
  email:  # Admin user's email
  name:   # Display name admin user
  password: # Admin user password

secretKeyBase: "" # Defaults to random 90 characters alphanumeric string if not set

database: # Postgres Database
  enabled: true
  url: # The URL to the Postgres Database Connection String see -> https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING

clickhouse: # Clickhouse Database
  enabled: true
  url: # The URL Connection String to clickhouse DB see -> https://clickhouse.tech/docs/en/interfaces/http/

smtp: # Plausible uses and SMTP server to send transactional emails e.g. account activation, password reset, weekly reports, etc.
  enabled: true # Enable/Disable SMTP functionality
  mailer:
    emailAddress:
    adapter:
  host: # The host address of your smtp server.
  port: # The port of your smtp server.
  username: # The username/email in case SMTP auth is enabled.
  password: # The password in case SMTP auth is enabled.
  ssl:
    enabled: false # If SSL is enabled for SMTP connection
  retries: 2 # Number of retries to make until mailer gives up.

postmark: #Alternatively, you can use Postmark to send transactional emails. In this case, use the following parameters:
  apiKey:

# Google Search Integration
# See: https://docs.plausible.io/self-hosting-configuration#google-search-integration
google:
  clientID: # The Client ID from the Google API Console for your Plausible Analytics project
  clientSecret: # The Client Secret from the Google API Console for your Plausible Analytics project
#Twitter Integration
# https://docs.plausible.io/self-hosting-configuration#twitter-integration
twitter:
  consumer:
    key: # The API key from the Twitter Developer Portal
    secret: # The API key secret from the Twitter Developer Portal
  access:
    token: # The access token you generated in the steps above
    secret: # The access token secret you generated in the steps above

labels: {} # Extra Labels to apply on your k8s deployment
extraEnv: [] # Extra Env Variables that are passed down to plausible 1:1

geolocation: # MaxMind geolocation database#
  enabled: false # Enable/Disable the automated fetch of
  account_id: # Account/User ID from maxmind.com
  license_key: # My License Key from maxmind.com

This Part of the represents the common Kubernetes specific settings.

replicaCount: 1

image:
  repository: plausible/analytics
  pullPolicy: IfNotPresent
  tag: # Overrides the image tag whose. default: is the chart appVersion.

imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""

serviceAccount:
  # Specifies whether a service account should be created
  create: true
  # Annotations to add to the service account
  annotations: {}
  # The name of the service account to use.
  # If not set and create is true, a name is generated using the fullname template
  name: ""

podAnnotations: {}

podSecurityContext: {}
  # fsGroup: 2000

securityContext: {}
  # capabilities:
  #   drop:
  #   - ALL
  # readOnlyRootFilesystem: true
  # runAsNonRoot: true
  # runAsUser: 1000

service:
  type: ClusterIP
  port: 80

ingress:
  enabled: false
  annotations: {}
    # kubernetes.io/ingress.class: nginx
    # kubernetes.io/tls-acme: "true"
  hosts:
    - host: chart-example.local
      paths: []
  tls: []
  #  - secretName: chart-example-tls
  #    hosts:
  #      - chart-example.local

resources: {}
  # We usually recommend not to specify default resources and to leave this as a conscious
  # choice for the user. This also increases chances charts run on environments with little
  # resources, such as Minikube. If you do want to specify resources, uncomment the following
  # lines, adjust them as necessary, and remove the curly braces after 'resources:'.
  # limits:
  #   cpu: 100m
  #   memory: 128Mi
  # requests:
  #   cpu: 100m
  #   memory: 128Mi

autoscaling:
  enabled: false
  minReplicas: 1
  maxReplicas: 100
  targetCPUUtilizationPercentage: 80
  # targetMemoryUtilizationPercentage: 80

nodeSelector: {}

tolerations: []

affinity: {}

Helmfile Example

This repository also contains a complete example using Helmfile.

Helmfile Content

  • Postgres
  • Clickhouse
  • Plausible
helmfile apply

See helmfile.yaml

Chart Deployment

helm repo add  --username='robot$xxxx' --password="xxx" 8gears https://8gears.container-registry.com/chartrepo/library 
helm push --username='robot$helmcli' --password="$PASSWD" . 8gears

plausible-analytics-helm-chart's People

Contributors

alekitto avatar berkerol avatar duxet avatar m00nyone avatar palmexx avatar philband avatar vad1mo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

plausible-analytics-helm-chart's Issues

no matches for kind "Ingress" in version "networking.k8s.io/v1beta1" stikes back

This issue was already addressed in #13
However, in my environment it is not working. For example see DefectDojo/django-DefectDojo#6466
Better way to workaround this issue is to use Has Capabilities feature:

{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1" -}}
"networking.k8s.io/v1"
{{- else if .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" -}}
"networking.k8s.io/v1beta1"
{{- else -}}
"extensions/v1beta1"
{{- end -}}

volume mount geoip not found

Tried to deploy this chart to k8s with geolocation.enabled = false. Still getting the error below:

STDERR:
Error: release plausible failed, and has been uninstalled due to atomic being set: Deployment.apps "plausible-analytics" is invalid: spec.template.spec.containers[0].volumeMounts[1].name: Not found: "geoip"

Guessing theres a missing guard somewhere to prevent this mount when flag is set to false?

Question: what is the minimun required in values.yaml

Wondering because the pod gets stuck in my-analytics-plausible-analytics-5c86d6fb7-j9lqs 0/1 Init:Error 1 25s with the surfaced error of Does not have minimum availability

I changed the resource limits and the cluster node is certainly big enough.

Wondering if my values.yaml is lacking some field causing the container to crash?

I redacted fields i set to false eg twitter stmp google

baseURL: plausible.example.com

adminUser:
  email: [email protected]
  name: test
  password: test

database: # Postgres Database
  enabled: true
  url: postgresql://test:[email protected]

clickhouse: # Clickhouse Database
  enabled: true
# https://github.com/kubernetes/dns/blob/master/docs/specification.md#232---srv-records
  url: _http-port._tcp.clickhouse.clickhouse.svc.cluster.local 

# Default form Helm Generator

resources:
  limits:
    cpu: 200m
    memory: 400Mi
  requests:
    cpu: 100m
    memory: 128Mi

Noticed the helmfile.yaml

helmfile apply but it erroed with in ./helmfile.yaml: error during helmfile.yaml.part.0 parsing: template: stringTemplate:25:35: executing "stringTemplate" at <.Values.analytics_domain>: map has no entry for key "analytics_domain"

Does the helmfile remove the need for the helm install approach?

How to install latest version (helmfile)

Changing the tag to "latest" seem to not be compatible with this chartfile. When I go here I can't find any viable tags.

I updated the helmfile to say:

    values:
      - baseURL: "https://{{ .Values.analytics_domain }}"
      - disableAuth: false
      - disableRegistration: false
      - image:
          tag: "latest"

But the init pod log is throwing a missing base url error.

{"init terminating in do_boot",{#{'__exception__'=>true,'__struct__'=>'Elixir.RuntimeError',message=><<"BASE_URL configuration option is required.

If I remove the tag line, it works but installs an older version.

Not able to view data retrived from database in IST timezone.

Graph mapping is not according to the timezone which is selected in graph's setting >> Timezone.
Selecting timezone (GMT +5:30) Chennai, Kolkata, Mumbai, Delhi.
Resulting behavior:
The graph plotted at IST -5:30
Expected behavior:
The graph should be plotted at the above selected timezone.

Could someone help me understand why is this happening and also what is the exact flow/calls made in plausible. How plausible communicates with postgres and clickhouse databases.

For now we have made changes in clickhouse database to store data in 00:00 GMT and in plausible selected +5:30 GMT Now it shows correct plotting.

Cannot enable google and twitter integration without smtp

Hi @8gears and thank you for your work.

While configuring google integration I found that is impossible to enable google and twitter integration if smtp.enabled is falsy. Additionally, this prevents the new pods to start as the associated keys are not found in the secret.

This is due to an incorrectly positioned end tag for this if which is closed on L69 instead of L51.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.