Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

red green lame ducky upgrades of a global nats cluster #18

Open
gedw99 opened this issue Jan 10, 2025 · 0 comments
Open

red green lame ducky upgrades of a global nats cluster #18

gedw99 opened this issue Jan 10, 2025 · 0 comments

Comments

@gedw99
Copy link

gedw99 commented Jan 10, 2025

fly is a really great platform to test this out on.

https://docs.nats.io/running-a-nats-service/nats_admin/lame_duck_mode

Why ?

Sure we can kill a server and boot the next version super easy with docker and fly.
But NATS is often your control plane and so you MUST have the Cluster working at all times.
And you have to have each NATS Server tell Its Clients to go find another NATS Server cause in 10 minutes I am upgrading...
So its has to be a red green staggered upgrade of the cluster.
Thats why they have lame duck properties in NATS Server; to help do this male duck dance.

I think with Fly and NATS CLI from your laptop, the flow can be done.
Yes, its not exactly GitOps, but a decent way to get the thing working and to easily debug it.

The Fly CLI and NATS CLI can be added to the Taskfile, like here: https://github.com/starfederation/datastar/blob/develop/Taskfile.yml#L14

After its working an Origin NATS Server ( Aka Syndic ) can talk over the same NATS protocol, to dos the same thing that is done from a laptop. So now Its more GitOps.

The following code I have not tried and it way too complex for now reason at all too.

But just slapping it here for now as a reference to come back to later.

https://github.com/nabbar/golib/blob/master/test/test-nats/main.go#L114
https://github.com/nabbar/golib/blob/master/nats/configPart.go#L214

@gedw99 gedw99 changed the title Fred green lame ducky upgrades red green lame ducky upgrades of a global nats cluster Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant