countly

by christianhuth

Helm chartv6.1.2App 25.05.4Verified publisher

Countly is a product analytics platform that helps teams track, analyze and act-on their user actions and behaviour on mobile, web and desktop applications.

About this chart

countly

Countly is a product analytics platform that helps teams track, analyze and act-on their user actions and behaviour on mobile, web and desktop applications.

TL;DR;

helm repo add christianhuth https://charts.christianhuth.de
helm repo update
helm install my-release christianhuth/countly

Or install it from the OCI registry:

helm install my-release oci://ghcr.io/christianhuth/helm-charts/countly

Introduction

This chart bootstraps the product analytics platform Countly with its API and frontend on a Kubernetes cluster using the Helm package manager.

Prerequisites

Installing the MongoDB Controllers for Kubernetes

The chart bundles MongoDB as a replica set managed by the operator (via the chart mongodb-community). The operator itself is not part of this chart, as it is installed once per Kubernetes cluster. By default it only watches its own namespace, so set operator.watchNamespace to * or to a comma-separated list of namespaces:

helm repo add mongodb https://mongodb.github.io/helm-charts
helm repo update
helm upgrade --install mongodb-kubernetes mongodb/mongodb-kubernetes --namespace mongodb-operator --create-namespace --set operator.watchNamespace="*" --wait

Installing the Chart

To install the chart with the release name my-release:

helm repo add christianhuth https://charts.christianhuth.de
helm repo update
helm install my-release christianhuth/countly

The chart is also published as an OCI artifact which can be installed like this:

helm install my-release oci://ghcr.io/christianhuth/helm-charts/countly

These commands deploy Countly on the Kubernetes cluster in the default configuration. The Values section lists the values that can be configured during installation. On the first visit of the frontend, Countly asks to create the first admin user.

Tip: List all releases using helm list

Uninstalling the Chart

To uninstall the my-release deployment:

helm uninstall my-release

The command removes all the Kubernetes components associated with the chart and deletes the release.

Configuring MongoDB

Countly stores its data in the databases countly, countly_drill, countly_fs and countly_out.

Bundled Replica Set

mongodb.mongodb is the spec of the MongoDBCommunity resource, see the chart mongodb-community for all options. Countly connects with the first user in mongodb.mongodb.users, whose password is generated if it has no passwordSecretRef. To use an existing Secret instead, repeat the user with the reference:

kubectl create secret generic countly-mongodb --from-literal=password='<password>'
mongodb:
  mongodb:
    users:
      - name: countly
        db: admin
        passwordSecretRef:
          name: countly-mongodb
          key: password
        roles:
          - {name: readWrite, db: countly}
          - {name: readWrite, db: countly_drill}
          - {name: readWrite, db: countly_fs}
          - {name: readWrite, db: countly_out}
          - {name: clusterMonitor, db: admin}

By default the replica set has 3 members.

External MongoDB

mongodb:
  enabled: false

externalMongodb:
  hostname: mongodb.example.com
  port: 27017
  replicaSet: rs0
  username: countly
  existingSecret: countly-mongodb
  existingSecretPasswordKey: password
  options:
    authSource: admin

Instead of externalMongodb.existingSecret you can set externalMongodb.password, which lets the chart create the Secret. Without externalMongodb.username, Countly connects without authentication.

Values

