ghost

by groundhog2k

Helm chartv0.212.22App 6.78.0

A Helm chart for Ghost on Kubernetes

About this chart

Ghost

Changelog

⚠️ An upgrade to Ghost 4.46.x, Ghost 4.47.x or Ghost 4.48.x with MariaDB as database will fail - Upgrading to Ghost 5.0.0 with MariaDB as database backend works only with Ghost >=4.46.2 - Using MySQL as database backend is highly recommended and will support the full upgrade path

see RELEASENOTES.md

A Helm chart for Ghost blog on Kubernetes

TL;DR

helm repo add groundhog2k https://groundhog2k.github.io/helm-charts/
helm install my-release groundhog2k/ghost

Introduction

This chart uses the original Ghost image from Docker Hub to deploy a Ghost blog in Kubernetes.

It fully supports deployment of the multi-architecture docker image.

Prerequisites

  • Kubernetes 1.12+
  • Helm 3.x
  • PV provisioner support in the underlying infrastructure

Installing the Chart

To install the chart with the release name my-release:

helm install my-release groundhog2k/ghost

Uninstalling the Chart

To uninstall/delete the my-release deployment:

helm uninstall my-release

Requirements

RepositoryNameVersion
@groundhog2kmariadb0.2.28
@groundhog2kmysql0.2.0

Common parameters

KeyTypeDefaultDescription
fullnameOverridestring""Fully override the deployment name
nameOverridestring""Partially override the deployment name

Deployment parameters

KeyTypeDefaultDescription
image.pullPolicystring"IfNotPresent"Image pull policy
image.registrystring"docker.io"Image registry
image.repositorystring"ghost"Image name
image.tagstring""Image tag
imagePullSecretslist[]Image pull secrets
strategyobject{}Pod deployment strategy
startupProbeobjectsee values.yamlStartup probe configuration
livenessProbeobjectsee values.yamlLiveness probe configuration
readinessProbeobjectsee values.yamlReadiness probe configuration
customStartupProbeobject{}Custom startup probe (overwrites default startup probe configuration)
customLivenessProbeobject{}Custom liveness probe (overwrites default liveness probe configuration)
customReadinessProbeobject{}Custom readiness probe (overwrites default readiness probe configuration)
resourcesobject{}Resource limits and requests
priorityClassNamestring""Deployment priority class name
nodeSelectorobject{}Deployment node selector
customLabelsobject{}Additional labels for Deployment or StatefulSet
customAnnotationsobject{}Additional annotations for Deployment or StatefulSet
podAnnotationsobject{}Additional pod annotations
podLabelsobject{}Additional pod labels
podSecurityContextobjectsee values.yamlPod security context
securityContextobjectsee values.yamlContainer security context
envlist[]Additional container environmment variables
argslist[]Arguments for the container entrypoint process
rbac.createbooltrueEnable creation of RBAC
serviceAccount.createboolfalseEnable service account creation
serviceAccount.namestring""Optional name of the service account
serviceAccount.annotationsobject{}Additional service account annotations
affinityobject{}Affinity for pod assignment
tolerationslist[]Tolerations for pod assignment
topologySpreadConstraintsobject{}Topology spread constraints for pods
revisionHistoryLimitintnilMaximum number of revisions maintained in revision history

Service paramters

KeyTypeDefaultDescription
service.portint80Ghost HTTP service port
service.typestring"ClusterIP"Service type
service.nodePortintnilThe node port (only relevant for type LoadBalancer or NodePort)
service.clusterIPstringnilThe cluster ip address (only relevant for type LoadBalancer or NodePort)
service.loadBalancerIPstringnilThe load balancer ip address (only relevant for type LoadBalancer)
service.loadBalancerSourceRangeslist[]The list of IP CIDR ranges that are allowed to access the load balancer (only relevent for type LoadBalancer)
service.annotationsobject{}Additional service annotations
service.labelsobject{}Additional service labels

Ingress parameters

KeyTypeDefaultDescription
ingress.enabledboolfalseEnable ingress for Ghost service
ingress.classNameobject{}Optional ingress class name
ingress.annotationsobject{}Additional annotations for ingress
ingress.labelsobject{}Additional ingress lables
ingress.hosts[0].hoststring""Hostname for the ingress endpoint
ingress.hosts[0].host.paths[0].pathstring"/"Path of the Ghost UI
ingress.hosts[0].host.paths[0].pathTypestring"ImplementationSpecific"Ingress path type (ImplementationSpecific, Prefix, Exact)
ingress.tlslist[]Ingress TLS parameters
ingress.maxBodySizestring"2m"Maximum body size for post requests

HTTPRoute parameters

KeyTypeDefaultDescription
httpRoute.enabledboolfalseEnable HTTPRoute for the Management UI service
httpRoute.annotationsobject{}Additional HTTPRoute annotations
httpRoute.labelsobject{}Additional HTTPRoute labels
httpRoute.parentRefslist[]Gateway parent references (required when httpRoute is enabled and listenerSet is disabled)
httpRoute.hostnameslist[]Hostnames for the HTTPRoute
httpRoute.ruleslistsee values.yamlHTTPRoute rules for the Management UI service

ListenerSet parameters

KeyTypeDefaultDescription
listenerSet.enabledboolfalseEnable ListenerSet for Gateway API
listenerSet.annotationsobject{}Additional ListenerSet annotations
listenerSet.labelsobject{}Additional ListenerSet labels
listenerSet.parentRefobject{}Gateway parent reference (required)
listenerSet.listenerslist[]Listeners to attach to the parent Gateway

Network policies

Allows to define optional network policies for ingress and egress The policyTypes will be automatically set

KeyTypeDefaultDescription
networkPolicy.ingressobject{}Ingress network policies
networkPolicy.egressobject{}Egress network policies

Storage parameters

KeyTypeDefaultDescription
storage.accessModes[0]string"ReadWriteOnce"Storage access mode
storage.persistentVolumeClaimNamestringnilPVC name when existing storage volume should be used
storage.requestedSizestringnilSize for new PVC, when no existing PVC is used
storage.classNamestringnilStorage class name
storage.keepPvcboolfalseKeep a created Persistent volume claim when uninstalling the helm chart
storage.annotationsobject{}Additional storage annotations
storage.labelsobject{}Additional storage labels

Ghost parameters

KeyTypeDefaultDescription
mariadb.enabledboolfalseEnables MariaDB deployment (and switches off externalDatabase section)
mariadb.settings.rootPasswordstringnilMariaDB root password
mariadb.userDatabase.namestringnilName of the Ghost database
mariadb.userDatabase.userstringnilUser name with full access to ghost database
mariadb.userDatabase.passwordstringnilPassword of the ghost database user
mysql.storagestringnilMySQL storage parameter (see storage parameters)
mysql.enabledboolfalseEnables MySQL deployment (and switches off externalDatabase section)
mysql.settings.rootPasswordstringnilMySQL root password
mysql.userDatabase.namestringnilName of the Ghost database
mysql.userDatabase.userstringnilUser name with full access to ghost database
mysql.userDatabase.passwordstringnilPassword of the ghost database user
mysql.storagestringnilMySQL storage parameter (see storage parameters)
externalDatabase.typestring"sqlite"External database type (mysql or mariadb - default: sqlite)
externalDatabase.sqliteDatabaseFilestring"content/data/ghost.db"Path to default SQLite database (only sqlite)
externalDatabase.hoststringnilExternal database host (only mysql/mariadb)
externalDatabase.namestring"ghost"External database name (only mysql/mariadb)
externalDatabase.userstringnilExternal database user (only mysql/mariadb)
externalDatabase.passwordstringnilExternal database password (only mysql/mariadb)
settings.modestring"production"Ghost mode (production or development)
settings.urlstringnilURL of Ghost blog
settings.logToStdoutbooltrueLog to stdout by default (otherwise logging will go to stdout and file)
settings.mail.fromstringnilMail from address
settings.mail.transportstringSMTPMail transport type (SMTP, Sendmail, Direct)
settings.mail.hoststringnilMail host for transport
settings.mail.portintnilMail port for transport
settings.mail.servicestringnilService for mail transport (Mailgun, Sendgrid, Gmail, SES)
settings.mail.userstringnilMail auth user
settings.mail.passwortstringnilMail auth password

Deploy ghost with OpenTenant

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