Skip to content

Commit

Permalink
switch to natsjs registry (#427)
Browse files Browse the repository at this point in the history
* switch to natsjs registry

* add stream to nats stream operator for service registry

* pin chart versions
  • Loading branch information
wkloucek committed Nov 30, 2023
1 parent 44074fb commit c11907b
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 14 deletions.
2 changes: 1 addition & 1 deletion charts/ocis/docs/values-desc-table.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1019,7 +1019,7 @@ a| [subs=-attributes]
+string+
a| [subs=-attributes]
`"kubernetes"`
| Configure the service registry type. Defaults to "kubernetes". Can be set to "etcd" or "nats", then the address of etcd / nats node(s) needs to be set to `registry.nodes`.
| Configure the service registry type. Defaults to "kubernetes". Can be set to "etcd" or "natsjs", then the address of etcd / nats node(s) needs to be set to `registry.nodes`.
| replicas
a| [subs=-attributes]
+int+
Expand Down
2 changes: 1 addition & 1 deletion charts/ocis/docs/values.adoc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ store:
registry:
# -- Configure the service registry type.
# Defaults to "kubernetes".
# Can be set to "etcd" or "nats", then the address of etcd / nats node(s) needs to be set to `registry.nodes`.
# Can be set to "etcd" or "natsjs", then the address of etcd / nats node(s) needs to be set to `registry.nodes`.
type: kubernetes
# -- Nodes of the service registry to use.
nodes: []
Expand Down
2 changes: 1 addition & 1 deletion charts/ocis/templates/_common/registry/registry.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
oCIS service registry
*/}}
{{- define "ocis.serviceRegistry" -}}
{{- $valid := list "kubernetes" "etcd" "nats" -}}
{{- $valid := list "kubernetes" "etcd" "natsjs" -}}
{{- if not (has .Values.registry.type $valid) -}}
{{- fail "invalid registry.type set" -}}
{{- end -}}
Expand Down
2 changes: 1 addition & 1 deletion charts/ocis/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ store:
registry:
# -- Configure the service registry type.
# Defaults to "kubernetes".
# Can be set to "etcd" or "nats", then the address of etcd / nats node(s) needs to be set to `registry.nodes`.
# Can be set to "etcd" or "natsjs", then the address of etcd / nats node(s) needs to be set to `registry.nodes`.
type: kubernetes
# -- Nodes of the service registry to use.
nodes: []
Expand Down
20 changes: 11 additions & 9 deletions deployments/ocis-nats/helmfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ repositories:

releases:
- name: nats
chart: nats/nats
namespace: ocis-nats
chart: nats/nats
version: 1.1.5
values:
- config:
cluster:
enabled: true
replicas: 3
name: "ocis-cluster"
enabled: true
replicas: 3
name: "ocis-cluster"
jetstream:
enabled: true
merge:
Expand Down Expand Up @@ -45,28 +46,29 @@ releases:
no_auth_user: ocis
- name: nack-crds
chart: ./crds
namespace: ocis-nack
chart: ./crds

- name: nack-streams
chart: ./streams
namespace: ocis-nats
chart: ./streams
needs:
- ocis-nats/nats
- ocis-nack/nack-crds

- name: nack
chart: nats/nack
namespace: ocis-nack
chart: nats/nack
version: 0.25.0
values:
- namespaced: false
- readOnly: false
needs:
- ocis-nack/nack-crds

- name: ocis
chart: ../../charts/ocis
namespace: ocis
chart: ../../charts/ocis
values:
- externalDomain: ocis.kube.owncloud.test
- ingress:
Expand All @@ -91,7 +93,7 @@ releases:
enabled: false

- registry:
type: nats
type: natsjs
nodes:
- nats.ocis-nats.svc.cluster.local:4222

Expand Down
21 changes: 20 additions & 1 deletion deployments/ocis-nats/streams/ocis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,29 @@ spec:
account: ocis-nats
---
apiVersion: jetstream.nats.io/v1beta2
kind: Stream
metadata:
name: service-registry
spec:
name: OBJ_service-registry
subjects:
- $O.service-registry.C.>
- $O.service-registry.M.>
replicas: 3
storage: file
retention: limits
discard: old
duplicateWindow: "2m0s"
maxAge: "0"
allowRollup: true
allowDirect: true
account: ocis-nats
---
apiVersion: jetstream.nats.io/v1beta2
kind: Account
metadata:
name: ocis-nats
spec:
name: ocis-nats
servers:
- nats://nats.ocis-nats.svc.cluster.local:4222
- nats://nats.ocis-nats.svc.cluster.local:4222

0 comments on commit c11907b

Please sign in to comment.