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.
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
- Kubernetes 1.26+
- The MongoDB Controllers for Kubernetes if the bundled MongoDB is used (
mongodb.enabled: true, the default)
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
| Key | Type | Default | Description |
|---|---|---|---|
| api.affinity | object | {} | Affinity settings for pod assignment |
| api.autoscaling.enabled | bool | false | Enable Horizontal POD autoscaling |
| api.autoscaling.maxReplicas | int | 100 | Maximum number of replicas |
| api.autoscaling.minReplicas | int | 1 | Minimum number of replicas |
| api.autoscaling.targetCPUUtilizationPercentage | int | 80 | Target CPU utilization percentage |
| api.autoscaling.targetMemoryUtilizationPercentage | int | 80 | Target Memory utilization percentage |
| api.deploymentStrategy | object | {} | Update strategy for the API deployment |
| api.extraEnv | list | [] | additional environment variables to be added to the api pods |
| api.image.pullPolicy | string | "Always" | image pull policy |
| api.image.registry | string | "docker.io" | image registry |
| api.image.repository | string | "countly/api" | image repository |
| api.image.tag | string | "25.05.4" | Overrides the image tag |
| api.imagePullSecrets | list | [] | If defined, uses a Secret to pull an image from a private Docker registry or repository. |
| api.livenessProbe.failureThreshold | int | 6 | Failure threshold for livenessProbe |
| api.livenessProbe.initialDelaySeconds | int | 60 | Initial delay seconds for livenessProbe |
| api.livenessProbe.periodSeconds | int | 30 | Period seconds for livenessProbe |
| api.livenessProbe.successThreshold | int | 1 | Success threshold for livenessProbe |
| api.livenessProbe.timeoutSeconds | int | 2 | Timeout in seconds for livenessProbe |
| api.nodeSelector | object | {} | Node labels for pod assignment |
| api.podAnnotations | object | {} | Annotations to be added to the frontend pods |
| api.podSecurityContext | object | {} | pod-level security context |
| api.priorityClassName | string | "" | Pod priority class name |
| api.readinessProbe.failureThreshold | int | 6 | Failure threshold for readinessProbe |
| api.readinessProbe.initialDelaySeconds | int | 60 | Initial delay seconds for readinessProbe |
| api.readinessProbe.periodSeconds | int | 30 | Period seconds for readinessProbe |
| api.readinessProbe.successThreshold | int | 1 | Success threshold for readinessProbe |
| api.readinessProbe.timeoutSeconds | int | 2 | Timeout in seconds for readinessProbe |
| api.replicaCount | int | 1 | Number of replicas |
| api.resources | object | see values.yaml | Resource limits and requests for the controller pods. |
| api.revisionHistoryLimit | int | 10 | The number of old ReplicaSets to retain |
| api.route.main.additionalRules | list | [] | Additional custom rules that can be added to the route |
| api.route.main.annotations | object | {} | Add annotations to the route |
| api.route.main.apiVersion | string | "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.enabled | bool | false | Enables or disables the route |
| api.route.main.filters | list | [] | Filters define the filters that are applied to requests that match this rule. |
| api.route.main.hostnames | list | [] | Hostnames to be matched |
| api.route.main.httpsRedirect | bool | false | adds 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.kind | string | "HTTPRoute" | Set the route kind Valid options are GRPCRoute, HTTPRoute, TCPRoute, TLSRoute, UDPRoute |
| api.route.main.labels | object | {} | Add labels to the route |
| api.route.main.matches | list | see values.yaml | define conditions used for matching the rule against incoming HTTP requests. |
| api.route.main.parentRefs | list | [] | Parent references (Gateway) |
| api.route.main.timeouts | object | {} | defines the timeouts that can be configured for an HTTP request |
| api.securityContext | object | {} | container-level security context |
| api.selectorLabels | object | {} | Additional labels to add to the pod |
| api.service.port | int | 3000 | Kubernetes port where service is exposed |
| api.service.type | string | "ClusterIP" | Kubernetes service type |
| api.serviceAccount.annotations | object | {} | Annotations to add to the service account |
| api.serviceAccount.create | bool | true | Specifies whether a service account should be created |
| api.serviceAccount.name | string | "" | The name of the service account to use. If not set and create is true, a name is generated using the fullname template |
| api.tolerations | list | [] | Toleration labels for pod assignment |
| config.api.mail.auth.existingSecret | string | "" | 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.password | string | "" | The password to authenticate to the smtp host when sending emails. |
| config.api.mail.auth.username | string | "" | The username to authenticate to the smtp host when sending emails. |
| config.api.mail.enabled | bool | false | Enable sending of emails |
| config.api.mail.from | string | "" | The email address Countly will send emails from. |
| config.api.mail.host | string | "" | The host of the external SMTP server that Countly should use to send emails. |
| config.api.mail.port | int | 0 | The port used to connect to the smtp host. |
| externalMongodb.database | string | "countly" | Name of the database. Countly stores further data in the databases countly_drill, countly_fs and countly_out. |
| externalMongodb.existingSecret | string | "" | Name of an existing Secret containing the password of the user |
| externalMongodb.existingSecretPasswordKey | string | "password" | Key in the existing Secret containing the password |
| externalMongodb.hostname | string | "" | Hostname of the external MongoDB server or of a member of its replica set |
| externalMongodb.options | object | {} | Additional options of the MongoDB driver, e.g. authSource: admin or tls: true |
| externalMongodb.password | string | "" | Password of the user. Ignored if externalMongodb.existingSecret is set. |
| externalMongodb.port | int | 27017 | Port of the external MongoDB server |
| externalMongodb.replicaSet | string | "" | Name of the replica set of the external MongoDB server, if any |
| externalMongodb.username | string | "" | Username to connect with. Leave empty if the server does not require authentication. |
| extraEnv | list | [] | additional environment variables to be added to both api and frontend pods |
| frontend.affinity | object | {} | Affinity settings for pod assignment |
| frontend.autoscaling.enabled | bool | false | Enable Horizontal POD autoscaling |
| frontend.autoscaling.maxReplicas | int | 100 | Maximum number of replicas |
| frontend.autoscaling.minReplicas | int | 1 | Minimum number of replicas |
| frontend.autoscaling.targetCPUUtilizationPercentage | int | 80 | Target CPU utilization percentage |
| frontend.autoscaling.targetMemoryUtilizationPercentage | int | 80 | Target Memory utilization percentage |
| frontend.deploymentStrategy | object | {} | Update strategy for the frontend deployment |
| frontend.extraEnv | list | [] | additional environment variables to be added to the frontend pods |
| frontend.image.pullPolicy | string | "Always" | image pull policy |
| frontend.image.registry | string | "docker.io" | image registry |
| frontend.image.repository | string | "countly/frontend" | image repository |
| frontend.image.tag | string | "25.05.4" | Overrides the image tag |
| frontend.imagePullSecrets | list | [] | If defined, uses a Secret to pull an image from a private Docker registry or repository. |
| frontend.livenessProbe.failureThreshold | int | 6 | Failure threshold for livenessProbe |
| frontend.livenessProbe.initialDelaySeconds | int | 60 | Initial delay seconds for livenessProbe |
| frontend.livenessProbe.periodSeconds | int | 30 | Period seconds for livenessProbe |
| frontend.livenessProbe.successThreshold | int | 1 | Success threshold for livenessProbe |
| frontend.livenessProbe.timeoutSeconds | int | 2 | Timeout in seconds for livenessProbe |
| frontend.nodeSelector | object | {} | Node labels for pod assignment |
| frontend.podAnnotations | object | {} | Annotations to be added to the frontend pods |
| frontend.podSecurityContext | object | {} | pod-level security context |
| frontend.priorityClassName | string | "" | Pod priority class name |
| frontend.readinessProbe.failureThreshold | int | 6 | Failure threshold for readinessProbe |
| frontend.readinessProbe.initialDelaySeconds | int | 60 | Initial delay seconds for readinessProbe |
| frontend.readinessProbe.periodSeconds | int | 30 | Period seconds for readinessProbe |
| frontend.readinessProbe.successThreshold | int | 1 | Success threshold for readinessProbe |
| frontend.readinessProbe.timeoutSeconds | int | 2 | Timeout in seconds for readinessProbe |
| frontend.replicaCount | int | 1 | Number of replicas |
| frontend.resources | object | see values.yaml | Resource limits and requests for the controller pods. |
| frontend.revisionHistoryLimit | int | 10 | The number of old ReplicaSets to retain |
| frontend.route.main.additionalRules | list | [] | Additional custom rules that can be added to the route |
| frontend.route.main.annotations | object | {} | Add annotations to the route |
| frontend.route.main.apiVersion | string | "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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartcountly is pinned at v6.1.2 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- 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