banzaicloud / banzai-charts

Curated list of Banzai Cloud Helm charts used by the Pipeline Platform
Apache License 2.0
368 stars 284 forks source link

Configurable replication factor for cadence cassandra keyspaces #1202

Open rglyons opened 3 years ago

rglyons commented 3 years ago

Is your feature request related to a problem? Please describe. I recently realized that my Cadence/Cassandra deployment was not truly HA, since the keyspaces cadence and cadence_visibility within Cassandra only had replication factors of 1. This meant that any time on of my three cassandra nodes went down, any reads would fail.

Describe the solution you'd like to see A replication factor argument can be passed to cadence-cassandra-tool at the time of bootstrapping cadence. This is currently being done on this line.

The simplest solution, probably, would be to add the -rf flag to the call of cadence-cassandra-tool, and include the parameter's value in the helm values of the cadence chart. E.g.

# server-job.yaml
# line 76
args: ['sh', '-c', 'cadence-cassandra-tool create -k {{ $storeConfig.cassandra.keyspace }} -rf {{ $storeConfig.cassandra.replicationFactor }}']

# values.yaml
server:
  config:
    persistence:
      default:
        driver: "" # cassandra or sql

        cassandra:
          hosts: []
          # port: 9042
          keyspace: cadence
          user: ""
          password: ""
          existingSecret: ""
          consistency: One
          # datacenter: "us-east-1a"
          # maxQPS: 1000
          # maxConns: 2
          replicationFactor: 1    # <-- add this (with default)

      visibility:
        driver: "" # cassandra or sql

        cassandra:
          hosts: []
          # port: 9042
          keyspace: cadence_visibility
          user: ""
          password: ""
          existingSecret: ""
          consistency: One
          # datacenter: "us-east-1a"
          # maxQPS: 1000
          # maxConns: 2
          replicationFactor: 1    # <-- add this (with default)

Describe alternatives you've considered There don't seem to be any alternatives to bootstrapping Cadence's keyspaces in Cassandra, save pre-deploying Cassandra and running the cadence-cassandra-tool create command manually.