mastodon
by CodeChem
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
--waitflag 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
| Name | Description | Value |
|---|---|---|
global.postgresqlEnabled | Whether to deploy the Bitnami PostgreSQL chart as subchart. Check the official chart for configuration. | true |
global.redisEnabled | Whether to deploy the Bitnami Redis chart as subchart. Check the official chart for configuration. | true |
global.elasticsearchEnabled | Whether 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.imagePullSecrets | Global Docker registry secret names as an array. | [] |
Common parameters
| Name | Description | Value |
|---|---|---|
nameOverride | String to partially override common.names.fullname | "" |
fullnameOverride | String to fully override common.names.fullname | "" |
image.repository | The Docker repository to pull the image from. | tootsuite/mastodon |
image.tag | The image tag to use. | v4.0.2 |
image.imagePullPolicy | The image pull policy to use. | IfNotPresent |
serviceAccount.enabled | Specifies whether a ServiceAccount should be created. | true |
serviceAccount.annotations | Annotations for service account. Evaluated as a template. Only used if create is true. | {} |
serviceAccount.name | The name of the ServiceAccount to use. If not set and enabled is true, a name is generated using the fullname template. | "" |
Web parameters
| Name | Description | Value |
|---|---|---|
web.replicaCount | The number of replicas to deploy. | 1 |
web.service.type | The service type to create. | ClusterIP |
web.service.port | The service port to use. | 3000 |
web.ingress.enabled | Enable ingress record generation for Mastodon web. | false |
web.ingress.annotations | Mapped annotations for the web ingress. | {} |
web.ingress.hosts | Array style hosts for the web ingress. | [] |
web.ingress.tls | Array style TLS secrets for the web ingress. | [] |
web.podSecurityContext.enabled | Enabled Web pods' security context | true |
web.podSecurityContext.runAsUser | Set Web pod's security context runAsUser | 991 |
web.podSecurityContext.runAsGroup | Set Web pod's security context runAsGroup | 991 |
web.podSecurityContext.fsGroup | Set Web pod's security context fsGroup | 991 |
web.containerSecurityContext.enabled | Enabled Web containers' security context | false |
web.containerSecurityContext.runAsUser | Set Web containers' security context runAsUser | 1001 |
web.containerSecurityContext.allowPrivilegeEscalation | Set Web containers' security context allowPrivilegeEscalation | false |
web.containerSecurityContext.capabilities.drop | Set Web containers' security context capabilities to be dropped | ["all"] |
web.containerSecurityContext.readOnlyRootFilesystem | Set Web containers' security context readOnlyRootFilesystem | false |
web.containerSecurityContext.runAsNonRoot | Set Web container's security context runAsNonRoot | true |
web.affinity | Affinity for Web pods assignment | {} |
web.nodeSelector | Node labels for Web pods assignment | {} |
web.tolerations | Tolerations for Web pods assignment | [] |
web.resources.limits | The resources limits for the web containers | {} |
web.resources.requests | The requested resources for the web containers | {} |
web.autoscaling.enabled | Whether to enable horizontal pod autoscaling. Make sure you set resources.requests if you enable autoscaling. | false |
web.autoscaling.minReplicas | The minimum number of pod replicas to allow. | 1 |
web.autoscaling.maxReplicas | The maximum number of pod replicas to allow. | 100 |
web.autoscaling.targetCPUUtilizationPercentage | The target CPU utilization percentage to aim for. | 80 |
web.autoscaling.targetMemoryUtilizationPercentage | The target memory utilization percentage to aim for. | 80 |
Sidekiq parameters
| Name | Description | Value |
|---|---|---|
sidekiq.replicaCount | The number of replicas to deploy. | 1 |
sidekiq.podSecurityContext.enabled | Enabled Sidekiq pods' security context | true |
sidekiq.podSecurityContext.runAsUser | Set Sidekiq pod's security context runAsUser | 991 |
sidekiq.podSecurityContext.runAsGroup | Set Sidekiq pod's security context runAsGroup | 991 |
sidekiq.podSecurityContext.fsGroup | Set Sidekiq pod's security context fsGroup | 991 |
| `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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartmastodon is pinned at v1.0.5 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