mastodon

by CodeChem

Helm chartv1.0.5App 4.0.2Verified publisher

CodeChem Mastodon Helm Chart

About this chart

Mastodon

Mastodon is a free, open-source social network server based on ActivityPub where users can follow friends and discover new ones. On Mastodon, users can publish anything they want: links, pictures, text, video. All Mastodon servers are interoperable as a federated network (users on one server can seamlessly communicate with users from another one, including non-Mastodon software that implements ActivityPub)!

TL;DR

helm repo add codechem https://charts.codechem.com
helm install mastodon codechem/mastodon --wait

NOTE: Using the --wait flag is recommended. Helm hooks are used for the order of operations, as well as database migrations which can be slow, so timeout might occur on slower machines, preventing the full deployment of the resources.

Introduction

Mastodon is free and open-source software for running self-hosted social networking services. It has microblogging features similar to the Twitter service, which are offered by a large number of independently run nodes, known as instances, each with its own code of conduct, terms of service, privacy policy, privacy options, and moderation policies.

Each user is a member of a specific Mastodon instance (also called a server), which can interoperate as a federated social network, allowing users on different instances to interact with each other. This is intended to give users the flexibility to select a node whose policies they prefer, but keep access to a larger social network. Mastodon is also part of the Fediverse ensemble of server platforms, which use shared protocols allowing users to also interact with users on other compatible platforms, such as PeerTube and Friendica. Mastodon is crowdfunded and does not contain ads.

Prerequisites

  • Kubernetes 1.18+
  • Helm 3.2.0+

Installing the Chart

To install the chart with the release name mastodon:

helm install mastodon codechem/mastodon

The command deploys mastodon on the Kubernetes cluster in the default configuration. The Parameters section lists the parameters that can be configured during installation.

Tip: List all releases using helm list

Uninstalling the Chart

To uninstall/delete the mastodon deployment:

helm delete mastodon

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

Parameters

Global parameters

NameDescriptionValue
global.postgresqlEnabledWhether to deploy the Bitnami PostgreSQL chart as subchart. Check the official chart for configuration.true
global.redisEnabledWhether to deploy the Bitnami Redis chart as subchart. Check the official chart for configuration.true
global.elasticsearchEnabledWhether to deploy the Bitnami Elasticsearch chart as subchart. Check the official chart for configuration. If you don't have Elasticsearch, full-text search will be disabled. If you enable ES after the initial install, you will need to manually run RAILS_ENV=production bundle exec rake chewy:sync. See the docs.true
global.imagePullSecretsGlobal Docker registry secret names as an array.[]

Common parameters

NameDescriptionValue
nameOverrideString to partially override common.names.fullname""
fullnameOverrideString to fully override common.names.fullname""
image.repositoryThe Docker repository to pull the image from.tootsuite/mastodon
image.tagThe image tag to use.v4.0.2
image.imagePullPolicyThe image pull policy to use.IfNotPresent
serviceAccount.enabledSpecifies whether a ServiceAccount should be created.true
serviceAccount.annotationsAnnotations for service account. Evaluated as a template. Only used if create is true.{}
serviceAccount.nameThe name of the ServiceAccount to use. If not set and enabled is true, a name is generated using the fullname template.""

Web parameters

NameDescriptionValue
web.replicaCountThe number of replicas to deploy.1
web.service.typeThe service type to create.ClusterIP
web.service.portThe service port to use.3000
web.ingress.enabledEnable ingress record generation for Mastodon web.false
web.ingress.annotationsMapped annotations for the web ingress.{}
web.ingress.hostsArray style hosts for the web ingress.[]
web.ingress.tlsArray style TLS secrets for the web ingress.[]
web.podSecurityContext.enabledEnabled Web pods' security contexttrue
web.podSecurityContext.runAsUserSet Web pod's security context runAsUser991
web.podSecurityContext.runAsGroupSet Web pod's security context runAsGroup991
web.podSecurityContext.fsGroupSet Web pod's security context fsGroup991
web.containerSecurityContext.enabledEnabled Web containers' security contextfalse
web.containerSecurityContext.runAsUserSet Web containers' security context runAsUser1001
web.containerSecurityContext.allowPrivilegeEscalationSet Web containers' security context allowPrivilegeEscalationfalse
web.containerSecurityContext.capabilities.dropSet Web containers' security context capabilities to be dropped["all"]
web.containerSecurityContext.readOnlyRootFilesystemSet Web containers' security context readOnlyRootFilesystemfalse
web.containerSecurityContext.runAsNonRootSet Web container's security context runAsNonRoottrue
web.affinityAffinity for Web pods assignment{}
web.nodeSelectorNode labels for Web pods assignment{}
web.tolerationsTolerations for Web pods assignment[]
web.resources.limitsThe resources limits for the web containers{}
web.resources.requestsThe requested resources for the web containers{}
web.autoscaling.enabledWhether to enable horizontal pod autoscaling. Make sure you set resources.requests if you enable autoscaling.false
web.autoscaling.minReplicasThe minimum number of pod replicas to allow.1
web.autoscaling.maxReplicasThe maximum number of pod replicas to allow.100
web.autoscaling.targetCPUUtilizationPercentageThe target CPU utilization percentage to aim for.80
web.autoscaling.targetMemoryUtilizationPercentageThe target memory utilization percentage to aim for.80

Sidekiq parameters

NameDescriptionValue
sidekiq.replicaCountThe number of replicas to deploy.1
sidekiq.podSecurityContext.enabledEnabled Sidekiq pods' security contexttrue
sidekiq.podSecurityContext.runAsUserSet Sidekiq pod's security context runAsUser991
sidekiq.podSecurityContext.runAsGroupSet Sidekiq pod's security context runAsGroup991
sidekiq.podSecurityContext.fsGroupSet Sidekiq pod's security context fsGroup991
`sidekiq.containerSecurity

Deploy mastodon with OpenTenant

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