mercure

by joaquinito2051

Helm chartv1.0.2App 0.5.0

The Mercure hub allows to push data updates using the Mercure protocol to web browsers and other HTTP clients in a convenient, fast, reliable and battery-efficient way

About this chart

Mercure

Mercure is a protocol allowing to push data updates to web browsers and other HTTP clients in a convenient, fast, reliable and battery-efficient way.

TL;DR;

$ helm install <helm-repo>/mercure

$ helm install stable/mercure

Introduction

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

Prerequisites

  • Kubernetes 1.4+ with Beta APIs enabled
  • PV provisioner support in the underlying infrastructure

Installing the Chart

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

$ helm install --name my-release <helm-repo>/mercure

$ helm install --name my-release stable/mercure The command deploys the Mercure Hub on the Kubernetes cluster in the default configuration. The configuration section lists the parameters that can be configured during installation.

Tip: List all releases using helm list

Uninstalling the Chart

To uninstall/delete the my-release deployment:

$ helm delete my-release

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

Configuration

The following table lists the configurable parameters of the Moodle chart and their default values.

ParameterDescriptionDefault
allowAnonymousset to 1 to allow subscribers with no valid JWT to connect0
corsAllowedOriginsa comma separated list of allowed CORS origins, can be * for allempty
debugset to 1 to enable the debug mode (prints recovery stack traces)0
demoset to 1 to enable the demo mode (automatically enabled when debug is 1)0
jwtKeythe JWT key to use for both publishers and subscribersrandom string
logFormatthe log formatFLUENTD
publishAllowedOriginsa comma separated list of origins allowed to publish (only applicable when using cookie-based auth)empty
publisherJwtKeymust contain the secret key to valid publishers' JWT, can be omited in favor of jwtKeyempty
subscriberJwtKeymust contain the secret key to valid subscribers' JWT, can be omited in favor of jwtKeyempty
heartbeatIntervalinterval between heartbeats (useful with some proxies, and old browsers)0s
historyCleanupFrequencychances to trigger history cleanup when an update occurs (number between 0 and 1)0.3
historySizesize of the history (0 for no limits)0
readTimeoutmaximum duration for reading the entire request, including the body0s
writeTimeoutmaximum duration before timing out writes of the response0s
image.repositorycontroller container image repositorydunglas/mercure
image.tagcontroller container image tagv0.3.2
image.pullPolicycontroller container image pull policyIfNotPresent
nameOverrideName overrideempty
fullnameOverridefullname override`empty
service.typeService typeNodePort
service.portService port80
ingress.enabledEnables Ingressfalse
ingress.annotationsIngress annotations{}
ingress.pathIngress path/
ingress.hostsIngress accepted hostnames["mercure.local"]
ingress.tlsIngress TLS configuration[]
resourcescontroller pod resource requests & limits{}
nodeSelectornode labels for controller pod assignment{}
tolerationscontroller pod toleration for taints{}

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

Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
$ helm install --name my-release --set jwtKey=FooBar,corsAllowedOrigins=example.com <helm-repo>/mercure

$ helm install --name my-release --set jwtKey=FooBar,corsAllowedOrigins=example.com stable/mercure The above command sets the JWT key to FooBar. Additionally it allows pages served from example.com to connect to the hub.

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

$ helm install --name my-release -f values.yaml <helm-repo>/mercure

$ helm install --name my-release -f values.yaml stable/mercure

Tip: You can use the default values.yaml

Deploy mercure with OpenTenant

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