Skip to content

Commit

Permalink
doc: add operator integration
Browse files Browse the repository at this point in the history
  • Loading branch information
katallaxie authored Sep 23, 2024
1 parent aa9f30a commit 229687a
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,44 @@ spec:
data: -1
```
## NATS Operator
The operator can be integrated with the NATS operator.
```yaml
config:
jetstream:
enabled: true
fileStore:
pvc:
size: 2Gi
resolver:
enabled: true
merge:
type: full
interval: "2m"
timeout: "1.9s"
merge:
00$include: "../custom-auth/auth.conf"
debug: true
container:
patch:
- op: add
path: "/volumeMounts/-"
value:
name: auth-config
mountPath: "/etc/custom-auth"
statefulSet:
patch:
- op: add
path: /spec/template/spec/volumes/-
value:
name: "auth-config"
secret:
defaultMode: 420
secretName: "natsoperator-sample-server-config"
```
## License
[Apache 2.0](/LICENSE)
3 changes: 3 additions & 0 deletions controllers/natsaccount_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ func (r *NatsAccountReconciler) Reconcile(ctx context.Context, req ctrl.Request)

if issuer.Status.OperatorSecretName == "" {
logger.Info("waiting for issuing account secret to appear")

<-time.After(5 * time.Second)

continue
}

Expand Down Expand Up @@ -119,6 +121,7 @@ func (r *NatsAccountReconciler) reconcileSecret(ctx context.Context, req ctrl.Re
}

logger.Info("reconciling account keys")

hasChanges, err := r.reconcileKey(ctx, keySecret, account, signerSecret.Data[OPERATOR_SEED_KEY])
if err != nil {
return nil, err
Expand Down

0 comments on commit 229687a

Please sign in to comment.