kutt

by christianhuth

Helm chartv10.1.2App v3.2.6Verified publisher

Kutt is a free modern URL shortener.

About this chart

kutt

Kutt is a free modern URL shortener.

TL;DR;

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

Or install it from the OCI registry:

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

Introduction

This chart bootstraps the free modern URL shortener called Kutt using the Helm package manager.

Prerequisites

  • Kubernetes 1.29+
  • The CloudNativePG operator if the bundled PostgreSQL database is used (postgresql.enabled: true, the default)

Installing the CloudNativePG operator

The chart bundles a PostgreSQL cluster as a custom resource of the CloudNativePG operator (via the upstream chart cnpg/cluster). The operator itself is not part of this chart, as it is installed once per Kubernetes cluster:

helm repo add cnpg https://cloudnative-pg.github.io/charts
helm repo update
helm upgrade --install cnpg cnpg/cloudnative-pg --namespace cnpg-system --create-namespace --wait

Valkey (valkey/valkey) is bundled as a regular subchart and doesn't need an operator.

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/kutt

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/kutt

These commands deploy Kutt on the Kubernetes cluster in the default configuration. The Values section lists the values that can be configured during installation.

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 the Dependencies

Kutt needs a PostgreSQL database and optionally uses a Redis-compatible cache. Both are either bundled with the chart or provided externally. Passwords are read from Secrets, using existing Secrets is recommended for production.

PostgreSQL

Create a Secret of type kubernetes.io/basic-auth containing the credentials of the database owner. The username has to match postgresql.cluster.initdb.owner:

kubectl create secret generic kutt-database \
  --type=kubernetes.io/basic-auth \
  --from-literal=username=kutt \
  --from-literal=password='<password>'
postgresql:
  cluster:
    initdb:
      database: kutt
      owner: kutt
      secret:
        name: kutt-database

If no Secret is referenced, the operator generates a random password and stores the credentials in the Secret <release>-postgresql-app. All other settings of the PostgreSQL cluster (e.g. postgresql.cluster.instances, postgresql.cluster.storage, backups) are passed to the upstream chart. See its values for all options.

Valkey

By default Valkey requires the inline password kutt for the user default, which Kutt authenticates as. For production, create a Secret containing the password and reference it in your values:

kubectl create secret generic kutt-valkey --from-literal=password='<password>'
valkey:
  auth:
    enabled: true
    usersExistingSecret: kutt-valkey
    aclUsers:
      default:
        permissions: "~* &* +@all"
        passwordKey: password
        password: ""

All other settings are passed to the upstream chart, see its values. Set valkey.enabled: false (and leave externalRedis.hostname empty) to run Kutt without a cache.

External Services

postgresql:
  enabled: false

externalDatabase:
  hostname: postgresql.example.com
  port: 5432
  database: kutt
  username: kutt
  existingSecret: kutt-database
  existingSecretPasswordKey: password

valkey:
  enabled: false

externalRedis:
  hostname: redis.example.com
  port: 6379
  existingSecret: kutt-redis
  existingSecretPasswordKey: password

Instead of existingSecret you can set password, which lets the chart create the Secret.

Values

KeyTypeDefaultDescription
affinityobject{}Affinity settings for pod assignment
autoscaling.enabledboolfalseEnable Horizontal POD autoscaling
autoscaling.maxReplicasint100Maximum number of replicas
autoscaling.minReplicasint1Minimum number of replicas
autoscaling.targetCPUUtilizationPercentageint80Target CPU utilization percentage
deploymentStrategyobject{}Update strategy for the deployment
externalDatabase.databasestring"kutt"Name of the database to use
externalDatabase.existingSecretstring""Name of an existing Secret containing the password of the user
externalDatabase.existingSecretPasswordKeystring"password"Key in the existing Secret containing the password
externalDatabase.hostnamestring""Hostname of the external PostgreSQL database. Used if postgresql.enabled is false.
externalDatabase.passwordstring""Password of the user. Ignored if externalDatabase.existingSecret is set.
externalDatabase.portint5432Port of the external PostgreSQL database
externalDatabase.usernamestring"kutt"Name of the user to use
externalRedis.existingSecretstring""Name of an existing Secret containing the password
externalRedis.existingSecretPasswordKeystring"password"Key in the existing Secret containing the password
externalRedis.hostnamestring""Hostname of an external Redis or Valkey server. Used if valkey.enabled is false.
externalRedis.passwordstring""Password of the user default. Ignored if externalRedis.existingSecret is set. Leave empty if the server does not require authentication.
externalRedis.portint6379Port of the external server
extraEnvlist[]additional environment variables to be added to the pods
extraEnvFromlist[]load additional environment variables from ConfigMaps or Secrets
fullnameOverridestring""String to fully override "kutt.fullname"
image.pullPolicystring"Always"image pull policy
image.registrystring"docker.io"image registory
image.repositorystring"kutt/kutt"image repository
image.tagstring"v3.2.6"Overrides the image tag
imagePullSecretslist[]If defined, uses a Secret to pull an image from a private Docker registry or repository.
ingress.annotationsobject{}Additional annotations for the Ingress resource
ingress.classNamestring""IngressClass that will be be used to implement the Ingress
ingress.enabledboolfalseEnable ingress record generation
ingress.hostslistsee values.yamlAn array with the hosts configuration
ingress.tlslist[]An array with the tls configuration
kutt.admin.emailsstring""Comma seperated list of email addresses that can access admin actions on settings page
kutt.config.disallowAnonymousLinksboolfalseDisable anonymous link creation
kutt.config.disallowRegistrationboolfalseDisable registration
kutt.config.enableRateLimitboolfalseEnable rate limitting for some API routes. If Redis is enabled uses Redis, otherwise, uses memory.
kutt.config.linkCustomAlphabetstring""Alphabet used to generate custom addresses. Default value omits o, O, 0, i, I, l, 1, and j to avoid confusion when reading the URL.
kutt.config.linkLengthint6Generated link length
kutt.config.siteNamestring"Kutt"The name of the site where Kutt is hosted
kutt.database.clientstring"pg"Which database client to use. This Chart currently only supports PostgreSQL: pg or pg-native. NOTE: pg-native is not installed by default, create your own image to use it.
kutt.database.pool.maxint10Maximum number of database connection pools. Only if you use Postgres or MySQL.
kutt.database.pool.minint0Minimum number of database connection pools. Only if you use Postgres or MySQL.
kutt.database.useSslboolfalseWhether use SSL for the database connection. Only if you use Postgres or MySQL.
kutt.domain.customDomainUseHttpsboolfalseUse HTTPS for links with custom domain
kutt.domain.defaultDomainstring"localhost:3000"The domain that this website is on
kutt.domain.useFirstIngressHostboolfalseIf you use an ingress to expose Kutt you can simply set this to true to use the first hostname defined in the ingress.
kutt.jwt.existingSecretstring""Use existing secret for JWT secret key. The secret has to contain the key JWT_SECRET. When it's set the kutt.jwt.key is ignored.
kutt.jwt.keystring"secret-jwt-key"make sure to replace with your own secret key
kutt.mail.contactEmailstring""Support email to show on the app
kutt.mail.enabledboolfalseEnable emails, which are used for signup, verifying or changing email address, resetting password, and sending reports. If is disabled, all these functionalities will be disabled too.
kutt.mail.existingSecretstring""Use existing secret for password details. The secret has to contain the key MAIL_PASSWORD. When it's set the kutt.mail.password is ignored.
kutt.mail.fromstring""The email address Kutt will send emails from.
kutt.mail.hoststring"smtp.example.com"The host of the external SMTP server that Kutt should use to send emails.
kutt.mail.passwordstring""The password to authenticate to the smtp host when sending emails.
kutt.mail.portint465The port used to connect to the smtp host.
kutt.mail.reportEmailstring""The email address that will receive submitted reports.
kutt.mail.secureboolfalseIf true the connection will use TLS when connecting to server. If false (the default) then TLS is used if server supports the STARTTLS extension. In most cases set this value to true if you are connecting to port 465. For port 587 or 25 keep it false
kutt.mail.usernamestring"[email protected]"The username to authenticate to the smtp host when sending emails.
kutt.recaptcha.existingSecretstring""Use existing secret for ReCaptacha secrets. The secret has to contain the keys RECAPTCHA_SITE_KEY and RECAPTCHA_SECRET_KEY. When it's set the kutt.recaptcha.siteKey and kutt.recaptcha.secretKey is ignored.
kutt.recaptcha.secretKeystring""Invisible reCaptcha secret key. Create one in https://www.google.com/recaptcha/intro/
kutt.recaptcha.siteKeystring""Invisible reCaptcha site key. Create one in https://www.google.com/recaptcha/intro/
nameOverridestring""Provide a name in place of kutt
nodeSelectorobject{}Node labels for pod assignment
podAnnotationsobject{}Annotations to be added to exporter pods
podSecurityContextobject{}pod-level security context
postgresql.cluster.imageNamestring"ghcr.io/cloudnative-pg/postgresql:18-standard-trixie"PostgreSQL image. The tag only pins the major version, so restarted instances get the latest minor version.
postgresql.cluster.imagePullPolicystring"Always"Pull the image on every start to get the latest minor version of the major version
postgresql.cluster.initdb.databasestring"kutt"Name of the database to create
postgresql.cluster.initdb.ownerstring"kutt"Name of the user owning the database
postgresql.cluster.instancesint3Number of PostgreSQL instances (one primary, the others are replicas)
postgresql.cluster.storage.sizestring"8Gi"Size of the PVC of each instance
postgresql.enabledbooltrueEnable a PostgreSQL cluster managed by the CloudNativePG operator. Requires the operator to be installed in the cluster (see README).
postgresql.version.postgresqlstring"18"PostgreSQL major version. Has to match the major version of postgresql.cluster.imageName.
replicaCountint1Number of replicas
resourcesobject{}Resource limits and requests for the pods.
revisionHistoryLimitint10The number of old ReplicaSets to retain
route.main.additionalRuleslist[]Additional custom rules that can be added to the route
route.main.annotationsobject{}Add annotations to the route
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
route.main.enabledboolfalseEnables or disables the route
route.main.filterslist[]Filters define the filters that are applied to requests that match this rule.
route.main.hostnameslist[]Hostnames to be matched
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/
route.main.kindstring"HTTPRoute"Set the route kind Valid options are GRPCRoute, HTTPRoute

Deploy kutt with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has kutt 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 chartkutt is pinned at v10.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