Self-hosting
Install Leantime on Kubernetes
- Self-hosted only
- Checked with Leantime 3.15
At a glance
You need
- A Kubernetes cluster with a default storage class
- Helm 3 or later, and kubectl set up to reach the cluster
Where you'll work
- A terminal where
helmandkubectlcan reach your cluster
At the end
Leantime and its MariaDB database running in your cluster, with volumes for uploaded files, from the chart in Leantime's repository.
Leantime’s repository includes a Helm chart in its helm folder. It runs one Leantime pod and its own MariaDB database, with volumes for uploaded files. It isn’t published in a Helm repository, so you install it from a copy of the repository.
The steps below were tested with Leantime 3.15.3 on a local Kubernetes cluster; the chart is the same in 3.17.0. If you don’t need Kubernetes, Docker Compose is simpler and covers more settings.
Before you start
Section titled “Before you start”- A Kubernetes cluster with a default storage class, and
kubectlset up to reach it. - Helm 3 or later.
git, to get the chart.- For your own domain: an ingress controller, like ingress-nginx, and a way to get a certificate.
How do I install Leantime with Helm?
Section titled “How do I install Leantime with Helm?”-
Get the chart from the latest release (3.17.0 in this example):
Terminal window git clone --depth 1 --branch v3.17.0 https://github.com/Leantime/leantime -
Get the chart’s MariaDB dependency. It comes from Bitnami’s Helm repository, so add that first:
Terminal window helm repo add bitnami https://charts.bitnami.com/bitnamihelm dependency build ./leantime/helm -
Write your settings in a file called
values.yaml, next to theleantimefolder. Replace every value in angle brackets:image:tag: "3.17.0" # the Leantime version; don't use "latest"app:url: "https://projects.example.com"session:password: "<long random value>" # openssl rand -base64 32mariadb:auth:rootPassword: "<database root password>"password: "<database password>"The chart’s defaults are public
changemepasswords, so replace all three.app.session.passwordis Leantime’s secret key. Keepvalues.yamlprivate: the passwords are stored in it as plain text. -
Install it:
Terminal window helm install leantime -f values.yaml ./leantime/helm -
Wait for both pods to show
Runningand1/1. The first start takes a minute or two:Terminal window kubectl get pods -
Open the installer. Set up your domain as described in How do I use my own domain?, and open it in your browser. Enter your email address, name and company name and click Install, then set your password and click through the welcome steps.
The service is named after the release: leantime here. With another release name, the service name can differ, so check it with kubectl get svc.
How do I use my own domain?
Section titled “How do I use my own domain?”Turn on the chart’s ingress in values.yaml, with your domain and your ingress controller’s class:
ingress: enabled: true className: "nginx" annotations: cert-manager.io/cluster-issuer: "letsencrypt" # if you use cert-manager hosts: - host: projects.example.com paths: - path: / pathType: Prefix tls: - secretName: leantime-tls hosts: - projects.example.comSet app.url to the same https:// address, and apply it with helm upgrade leantime -f values.yaml ./leantime/helm. Leantime trusts proxies on private networks, which usually includes an ingress controller inside the cluster, so you don’t need app.trustedProxies unless a public CDN like Cloudflare sits in front (see Run Leantime behind a reverse proxy).
Which settings can I change?
Section titled “Which settings can I change?”The chart passes these groups of settings to Leantime. The chart’s README lists every key.
| Values | What they set |
|---|---|
image.tag |
The Leantime version |
app.url, app.trustedProxies, app.leanSessionSecure |
Your address and HTTPS (see Run Leantime behind a reverse proxy) |
app.session.password, app.session.expiration |
The secret key, and the minutes without activity before sign-out (default 480, 8 hours) |
app.sitename, app.language, app.defaultTimezone |
Name, default language and time zone |
app.email.* |
Sending email through SMTP (see Email configuration) |
app.s3.* |
Storing files in S3 (see Configuration) |
app.ldap.* |
Signing in with LDAP (see Authentication) |
persistence.size |
The size of each file volume (default 5 GB) |
mariadb.auth.* |
The database passwords |
Other settings, like OpenID Connect, Redis or the sign-in limits, can’t be set through the chart in 3.16.
What can’t the chart do yet?
Section titled “What can’t the chart do yet?”-
Run more than one pod. Keep
replicaCount: 1and leaveautoscalingoff. Sign-ins are kept inside each pod, the file volumes can only be attached to one node (ReadWriteOnce), and every pod runs Leantime’s scheduled jobs. -
Keep plugins. The plugins folder isn’t on a volume, so plugins you install in My Apps are gone when the pod restarts. Their data in the database stays.
-
Use your own database. The chart always runs its own MariaDB 10.6, from Bitnami’s archived
bitnamilegacyimages, and Leantime always connects to it. -
Use LDAP without a small fix.
app.ldap.baseDNandapp.ldap.userDomaindon’t reach Leantime. And withapp.ldap.keysorapp.ldap.groupAssignmentset, the install fails withexpected string. To fix that, openleantime/helm/templates/deployment.yamland add| quoteto those two lines, so they read:value: {{ .Values.app.ldap.keys | quote }}value: {{ .Values.app.ldap.groupAssignment | quote }}Do the same for
app.ldap.defaultRoleKeyif you set it:value: {{ .Values.app.ldap.defaultRoleKey | quote }}. Kubernetes only accepts text for these values, not numbers.
Each restart or update of the Leantime pod also signs everyone out, because sign-ins are kept inside the pod.
How do I update Leantime?
Section titled “How do I update Leantime?”-
Back up the database and the files.
-
Change
image.taginvalues.yamlto the new version. -
Stop the Leantime pod, then apply the update:
Terminal window kubectl scale deployment/leantime --replicas=0helm upgrade leantime -f values.yaml ./leantime/helmIts file volumes can only be attached to one pod at a time. Stopping the old pod first lets the new one attach them, even if it starts on another node.
helm upgradestarts the new pod by itself. Leantime is offline for the minute in between. Do the same whenever you apply changed settings withhelm upgradeon a cluster with more than one node. -
Open Leantime. If the new version changes the database, Leantime shows Update Database: click Update Now!
Read what changed first in Upgrade Leantime.
How do I back up Leantime on Kubernetes?
Section titled “How do I back up Leantime on Kubernetes?”The database:
kubectl exec leantime-mariadb-0 -- sh -c 'mysqldump -u root -p"$MARIADB_ROOT_PASSWORD" --single-transaction leantime' > leantime-backup.sqlThe files. Find the Leantime pod’s name with kubectl get pods, then copy both folders out:
kubectl cp <leantime-pod>:/var/www/html/userfiles ./userfileskubectl cp <leantime-pod>:/var/www/html/public/userfiles ./public-userfilesKeep values.yaml with the backups: it holds the secret key. See Backup and restore for what to keep and how to restore.
What if something goes wrong?
Section titled “What if something goes wrong?”Error: no repository definition for https://charts.bitnami.com/bitnami: runhelm repo add bitnami https://charts.bitnami.com/bitnami, thenhelm dependency build ./leantime/helmagain.- The sign-in page just reloads:
app.leanSessionSecureis"true"(the default) and you opened Leantime over plainhttp://. Use yourhttps://address, or see the tip under How do I install Leantime with Helm? - The Leantime pod stays at
0/1: it waits until it can reach the database. Check the database pod withkubectl get pods, and both logs withkubectl logs deploy/leantimeandkubectl logs leantime-mariadb-0. - Anything else: see Common issues and Docker troubleshooting. Leantime runs the same image on Kubernetes.
Related
Section titled “Related”Was this page helpful?
Thanks, glad it helped.
Thanks for telling us. What was missing?
