cassandra-http-gateway

by joaquinito2051

Helm chartv0.4.1

A generic helm chart for Cassandra connected HTTP applications

About this chart

cassandra-http-gateway

History

This chart was created from a copy of aqs-http-gateway, which in turn was created by merging two previous charts: cassandra-http-gateway and druid-http-gateway. It is meant to supercede aqs-http-gateway (it has been renamed since its use is no longer constrained to AQS).

Scope

NOTE: What follows is not an opinionated statement of intent; This does not document a design, it is a (best-effort) attempt at documenting how things currently are.

Services that use this chart share in common a YAML-formatted configuration file (which the chart templates and mounts as /etc/cassandra-http-gateway/config.yaml), and all of the services (by convention) share a number of common config parameters. Those params are:

  • service_name
  • log_level
  • listen_address
  • listen_port

Cassandra-using services

Additionally, most (but not all) of the services using this chart to connect to a Cassandra cluster, and share a common configuration structure for this. An example of that structure:

cassandra:
  port: 9042
  keyspace: keyspace1
  consistency: localquorum
  hosts:
    - hostname0
	- hostname1
	- hostname2
  config_table: aqs.config
  local_dc: eqiad
  authentication:
    username: dbuser
    password: dbpass
  tls:
    ca: /etc/ssl/certs/wmf-ca-certificates.crt

NOTE: The config_table param is an AQSism currently only needed by two services.

Druid-using services

Some (but not all) of the Cassandra-connected services also connect to Druid, and share a common configuration structure. An example of that structure:

druid:
  host: http://hostname.discovery.wmnet
  port: 8082
  datasource: mydatasourse
  authentication:
    username: druiduser
    password: druidpass
  tls:
    ca: /etc/ssl/certs/wmf-ca-certificates.crt

Data Gateway-using services

Another example use is one that retrieves data from a Cassandra cluster via an HTTP gateway service (the Data Gateway), specified using a single configuration parameter, data_gateway_uri. Such a service does not connect directly to Cassandra (services use the Data Gateway in lieu of Cassandra), but Data Gateway-using services that also use Druid are possible.

Note: At the time of writing there is only one such service, but more could be expected as this is intended to become the defacto way of implementing AQS and AQS-like endpoints.

Hoarde

Services based on Hoarde are another example of something that connects to a Cassandra cluster, but additionally they need to configure a set of caches. An example of the config structure Hoard uses for defining cache tables:

tables:
  article_topics:
    lambda:
      type: grpc
      hostname: lambda0.discovery.wmnet
      port: 50501
      timeout: 2000ms

Deploy cassandra-http-gateway with OpenTenant

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