KeyTypeDefaultDescription
api.affinityobject{}Affinity settings for pod assignment
api.autoscaling.enabledboolfalseEnable Horizontal POD autoscaling
api.autoscaling.maxReplicasint100Maximum number of replicas
api.autoscaling.minReplicasint1Minimum number of replicas
api.autoscaling.targetCPUUtilizationPercentageint80Target CPU utilization percentage
api.autoscaling.targetMemoryUtilizationPercentageint80Target Memory utilization percentage
api.deploymentStrategyobject{}Update strategy for the API deployment
api.extraEnvlist[]additional environment variables to be added to the api pods
api.image.pullPolicystring"Always"image pull policy
api.image.registrystring"docker.io"image registry
api.image.repositorystring"countly/api"image repository
api.image.tagstring"25.05.4"Overrides the image tag
api.imagePullSecretslist[]If defined, uses a Secret to pull an image from a private Docker registry or repository.
api.livenessProbe.failureThresholdint6Failure threshold for livenessProbe
api.livenessProbe.initialDelaySecondsint60Initial delay seconds for livenessProbe
api.livenessProbe.periodSecondsint30Period seconds for livenessProbe
api.livenessProbe.successThresholdint1Success threshold for livenessProbe
api.livenessProbe.timeoutSecondsint2Timeout in seconds for livenessProbe
api.nodeSelectorobject{}Node labels for pod assignment
api.podAnnotationsobject{}Annotations to be added to the frontend pods
api.podSecurityContextobject{}pod-level security context
api.priorityClassNamestring""Pod priority class name
api.readinessProbe.failureThresholdint6Failure threshold for readinessProbe
api.readinessProbe.initialDelaySecondsint60Initial delay seconds for readinessProbe
api.readinessProbe.periodSecondsint30Period seconds for readinessProbe
api.readinessProbe.successThresholdint1Success threshold for readinessProbe
api.readinessProbe.timeoutSecondsint2Timeout in seconds for readinessProbe
api.replicaCountint1Number of replicas
api.resourcesobjectsee values.yamlResource limits and requests for the controller pods.
api.revisionHistoryLimitint10The number of old ReplicaSets to retain
api.route.main.additionalRuleslist[]Additional custom rules that can be added to the route
api.route.main.annotationsobject{}Add annotations to the route
api.route.main.apiVersionstring"gateway.networking.k8s.io/v1"Set the route apiVersion, e.g. gateway.networking.k8s.io/v1 or gateway.networking.k8s.io/v1alpha2
api.route.main.enabledboolfalseEnables or disables the route
api.route.main.filterslist[]Filters define the filters that are applied to requests that match this rule.
api.route.main.hostnameslist[]Hostnames to be matched
api.route.main.httpsRedirectboolfalseadds a filter for redirecting to https (HTTP 301 Moved Permanently). To redirect HTTP traffic to HTTPS, you need to have a Gateway with both HTTP and HTTPS listeners. Matches and filters do not take effect if enabled. Ref. https://gateway-api.sigs.k8s.io/guides/http-redirect-rewrite/
api.route.main.kindstring"HTTPRoute"Set the route kind Valid options are GRPCRoute, HTTPRoute, TCPRoute, TLSRoute, UDPRoute
api.route.main.labelsobject{}Add labels to the route
api.route.main.matcheslistsee values.yamldefine conditions used for matching the rule against incoming HTTP requests.
api.route.main.parentRefslist[]Parent references (Gateway)
api.route.main.timeoutsobject{}defines the timeouts that can be configured for an HTTP request
api.securityContextobject{}container-level security context
api.selectorLabelsobject{}Additional labels to add to the pod
api.service.portint3000Kubernetes port where service is exposed
api.service.typestring"ClusterIP"Kubernetes service type
api.serviceAccount.annotationsobject{}Annotations to add to the service account
api.serviceAccount.createbooltrueSpecifies whether a service account should be created
api.serviceAccount.namestring""The name of the service account to use. If not set and create is true, a name is generated using the fullname template
api.tolerationslist[]Toleration labels for pod assignment
config.api.mail.auth.existingSecretstring""Use existing secret for password details. The secret has to contain the key mail-password. When it's set the config.api.mail.auth.password is ignored.
config.api.mail.auth.passwordstring""The password to authenticate to the smtp host when sending emails.
config.api.mail.auth.usernamestring""The username to authenticate to the smtp host when sending emails.
config.api.mail.enabledboolfalseEnable sending of emails
config.api.mail.fromstring""The email address Countly will send emails from.
config.api.mail.hoststring""The host of the external SMTP server that Countly should use to send emails.
config.api.mail.portint0The port used to connect to the smtp host.
externalMongodb.databasestring"countly"Name of the database. Countly stores further data in the databases countly_drill, countly_fs and countly_out.
externalMongodb.existingSecretstring""Name of an existing Secret containing the password of the user
externalMongodb.existingSecretPasswordKeystring"password"Key in the existing Secret containing the password
externalMongodb.hostnamestring""Hostname of the external MongoDB server or of a member of its replica set
externalMongodb.optionsobject{}Additional options of the MongoDB driver, e.g. authSource: admin or tls: true
externalMongodb.passwordstring""Password of the user. Ignored if externalMongodb.existingSecret is set.
externalMongodb.portint27017Port of the external MongoDB server
externalMongodb.replicaSetstring""Name of the replica set of the external MongoDB server, if any
externalMongodb.usernamestring""Username to connect with. Leave empty if the server does not require authentication.
extraEnvlist[]additional environment variables to be added to both api and frontend pods
frontend.affinityobject{}Affinity settings for pod assignment
frontend.autoscaling.enabledboolfalseEnable Horizontal POD autoscaling
frontend.autoscaling.maxReplicasint100Maximum number of replicas
frontend.autoscaling.minReplicasint1Minimum number of replicas
frontend.autoscaling.targetCPUUtilizationPercentageint80Target CPU utilization percentage
frontend.autoscaling.targetMemoryUtilizationPercentageint80Target Memory utilization percentage
frontend.deploymentStrategyobject{}Update strategy for the frontend deployment
frontend.extraEnvlist[]additional environment variables to be added to the frontend pods
frontend.image.pullPolicystring"Always"image pull policy
frontend.image.registrystring"docker.io"image registry
frontend.image.repositorystring"countly/frontend"image repository
frontend.image.tagstring"25.05.4"Overrides the image tag
frontend.imagePullSecretslist[]If defined, uses a Secret to pull an image from a private Docker registry or repository.
frontend.livenessProbe.failureThresholdint6Failure threshold for livenessProbe
frontend.livenessProbe.initialDelaySecondsint60Initial delay seconds for livenessProbe
frontend.livenessProbe.periodSecondsint30Period seconds for livenessProbe
frontend.livenessProbe.successThresholdint1Success threshold for livenessProbe
frontend.livenessProbe.timeoutSecondsint2Timeout in seconds for livenessProbe
frontend.nodeSelectorobject{}Node labels for pod assignment
frontend.podAnnotationsobject{}Annotations to be added to the frontend pods
frontend.podSecurityContextobject{}pod-level security context
frontend.priorityClassNamestring""Pod priority class name
frontend.readinessProbe.failureThresholdint6Failure threshold for readinessProbe
frontend.readinessProbe.initialDelaySecondsint60Initial delay seconds for readinessProbe
frontend.readinessProbe.periodSecondsint30Period seconds for readinessProbe
frontend.readinessProbe.successThresholdint1Success threshold for readinessProbe
frontend.readinessProbe.timeoutSecondsint2Timeout in seconds for readinessProbe
frontend.replicaCountint1Number of replicas
frontend.resourcesobjectsee values.yamlResource limits and requests for the controller pods.
frontend.revisionHistoryLimitint10The number of old ReplicaSets to retain
frontend.route.main.additionalRuleslist[]Additional custom rules that can be added to the route
frontend.route.main.annotationsobject{}Add annotations to the route
frontend.route.main.apiVersionstring"gateway.networking.k8s.io/v1"Set the route apiVersion, e.g. gate

Deploy countly with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has countly on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartcountly is pinned at v6.1.2 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply