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

add ability to deploy an observable nats without stan stack #185

Merged
merged 89 commits into from
Apr 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
7855f5f
spike: surveyor
jwtodd Jan 29, 2020
c50b60c
mdsctl: spike kill-switch; eg: MDS_NO_BREW=true ./bin/mdsctl
jwtodd Jan 29, 2020
9660dc1
Merge branch 'develop' into feature/jwtodd-surveyor
jwtodd Jan 31, 2020
928826f
+surveyor, no_brew kill-switch
jwtodd Jan 31, 2020
4c4bb78
Merge branch 'develop' into feature/jwtodd-surveyor
jwtodd Feb 3, 2020
d544962
pin stan(s) to mds ns, wire stan:cluster-id=tenantId(default:mds)
jwtodd Feb 3, 2020
dde4398
stan
jwtodd Feb 4, 2020
0733b51
Merge branch 'develop' into feature/jwtodd-surveyor
jwtodd Feb 5, 2020
bd120a7
bootstrap nsc; next: deploy credentialed (nats,stan), surveyor
jwtodd Feb 7, 2020
bf472f2
nats: u/g operator 0.7, nats 2.1.2
jwtodd Feb 7, 2020
d7630ef
natsbox: fix yml typo
jwtodd Feb 7, 2020
f4e027f
nats-server/nats-account-server authenticated; next: nets-surveyor
jwtodd Feb 11, 2020
da66bd4
mdsctl: simplier nsc-account-id util
jwtodd Feb 11, 2020
216ddca
mdsctl/install:nats : progressive (via kubectl-wait) deploy, authenti…
jwtodd Feb 12, 2020
599ecee
mdsctl: istio-wait
jwtodd Feb 12, 2020
6f96eba
mdsctl/helm: broaden support for `-p local` (ie drive down cpu/mem re…
jwtodd Feb 13, 2020
dcfd016
mdsctl: invokable from zsh
jwtodd Feb 13, 2020
6cdabc0
mdsctl/installNats: use nats-operator helm charts
jwtodd Feb 13, 2020
fe9e92d
mdsctl: use nats-operator helm charts
jwtodd Feb 13, 2020
ce82076
stan
jwtodd Feb 13, 2020
b977f95
Merge branch 'develop' into feature/jwtodd-surveyor
jwtodd Feb 13, 2020
66cb56e
mdsctl: authenticated/connected stan; next: surveyor,mds
jwtodd Feb 13, 2020
9987474
mdsctl: u/d stan:0.17.0, stan:authenticted, surveyor up with exceptio…
jwtodd Feb 14, 2020
5266dbb
mdsctl: authenticated surveyor; next: verify with natsbox, credential…
jwtodd Feb 14, 2020
b3ffed6
mdsctl: add s'more helm plugins (eg: diff, secrets, etc)
jwtodd Feb 14, 2020
6772315
nats: helm cleanup, make (max_age, max_bytes) configurable
jwtodd Feb 19, 2020
6d5d5bc
helm: cleanup; nats-surveyor: make cluster-size configurable
jwtodd Feb 19, 2020
5dd11fd
helm: mds+stan-creds
jwtodd Feb 19, 2020
cc87dcb
surveyor-observations: externalize to helm/values
jwtodd Feb 19, 2020
118cf63
mdsctl: nsc credentials override
jwtodd Feb 19, 2020
18d7e6b
mdscl: nsc cleanup
jwtodd Feb 19, 2020
37e76fc
Merge branch 'develop' into feature/jwtodd-surveyor
jwtodd Feb 19, 2020
c50814d
mdsctl: remove stan from bootstrap; helm/nats-account-server: change …
jwtodd Feb 20, 2020
0574c18
mdsctl: cd to nsc store-home
jwtodd Feb 20, 2020
670bed3
fix: nats-account-server deployment template, stan-namespace typo
jwtodd Feb 20, 2020
849eae1
fix: surveyor sys.creds, stan namespace, mds to nats egress
jwtodd Feb 20, 2020
72af09c
mdctl: s/pause-kubectl=45/pause-kubectl=60/
jwtodd Feb 21, 2020
61c2409
mdsctl: provide config overlay for profile(s)
jwtodd Feb 21, 2020
a241276
mdsctl: cleanup nsc/credentials conf
jwtodd Feb 22, 2020
cad71ec
mdsctl: support credential store config modality
jwtodd Feb 22, 2020
0801b8c
mdsctl: nsc install cleanup
jwtodd Feb 22, 2020
a80ffbf
patch
jwtodd Feb 22, 2020
cf80c61
container-images: patch for removed -c:foo=bar syntax
jwtodd Feb 22, 2020
178f5cb
diags: first cut at an agency->nats->processors sequence diag
jwtodd Feb 22, 2020
e21ca2e
mdsctl: natsbox configured to leverage surveyor creds, update readme …
jwtodd Feb 24, 2020
7a9eeb6
mdsctl: zip 'n ship nas operator data
jwtodd Feb 25, 2020
062a294
mdsctl: nas u/d
jwtodd Feb 25, 2020
6906abe
nats: rbac=false, split out 1x nats-init from nats-operator
jwtodd Feb 27, 2020
c152611
Merge branch 'develop' into feature/jwtodd-surveyor
jwtodd Feb 27, 2020
3a08d69
nats: deploys to aws:individual-developers
jwtodd Feb 27, 2020
3d219b3
nats: support no-nats deployments
jwtodd Feb 28, 2020
dc25569
surveyor-prometheus now starts up
jwtodd Feb 29, 2020
9cebdc6
mdsctl: better support of simulator operatsions, add values to nats-s…
jwtodd Mar 2, 2020
8602a9b
simple prometheus nats pub/sub event counter; next: figure out how to…
jwtodd Mar 2, 2020
d0a2d4c
bit more prometheus
jwtodd Mar 3, 2020
e950f15
nats: isolated without surveyor (credentials)
jwtodd Mar 4, 2020
2b0312e
mdsctl: override default nats namespace
jwtodd Mar 4, 2020
1b2cc47
remote
jwtodd Mar 5, 2020
9b21c23
mdsctl: conditionally leverage cloud-ops infra
jwtodd Mar 7, 2020
06bc61d
mdsctl: install mds w/ cloud-ops env cleanup
jwtodd Mar 7, 2020
23317ca
mdsctl: glob helm unittest
jwtodd Mar 7, 2020
ad88dfa
Merge branch 'develop' into feature/jwtodd-surveyor
jwtodd Mar 7, 2020
be77ca0
mds/values: comment out ( geography-author, jurisdiction) until image…
jwtodd Mar 9, 2020
45c5be5
fix build image: jurisdiction,geography-author
jwtodd Mar 9, 2020
cca0a96
nats-streaming: change pvc from 20G->11G
jwtodd Mar 10, 2020
19018c2
nit
jwtodd Mar 10, 2020
6f43d78
mdsctl: put pg/pwd back in for local deploy
jwtodd Mar 10, 2020
90532bf
working through deploying nats/stan to non-default ns
jwtodd Mar 11, 2020
e49bfaf
Merge branch 'develop' into feature/jwtodd-surveyor
jwtodd Mar 31, 2020
9fbce17
drop nats-operator
jwtodd Mar 31, 2020
f5f63d7
drop helm/nats-streaming-server chart
jwtodd Apr 4, 2020
a3ece00
s/stan-creds/nats-creds/g
jwtodd Apr 4, 2020
367f739
Merge branch 'develop' into feature/jwtodd-surveyor
jwtodd Apr 4, 2020
712d4e4
Merge branch 'develop' into feature/jwtodd-surveyor
jwtodd Apr 7, 2020
bdcee3d
more stann cleanup
jwtodd Apr 10, 2020
56e5156
Merge branch 'develop' into feature/jwtodd-surveyor
jwtodd Apr 10, 2020
456838d
fix: omit operations pre-check
jwtodd Apr 13, 2020
fcfabcb
cleanup
jwtodd Apr 13, 2020
9da24c5
Merge branch 'develop' into feature/jwtodd-surveyor
jwtodd Apr 13, 2020
963f209
fix mds-telemetry buildImage
jwtodd Apr 13, 2020
3c830e3
patch deployment.yaml with conditional nats block
jwtodd Apr 13, 2020
35fd5ba
Merge branch 'develop' into feature/jwtodd-surveyor
jwtodd Apr 14, 2020
6d64df9
patch: (alex) re-imagined service-deployment-status check
jwtodd Apr 14, 2020
887d74c
better helm-repo-up
jwtodd Apr 17, 2020
a63840c
u/d package.json, yarn.lock
jwtodd Apr 17, 2020
e54cb5a
Merge branch 'develop' into feature/jwtodd-surveyor
jwtodd Apr 17, 2020
759499c
kick build
jwtodd Apr 17, 2020
bb73947
Merge branch 'develop' into feature/jwtodd-surveyor
avatarneil Apr 17, 2020
1655251
Remove lingering mds-config artifacts
avatarneil Apr 17, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,10 @@ Verify:
In order to build and operate MDS, a number of suporting technologies are leveraged by ensuring they are installed and operational via a one-time `bootstap` process:

```sh
% ./bin/mdsctl bootstrap
% ./bin/mdsctl -p local bootstrap
```

The principle tools are: [homebrew](https://brew.sh), [bash-4.x+](https://www.gnu.org/software/bash/), [oq](https://github.com/Blacksmoke16/oq), [jq](https://stedolan.github.io/jq/), [yarn](https://yarnpkg.com/), [nvm](https://github.com/nvm-sh/nvm), [helm-2.14.1](https://helm.sh), [k9s](https://github.com/derailed/k9s), [kubectx](https://github.com/ahmetb/kubectx), [git](https://git-scm.com/), [gcloud](https://cloud.google.com/sdk/) and [awscli](https://aws.amazon.com/cli/). Additionally the following services are provisioned: [istio](https://istio.io) and [nats](https://nats.io).
The principle tools are: [homebrew](https://brew.sh), [bash-4.x+](https://www.gnu.org/software/bash/), [oq](https://github.com/Blacksmoke16/oq), [jq](https://stedolan.github.io/jq/), [yarn](https://yarnpkg.com/), [nvm](https://github.com/nvm-sh/nvm), [helm-2.14.1](https://helm.sh), [k9s](https://github.com/derailed/k9s), [kubectx](https://github.com/ahmetb/kubectx), [nsc](https://docs.nats.io/nats-tools/nsc), [git](https://git-scm.com/), [gcloud](https://cloud.google.com/sdk/) and [awscli](https://aws.amazon.com/cli/). Additionally the following services are provisioned: [istio](https://istio.io) and [nats](https://nats.io).

Verify:

Expand Down Expand Up @@ -221,7 +221,7 @@ Verify:
(tbd: ?best profile?)

```sh
% ./bin/mdsctl -p minimal install:mds
% ./bin/mdsctl -p processors install:mds
```

Verify:
Expand Down
526 changes: 446 additions & 80 deletions bin/mdsctl

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion container-images/mds-agency/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"scripts": {
"build": "tsc --build tsconfig.build.json",
"bundle": "yarn build && webpack --mode=production --env.npm_package_name=${npm_package_name} --env.npm_package_version=${npm_package_version}",
"image": "yarn bundle && ../../bin/mdsctl -c:image-name=mds-agency:${npm_package_version} buildImage",
"image": "yarn bundle && ../../bin/mdsctl -c image-name=mds-agency:${npm_package_version} buildImage",
"start": "yarn watch server",
"test": "yarn test:eslint && yarn test:unit",
"test:eslint": "eslint --fix --ignore-path ../../.gitignore '**/*.ts'",
Expand Down
2 changes: 1 addition & 1 deletion container-images/mds-audit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"scripts": {
"build": "tsc --build tsconfig.build.json",
"bundle": "yarn build && webpack --mode=production --env.npm_package_name=${npm_package_name} --env.npm_package_version=${npm_package_version}",
"image": "yarn bundle && ../../bin/mdsctl -c:image-name=mds-audit:${npm_package_version} buildImage",
"image": "yarn bundle && ../../bin/mdsctl -c image-name=mds-audit:${npm_package_version} buildImage",
"start": "yarn watch server",
"test": "yarn test:eslint && yarn test:unit",
"test:eslint": "eslint --fix --ignore-path ../../.gitignore '**/*.ts'",
Expand Down
2 changes: 1 addition & 1 deletion container-images/mds-compliance/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"scripts": {
"build": "tsc --build tsconfig.build.json",
"bundle": "yarn build && webpack --mode=production --env.npm_package_name=${npm_package_name} --env.npm_package_version=${npm_package_version}",
"image": "yarn bundle && ../../bin/mdsctl -c:image-name=mds-compliance:${npm_package_version} buildImage",
"image": "yarn bundle && ../../bin/mdsctl -c image-name=mds-compliance:${npm_package_version} buildImage",
"start": "yarn watch server",
"test": "yarn test:eslint && yarn test:unit",
"test:eslint": "eslint --fix --ignore-path ../../.gitignore '**/*.ts'",
Expand Down
2 changes: 1 addition & 1 deletion container-images/mds-daily/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"scripts": {
"build": "tsc --build tsconfig.build.json",
"bundle": "yarn build && webpack --mode=production --env.npm_package_name=${npm_package_name} --env.npm_package_version=${npm_package_version}",
"image": "yarn bundle && ../../bin/mdsctl -c:image-name=mds-daily:${npm_package_version} buildImage",
"image": "yarn bundle && ../../bin/mdsctl -c image-name=mds-daily:${npm_package_version} buildImage",
"start": "yarn watch server",
"test": "yarn test:eslint && yarn test:unit",
"test:eslint": "eslint --fix --ignore-path ../../.gitignore '**/*.ts'",
Expand Down
2 changes: 1 addition & 1 deletion container-images/mds-event-processor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"scripts": {
"build": "tsc --build tsconfig.build.json",
"bundle": "yarn build && webpack --mode=production --env.npm_package_name=${npm_package_name} --env.npm_package_version=${npm_package_version}",
"image": "yarn bundle && ../../bin/mdsctl -c:image-name=mds-event-processor:${npm_package_version} buildImage",
"image": "yarn bundle && ../../bin/mdsctl -c image-name=mds-event-processor:${npm_package_version} buildImage",
"start": "yarn watch server",
"test": "yarn test:eslint && yarn test:unit",
"test:eslint": "eslint --fix --ignore-path ../../.gitignore '**/*.ts'",
Expand Down
2 changes: 1 addition & 1 deletion container-images/mds-geography-author/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"scripts": {
"build": "tsc --build tsconfig.build.json",
"bundle": "yarn build && webpack --mode=production --env.npm_package_name=${npm_package_name} --env.npm_package_version=${npm_package_version}",
"image": "yarn bundle && ../../bin/mdsctl -c:image-name=mds-geography-author:${npm_package_version} buildImage",
"image": "yarn bundle && ../../bin/mdsctl -c image-name=mds-geography-author:${npm_package_version} buildImage",
"start": "yarn watch server",
"test": "yarn test:eslint && yarn test:unit",
"test:eslint": "eslint --fix --ignore-path ../../.gitignore '**/*.ts'",
Expand Down
4 changes: 2 additions & 2 deletions container-images/mds-geography/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"scripts": {
"build": "tsc --build tsconfig.build.json",
"bundle": "yarn build && webpack --mode=production --env.npm_package_name=${npm_package_name} --env.npm_package_version=${npm_package_version}",
"image": "yarn bundle && ../../bin/mdsctl -c:image-name=mds-geography:${npm_package_version} buildImage",
"image": "yarn bundle && ../../bin/mdsctl -c image-name=mds-geography:${npm_package_version} buildImage",
"start": "yarn watch server",
"test": "yarn test:eslint && yarn test:unit",
"test:eslint": "eslint --fix --ignore-path ../../.gitignore '**/*.ts'",
Expand All @@ -25,4 +25,4 @@
"@mds-core/mds-geography": "0.0.1"
},
"license": "Apache-2.0"
}
}
2 changes: 1 addition & 1 deletion container-images/mds-jurisdiction/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"scripts": {
"build": "tsc --build tsconfig.build.json",
"bundle": "yarn build && webpack --mode=production --env.npm_package_name=${npm_package_name} --env.npm_package_version=${npm_package_version}",
"image": "yarn bundle && ../../bin/mdsctl -c:image-name=mds-jurisdiction:${npm_package_version} buildImage",
"image": "yarn bundle && ../../bin/mdsctl -c image-name=mds-jurisdiction:${npm_package_version} buildImage",
"start": "yarn watch server",
"test": "yarn test:eslint && yarn test:unit",
"test:eslint": "eslint --fix --ignore-path ../../.gitignore '**/*.ts'",
Expand Down
2 changes: 1 addition & 1 deletion container-images/mds-metrics-sheet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"scripts": {
"build": "tsc --build tsconfig.build.json",
"bundle": "yarn build && webpack --mode=production --env.npm_package_name=${npm_package_name} --env.npm_package_version=${npm_package_version}",
"image": "yarn bundle && ../../bin/mdsctl -c:image-name=mds-metrics-sheet:${npm_package_version} buildImage",
"image": "yarn bundle && ../../bin/mdsctl -c image-name=mds-metrics-sheet:${npm_package_version} buildImage",
"test": "yarn test:eslint && yarn test:unit",
"test:eslint": "eslint --fix --ignore-path ../../.gitignore '**/*.ts'",
"test:unit": "exit 0"
Expand Down
2 changes: 1 addition & 1 deletion container-images/mds-policy-author/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"scripts": {
"build": "tsc --build tsconfig.build.json",
"bundle": "yarn build && webpack --mode=production --env.npm_package_name=${npm_package_name} --env.npm_package_version=${npm_package_version}",
"image": "yarn bundle && ../../bin/mdsctl -c:image-name=mds-policy-author:${npm_package_version} buildImage",
"image": "yarn bundle && ../../bin/mdsctl -c image-name=mds-policy-author:${npm_package_version} buildImage",
"start": "yarn watch server",
"test": "yarn test:eslint && yarn test:unit",
"test:eslint": "eslint --fix --ignore-path ../../.gitignore '**/*.ts'",
Expand Down
2 changes: 1 addition & 1 deletion container-images/mds-policy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"scripts": {
"build": "tsc --build tsconfig.build.json",
"bundle": "yarn build && webpack --mode=production --env.npm_package_name=${npm_package_name} --env.npm_package_version=${npm_package_version}",
"image": "yarn bundle && ../../bin/mdsctl -c:image-name=mds-policy:${npm_package_version} buildImage",
"image": "yarn bundle && ../../bin/mdsctl -c image-name=mds-policy:${npm_package_version} buildImage",
"start": "yarn watch server",
"test": "yarn test:eslint && yarn test:unit",
"test:eslint": "eslint --fix --ignore-path ../../.gitignore '**/*.ts'",
Expand Down
2 changes: 1 addition & 1 deletion container-images/mds-telemetry-processor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"scripts": {
"build": "tsc --build tsconfig.build.json",
"bundle": "yarn build && webpack --mode=production --env.npm_package_name=${npm_package_name} --env.npm_package_version=${npm_package_version}",
"image": "yarn bundle && ../../bin/mdsctl -c:image-name=mds-telemetry-processor:${npm_package_version} buildImage",
"image": "yarn bundle && ../../bin/mdsctl -c image-name=mds-telemetry-processor:${npm_package_version} buildImage",
"start": "yarn watch server",
"test": "yarn test:eslint && yarn test:unit",
"test:eslint": "eslint --fix --ignore-path ../../.gitignore '**/*.ts'",
Expand Down
2 changes: 1 addition & 1 deletion container-images/mds-web-sockets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"scripts": {
"build": "tsc --build tsconfig.build.json",
"bundle": "yarn build && webpack --mode=production --env.npm_package_name=${npm_package_name} --env.npm_package_version=${npm_package_version}",
"image": "yarn bundle && ../../bin/mdsctl -c:image-name=mds-web-sockets:${npm_package_version} buildImage",
"image": "yarn bundle && ../../bin/mdsctl -c image-name=mds-web-sockets:${npm_package_version} buildImage",
"start": "yarn watch server",
"test": "yarn test:eslint && yarn test:unit",
"test:eslint": "eslint --fix --ignore-path ../../.gitignore '**/*.ts'",
Expand Down
7 changes: 7 additions & 0 deletions helm/curl/templates/pod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ spec:
# This could be any image that we can SSH into and has curl.
- image: radial/busyboxplus:curl
imagePullPolicy: IfNotPresent
resources:
limits:
cpu: {{ $.Values.resourcesLimitsCpu | default "500m" }}
memory: {{ $.Values.resourcesLimitsMemory | default "512Mi" }}
requests:
cpu: {{ $.Values.resourcesRequestsCpu | default "50m" }}
memory: {{ $.Values.resourcesRequestsMemory | default "128Mi" }}
name: curl
resources: {}
stdin: true
Expand Down
7 changes: 7 additions & 0 deletions helm/dns/templates/pod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ spec:
containers:
- name: busybox
image: busybox:1.28
resources:
limits:
cpu: {{ $.Values.resourcesLimitsCpu | default "500m" }}
memory: {{ $.Values.resourcesLimitsMemory | default "512Mi" }}
requests:
cpu: {{ $.Values.resourcesRequestsCpu | default "50m" }}
memory: {{ $.Values.resourcesRequestsMemory | default "128Mi" }}
command:
- sleep
- "3600"
Expand Down
33 changes: 28 additions & 5 deletions helm/mds/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ spec:
labels:
app: {{ $name }}
spec:
volumes:
{{- if and $.Values.nats.enabled $.Values.nats.credentials }}
- name: creds-volume
secret:
secretName: nats-creds
{{- end }}
containers:
- name: {{ $name }}
image: {{ if $.Values.registry }}{{ printf "%s/" $.Values.registry }}{{- end}}{{ $name }}:{{ $api.version }}
Expand All @@ -35,6 +41,11 @@ spec:
- containerPort: 4000
name: user-port
protocol: TCP
volumeMounts:
{{- if and $.Values.nats.enabled $.Values.nats.credentials }}
- name: creds-volume
mountPath: /var/run/nats/secrets
{{- end }}
env:
- name: PORT
value: "4000"
Expand All @@ -53,7 +64,7 @@ spec:
key: postgresql-password
- name: PG_HOST
{{- if $.Values.postgresql.internal }}
value: {{ $.Release.Namespace }}-postgresql.{{ $.Release.Namespace }}.svc.cluster.local
value: {{ $.Release.Name }}-postgresql.{{ $.Release.Namespace }}.svc.cluster.local
{{- else }}
value: {{ $.Values.postgresql.host }}
{{- end }}
Expand All @@ -71,16 +82,17 @@ spec:
{{- end }}
- name: REDIS_HOST
{{- if $.Values.redis.internal }}
value: {{ $.Release.Namespace }}-redis-master.{{ $.Release.Namespace }}.svc.cluster.local
value: {{ $.Release.Name }}-redis-master.{{ $.Release.Namespace }}.svc.cluster.local
{{- else }}
value: {{ $.Values.redis.host }}
{{- end }}
- name: REDIS_PORT
value: {{ $.Values.redis.port | quote }}
{{- if $.Values.nats.enabled }}
- name: NATS
value: nats.{{ default "nats" $.Values.natsNamespace }}.svc.cluster.local
- name: STAN_CLUSTER
value: nats-streaming
value: {{ default "nats" $.Values.natsNamespace }}-nats-server.{{ default "nats" $.Values.natsNamespace }}.svc.cluster.local
# value: nats-cluster-mgmt.{{ default "nats" $.Values.natsNamespace }}.svc.cluster.local
{{- end }}
- name: KAFKA_HOST
value: host.docker.internal:9092
- name: TENANT_ID
Expand Down Expand Up @@ -122,3 +134,14 @@ data:
postgresql-password: {{ .Values.postgresql.password | b64enc }}
{{- end }}
type: Opaque
{{- if and $.Values.nats.enabled $.Values.nats.credentials }}
---
apiVersion: v1
kind: Secret
metadata:
name: nats-creds
namespace: {{ $.Release.Namespace }}
data:
sys.creds: {{ $.Values.nats | b64enc }}
type: Opaque
{{- end }}
4 changes: 3 additions & 1 deletion helm/mds/templates/egress.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if $.Values.nats.enabled }}
{{- $natsNamespace := default "nats" .Values.natsNamespace }}
apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
Expand All @@ -6,7 +7,7 @@ metadata:
namespace: {{ .Release.Namespace }}
spec:
hosts:
- {{ printf "nats.%s.svc.cluster.local" $natsNamespace }}
- {{ printf "%s-nats-server.%s.svc.cluster.local" $natsNamespace $natsNamespace }}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering about this - why does the nats namespace also get prefixed to the service name? seems redundant.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah we could fix/reduce the redundancy.

this might appear in other templates as well so we should be consistent regardless.

likely just picked the pattern up and continued using it.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should actually just pick up the nats endpoint name from .Values.natsUrl or something like that. We shouldn't be trying to construct what the endpoint is from a different software install. What if we're using an external (hosted) nats server for example? I'd recommend to replace .Values.natsNamespace with .Values.natsUrl

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'd like to push this to a subsequent incremental patch given as implemented it follows the current conventions for cluster-hosted endpoint resolution

ports:
- number: 4222
name: client
Expand All @@ -24,6 +25,7 @@ spec:
tls:
mode: DISABLE
---
{{- end }}
{{- if (eq .Values.postgresql.internal false) }}
apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
Expand Down
3 changes: 3 additions & 0 deletions helm/mds/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ apis:
enabled: true
version: latest
migration: false
nats:
enabled: true
credentials: false
tenantId:
timezone: America/Los_Angeles
registry:
Expand Down
5 changes: 5 additions & 0 deletions helm/nats-account-server/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v1
appVersion: '0.4.0'
description: NATS Account Server
name: nats-account-server
version: 0.8.4
73 changes: 73 additions & 0 deletions helm/nats-account-server/templates/nats-account-server.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nats-account-server
namespace: {{ $.Release.Namespace | default "default" }}
labels:
app: nats-account-server
annotations:
sidecar.istio.io/inject: 'false'
spec:
replicas: 1
selector:
matchLabels:
app: nats-account-server
template:
metadata:
labels:
app: nats-account-server
spec:
initContainers:
- name: nats-operator-data
image: busybox:1.28
command:
- 'unzip'
- '/tmp/nats-operator-data.zip'
- '-d'
- '/nsc-operator'
volumeMounts:
- mountPath: /nsc-operator
name: nsc-operator
- mountPath: /tmp
name: nsc-operator-data
containers:
- name: nats-account-server
image: synadia/nats-account-server:0.8.4
imagePullPolicy: Always
resources:
limits:
cpu: {{ $.Values.resourcesLimitsCpu | default "500m" }}
memory: {{ $.Values.resourcesLimitsMemory | default "512Mi" }}
requests:
cpu: {{ $.Values.resourcesRequestsCpu | default "50m" }}
memory: {{ $.Values.resourcesRequestsMemory | default "128Mi" }}
volumeMounts:
- name: nsc-operator
mountPath: /nsc-operator
command:
- 'nats-account-server'
- '-DV'
- '-hp'
- '0.0.0.0:9090'
- '-nsc'
- '/nsc-operator/KO'
volumes:
- name: nsc-operator
emptyDir: {}
- name: nsc-operator-data
configMap:
name: nats-operator-data
---
apiVersion: v1
kind: Service
metadata:
name: nats-account-server
namespace: {{ $.Release.Namespace | default "default" }}
spec:
selector:
app: nats-account-server
ports:
- name: http-nats-account-server
port: 80
targetPort: 9090
Loading