From Zero to K8S to Leafnodes using Helm

    Next, get your NGS credentials with leafnodes enabled. For this follow these instructions and choose the Developer plan which is free and will allow you to create leafnode connections for a couple of clusters. Once you got the credentials, upload them as a secret to your K8S clusters:

    1. for ctx in do-ams3-nats-k8s-ams3 do-sfo2-nats-k8s-sfo2; do
    2. kubectl --context $ctx create secret generic ngs-creds --from-file $HOME/.nkeys/creds/synadia/NGS/NGS.creds
    3. done

    Create the config that adds the leafnode connection to NGS:

    1. # nats.yaml
    2. leafnodes:
    3. - url: tls://connect.ngs.global:7422
    4. credentials:
    5. secret:
    6. name: ngs-creds
    7. key: NGS.creds

    To test the multi-region connectivity by using the nats-box container that got deployed in each cluster:

    1. kubectl --context do-ams3-nats-k8s-ams3 exec -it nats-box -- nats-sub -s nats hello
    2. Listening on [hello]
    3. while true; do
    4. done