cratedb-adapter

by hmdmph

Helm chartv0.1.0App 1.0.0

A Helm chart for CrateDB adapter ( CrateDB is a distributed SQL database )

About this chart

CrateDB Adapter ( can be easily used with prometheus remote write/read )

CrateDB is a distributed SQL database built on top of a NoSQL foundation. This is an adapter that accepts read/write requests, and sends them on to CrateDB.

  • listen on endpoints http://<service-name>:9268/write and http://<service-name>:9268/read
  • Requires CrateDB 3.1.0 or greater.

This chart deploys a CrateDB Adapter as a Deployment. By default it creates a Service that expose the endpoints.

TL;DR

$ helm install hmdmph/cratedb-adapter \
       --name cratedb-adapter \
       --set createdb.passwd="*****"

Prerequisites

  • Kubernetes 1.8+ with Beta APIs enabled
  • If deploying in production environment, you need to have persistent volumes
  • Deployed crateDB in Kubernetes 3.1.0 or higher

Installing the Chart

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

$ helm repo add hmdmph https://hmdmph.github.io/helm-charts
$ helm install --name cratedb-adapter hmdmph/cratedb-adapter

This Helm chart deploys crateDB adapter on the Kubernetes cluster in a default configuration. The configuration section lists the parameters that can be configured during installation.

Tip: List all releases using helm list

Tip List installed crateDB Adapter release helm list | grep cratedb-adapter

Tip get history of chart version/ status/ etc... CrateDB Adapter releases helm history cratedb-adapter

Uninstalling the Chart

To uninstall/delete the cratedb-adapter Deployment:

$ helm delete cratedb-adapter

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

Upgrading an existing Release to a new major version

A major chart version change (like v0.1.0 -> v1.0.0) indicates that there may be incompatible or breaking changes that require manual actions.

0.1.0

This is the initial version of the crateDB Adapter chart with the minimal configuration/ settings.

How to delete the crateDB Adapter deployment

$ kubectl delete statefulsets --cascade=false cratedb-adapter

Configuration

The following table lists main configurable most common parameters of the CrateDB chart and their default values:

ParameterDescriptionDefault
replicaCountnumber of replicas for CrateDB adapter1
namespacenamespace that you want to install crateDBdefault
createdb.hostnamehostname of the cratedb servicecrate.your-domain.com
createdb.portNameport of the CrateDB5432
createdb.userNameuser name for CrateDBcrate
createdb.passwdpassword name for CrateDB""
createdb.schemaschema name that you want to connect in CrateDB"cratedb"
createdb.maxConnectionsThe maximum number of concurrent connections (default: 5).6
createdb.tlsEnabledWhether to connect using TLSfalse
createdb.allowInsecureTlsWhether to allow insecure / invalid TLS certificatesfalse
service.serviceWhether enable of disable cratedb-adapter servicetrue
service.typeUsual service typesClusterIP
service.portadapter port9268
service.targetPortthe port you want to expose via service9268

Following table contains other parameters are also configurable in chart, but most of the time you may don't need to modify

ParameterDescriptionDefault
resourcesresources requests/limits can be defined as your requirement{}
affinitypod affinity{}
image.repositoryCrateDB adapter imagecrate/crate_adapter
image.tagversion/ tag of the imagelatest
image.pullPolicyimage pull policyIfNotPresent
nameOverrideoverride chart name""
fullnameOverrideoverride chart full name""
Happy Helm with ♥ at hmdmph

Deploy cratedb-adapter with OpenTenant

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