Skip to content

RFD 002 - Context ​

KeyValue
AuthorKevin Stiehl kevin.stiehl@bagaluten.email
StateDraft

What is Context ​

A Bale client application probably wants to connect to multiple Bale clusters. So a Bale context consist of all the information needed to connect to one Bale cluster.

A config file for a client could look something like this. This way we could store multiple connect informations

yaml
contexts:
  - name: "pretty-cluster-1-prod"
    nats-urls: ["first-node:4222", "second-node:4222"]
    auth:
       ...      # this section is described in RFD 004
    root: prod   # this is the subject under which all bale internal subjects will be mounted. (this can be omitted)
    tls:
      ... # This is described in a later RFD
PropertyDescriptionDefault Value
nameThe name of the current context. This is mainly used to display it to the user<None - value is required>
nats-urlsA list of URLs that the client could connect to<None - value is required>
authA section to authenticate to the NATS cluster{}
rootThis is the toplevel subject that is used by bale. Every bale internal subject will mounted under this subject <root>.jobs.*, root.nodes.*bale

Multiple Bale Clusters on one NATS Cluster ​

The idea to introduce the concept of scopes is not only useful to offer Bale clients an easy way to switch between clusters, furthermore it defines the area that a Bale cluster occupies within a NATS cluster.

With the current definition of a context you have these options in case you want to run multiple Bale clusters inside one NATS cluster.

  • Multiple Bale clusters in one NATS cluster in the same account under different root topics.
  • Multiple Bale clusters in one NATS clusters in different accounts