Proper way to configure NATS resolver with JWTs and natsbox #816
Unanswered
mac-chaffee
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there!
I've been trying to install NATS with the resolver enabled, essentially following this: https://github.com/nats-io/k8s/tree/main/helm/charts/nats#operator-mode-with-nats-resolver
The first step I've done is to run
nsc init
inside of a local natsbox instance, then extract the generated config like the above link mentions:The first problem I've encountered is that if you only put the system account JWT inside resolver_preload, then when you
helm install
, there will be no record of the operator account (nats-admin). Shouldn't we put both the system account and the operator account JWTs inside of resolver_preload? Otherwise, when you try to authenticate as a user under the nats-admin account, the server will say that it doesn't recognize the account.Assuming you do need both account JWTs in resolver_preload, then the second problem I've hit is that I'm not sure how exactly to configure natsbox. I know that I need some kind of user creds.txt file to give to natsbox, like this format:
Presumably I should use
nats-admin.creds
which was generated bynsc init
right? Because there is no system account user generated bynsc init
anyway. But if you usenats-admin.creds
(which is my operator, not my system account), then I can't do some operations likenats server info
due to insufficient permissions. Additionally, I can't do operations likensc add user
because it throws the error:Error: set an operator -- 'nsc env -o operatorName'
.I was able to run
nsc add operator -i
and import my operator JWT, but shouldn't that not be necessary? Is there a config I can set on natsbox to do that automatically?Finally, even once I import the operator, commands like
nsc pull
fail due toError: operator "nats-admin" doesn't set account server url - unable to pull
. Is there a natsbox setting to ensure that is set automatically?Is there maybe a completely different approach to this problem? Like should I
helm install
without creating an operator or system account, and runnsc init
inside the natsbox that gets deployed (instead of locally)? Feels like I'm barking up the wrong tree. Any advice is appreciated!Beta Was this translation helpful? Give feedback.
All reactions