unpubd

by robjuz

Helm chartv1.0.1App 0.0.5

A Helm chart for Kubernetes

About this chart

Unpubd

Unpubd is essentially an installer for the unpub package.

TL;DR

helm repo add robjuz https://robjuz.github.io/helm-charts/
helm install Unpubd robjuz/Unpubd

Introduction

This chart bootstraps a Unpubd deployment on a Kubernetes cluster using the Helm package manager.

It also packages the Bitnami MongoDB chart which is required for bootstrapping a MariaDB deployment for the database requirements of the Unpubd application.

This chart has been tested to work with NGINX Ingress and cert-manager on top of the k3s.

Prerequisites

  • Kubernetes 1.12+
  • Helm 3.1.0
  • PV provisioner support in the underlying infrastructure

Installing the Chart

To install the chart with the release name unpubd:

helm install unpubd robjuz/Unpubd

The command deploys Unpubd 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 unpubd deployment:

helm delete unpubd

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

Parameters

Common parameters

NameDescriptionValue
nameOverrideString to partially override common.names.fullnamenil
fullnameOverrideString to fully override common.names.fullnamenil

Unpubd Image parameters

NameDescriptionValue
image.repositoryUnpubd image repositorynoojee/unpubd
image.tagUnpubd image tag (immutable tags are recommended)0.0.5
image.pullPolicyUnpubd image pull policyIfNotPresent
imagePullSecretsUnpubd image pull secrets[]

Unpubd deployment parameters

NameDescriptionValue
replicaCountNumber of Unpubd replicas to deploy1
updateStrategy.typeUnpubd deployment strategy typeRollingUpdate
updateStrategy.rollingUpdateUnpubd deployment rolling update configuration parameters{}
schedulerNameAlternate schedulernil
serviceAccountNameServiceAccount namedefault
hostAliasesUnpubd pod host aliases[]
podAnnotationsAnnotations for Unpubd pods{}
livenessProbe.enabledEnable livenessProbe on Unpubd containerstrue
livenessProbe.initialDelaySecondsInitial delay seconds for livenessProbe120
livenessProbe.periodSecondsPeriod seconds for livenessProbe10
livenessProbe.timeoutSecondsTimeout seconds for livenessProbe5
livenessProbe.failureThresholdFailure threshold for livenessProbe6
livenessProbe.successThresholdSuccess threshold for livenessProbe1
readinessProbe.enabledEnable readinessProbe on Unpubd containerstrue
readinessProbe.initialDelaySecondsInitial delay seconds for readinessProbe30
readinessProbe.periodSecondsPeriod seconds for readinessProbe10
readinessProbe.timeoutSecondsTimeout seconds for readinessProbe5
readinessProbe.failureThresholdFailure threshold for readinessProbe6
readinessProbe.successThresholdSuccess threshold for readinessProbe1
startupProbe.enabledEnable startupProbe on Unpubd containersfalse
startupProbe.initialDelaySecondsInitial delay seconds for startupProbe30
startupProbe.periodSecondsPeriod seconds for startupProbe10
startupProbe.timeoutSecondsTimeout seconds for startupProbe5
startupProbe.failureThresholdFailure threshold for startupProbe6
startupProbe.successThresholdSuccess threshold for startupProbe1
customLivenessProbeCustom livenessProbe that overrides the default one{}
customReadinessProbeCustom readinessProbe that overrides the default one{}

Traffic Exposure Parameters

NameDescriptionValue
service.typeUnpubd service typeClusterIP
service.portUnpubd service HTTP port80
ingress.enabledEnable ingress record generation for Unpubdfalse
ingress.certManagerAdd the corresponding annotations for cert-manager integrationfalse
ingress.hostnameDefault host for the ingress recordUnpubd.local
ingress.annotationsAdditional custom annotations for the ingress record{}
ingress.tlsEnable TLS configuration for the host defined at ingress.hostname parameterfalse
ingress.secretsCustom TLS certificates as secrets[]

Database Parameters

NameDescriptionValue
mariadb.enabledDeploy a MariaDB server to satisfy the applications database requirementstrue
mariadb.architectureMariaDB architecture. Allowed values: standalone or replicationstandalone
mariadb.auth.rootPasswordMariaDB root passwordchangeme
mariadb.auth.databaseMariaDB custom databaseUnpubd
mariadb.auth.usernameMariaDB custom user nameUnpubd
mariadb.auth.passwordMariaDB custom user passwordUnpubd
mariadb.primary.persistence.enabledEnable persistence on MariaDB using PVC(s)true
mariadb.primary.persistence.storageClassPersistent Volume storage classnil
mariadb.primary.persistence.accessModesPersistent Volume access modes[ReadWriteOnce]
mariadb.primary.persistence.sizePersistent Volume size4Gi

The above parameters map to the env variables defined in tobybatch/Unpubd. For more information please refer to the tobybatch/Unpubd image documentation.

Specify each parameter using the --set key=value[,key=value] argument to helm install. For example,

helm install my-release \
  --set UnpubdUsername=admin \
  --set UnpubdPassword=password \
  --set mariadb.auth.rootPassword=secretpassword \
    robjuz/Unpubd

The above command sets the Unpubd administrator account username and password to admin and password respectively. Additionally, it sets the MariaDB root user password to secretpassword.

NOTE: Once this chart is deployed, it is not possible to change the application's access credentials, such as usernames or passwords, using Helm. To change these application credentials after deployment, delete any persistent volumes (PVs) used by the chart and re-deploy it, or use the application's built-in administrative tools if available.

Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example,

helm install Unpubd -f values.yaml robjuz/Unpubd

Configuration and installation details

External database support

You may want to have Unpubd connect to an external database rather than installing one inside your cluster. Typical reasons for this are to use a managed database service, or to share a common database server for all your applications. To achieve this, the chart allows you to specify credentials for an external database with the externalDatabase parameter. You should also disable the MariaDB installation with the mariadb.enabled option. Here is an example:

mariadb.enabled=false
externalDatabase.host=myexternalhost
externalDatabase.user=myuser
externalDatabase.password=mypassword
externalDatabase.database=mydatabase
externalDatabase.port=3306

Ingress

This chart provides support for Ingress resources. If an Ingress controller, such as nginx-ingress or traefik, that Ingress controller can be used to serve Unpubd.

To enable Ingress integration, set ingress.enabled to true. The ingress.hostname property can be used to set the host name. The ingress.tls parameter can be used to add the TLS configuration for this host.

TLS secrets

The chart also facilitates the creation of TLS secrets for use with the Ingress controller, with different options for certificate management.

Deploy unpubd with OpenTenant

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