Skip to content

Commit 4763230

Browse files
toddkazakovlostlevels
authored andcommitted
Allow starting services in read-only mode (no index creation and no
kafka user events handling)
1 parent b6c7c17 commit 4763230

File tree

7 files changed

+70
-14
lines changed

7 files changed

+70
-14
lines changed

charts/tidepool/charts/auth/templates/0-configmap.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ data:
1212
AppleDeviceCheckKeyId: {{ .AppleDeviceCheckKeyId | default "" }}
1313
AppleDeviceCheckKeyIssuer: {{ .AppleDeviceCheckKeyIssuer | default "" }}
1414
AppleDeviceCheckUseDevelopment: "{{ .AppleDeviceCheckUseDevelopment | default "true" }}"
15+
UserEventsHandlerDisable: "{{ .UserEventsHandlerDisable | default "false" }}"
1516
{{- end }}
1617
{{- end }}

charts/tidepool/charts/auth/templates/1-deployment.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ spec:
1919
app: auth
2020
app.kubernetes.io/name: {{ include "charts.name" . }}
2121
app.kubernetes.io/instance: {{ .Release.Name }}
22-
replicas: {{ .Values.deployment.replicas | default 1 }}
22+
replicas: {{ .Values.deployment.replicas }}
2323
strategy: {}
2424
template:
2525
metadata:
@@ -87,6 +87,12 @@ spec:
8787
name: dexcom
8888
key: StateSalt
8989
optional: true
90+
- name: TIDEPOOL_AUTH_SERVICE_USER_EVENTS_HANDLER_DISABLE
91+
valueFrom:
92+
configMapKeyRef:
93+
name: auth
94+
key: UserEventsHandlerDisable
95+
optional: true
9096
- name: TIDEPOOL_AUTH_SERVICE_DOMAIN
9197
value: {{ .Values.global.gateway.default.domain }}
9298
- name: TIDEPOOL_AUTH_SERVICE_SERVER_ADDRESS

charts/tidepool/charts/auth/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ configmap:
1212
AppleDeviceCheckKeyIssuer: "75U4X84TEG"
1313
AppleDeviceCheckKeyId: "B542R658GF"
1414
AppleDeviceCheckUseDevelopment: "true"
15+
UserEventsHandlerDisable: "false"
1516
deployment:
1617
# -- auth Docker image
1718
image: tidepool/platform-auth:master-latest

charts/tidepool/charts/blob/templates/1-deployment.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ spec:
4949
{{ include "charts.platform.env.clients" .}}
5050
{{ include "charts.kafka.common" .}}
5151
{{ include "charts.kafka.cloudevents.client" (dict "Values" .Values "Release" .Release "client" "blob") }}
52+
- name: TIDEPOOL_BLOB_SERVICE_USER_EVENTS_HANDLER_DISABLE
53+
valueFrom:
54+
configMapKeyRef:
55+
name: blob
56+
key: UserEventsHandlerDisable
57+
optional: true
5258
- name: TIDEPOOL_BLOB_SERVICE_SECRET
5359
valueFrom:
5460
secretKeyRef:

charts/tidepool/charts/data/templates/1-deployment.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ spec:
4444
{{ include "charts.platform.env.clients" .}}
4545
{{ include "charts.kafka.common" .}}
4646
{{ include "charts.kafka.cloudevents.client" (dict "Values" .Values "Release" .Release "client" "data") }}
47+
- name: TIDEPOOL_DATA_SERVICE_USER_EVENTS_HANDLER_DISABLE
48+
valueFrom:
49+
configMapKeyRef:
50+
name: data
51+
key: UserEventsHandlerDisable
52+
optional: true
4753
- name: TIDEPOOL_DATA_SERVICE_SECRET
4854
valueFrom:
4955
secretKeyRef:

charts/tidepool/templates/_helpers.tpl

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,24 +51,28 @@ Create environment variables used by all platform services.
5151
*/}}
5252
}
5353

54+
{{- define "hostname.internal" -}}
55+
{{- .Values.global.hostnames.internal | default (printf "internal-%s" .Release.Namespace) -}}
56+
{{- end -}}
57+
5458
{{ define "charts.platform.env.clients" }}
5559
- name: TIDEPOOL_AUTH_CLIENT_ADDRESS
56-
value: http://auth:{{.Values.global.ports.auth}}
60+
value: http://{{.Values.global.hostnames.auth}}:{{.Values.global.ports.auth}}
5761
- name: TIDEPOOL_AUTH_CLIENT_EXTERNAL_ADDRESS
58-
value: "http://internal.{{.Release.Namespace}}"
62+
value: "http://{{ include "hostname.internal" .}}"
5963
- name: TIDEPOOL_AUTH_CLIENT_EXTERNAL_SERVER_SESSION_TOKEN_SECRET
6064
valueFrom:
6165
secretKeyRef:
6266
name: server
6367
key: ServiceAuth
6468
- name: TIDEPOOL_BLOB_CLIENT_ADDRESS
65-
value: http://blob:{{.Values.global.ports.blob}}
69+
value: http://{{.Values.global.hostnames.blob}}:{{.Values.global.ports.blob}}
6670
- name: TIDEPOOL_DATA_CLIENT_ADDRESS
67-
value: http://data:{{.Values.global.ports.data}}
71+
value: http://{{.Values.global.hostnames.data}}:{{.Values.global.ports.data}}
6872
- name: TIDEPOOL_DATA_SOURCE_CLIENT_ADDRESS
69-
value: http://data:{{.Values.global.ports.data}}
73+
value: http://{{.Values.global.hostnames.data}}:{{.Values.global.ports.data}}
7074
- name: TIDEPOOL_DEVICES_CLIENT_ADDRESS
71-
value: devices:{{.Values.global.ports.devices_grpc}}
75+
value: {{.Values.global.hostnames.devices}}:{{.Values.global.ports.devices_grpc}}
7276
- name: TIDEPOOL_DEXCOM_CLIENT_ADDRESS
7377
valueFrom:
7478
configMapKeyRef:
@@ -80,17 +84,17 @@ Create environment variables used by all platform services.
8084
name: dexcom
8185
key: AuthorizeURL
8286
- name: TIDEPOOL_METRIC_CLIENT_ADDRESS
83-
value: "http://internal.{{.Release.Namespace}}"
87+
value: "http://{{ include "hostname.internal" .}}"
8488
- name: TIDEPOOL_PERMISSION_CLIENT_ADDRESS
85-
value: http://gatekeeper:{{.Values.global.ports.gatekeeper}}
89+
value: http://{{.Values.global.hostnames.gatekeeper}}:{{.Values.global.ports.gatekeeper}}
8690
- name: TIDEPOOL_CONFIRMATION_CLIENT_ADDRESS
87-
value: "http://hydrophone:{{.Values.global.ports.hydrophone}}"
91+
value: "http://{{.Values.global.hostnames.hydrophone}}:{{.Values.global.ports.hydrophone}}"
8892
- name: TIDEPOOL_TASK_CLIENT_ADDRESS
89-
value: http://task:{{.Values.global.ports.task}}
93+
value: http://{{.Values.global.hostnames.task}}:{{.Values.global.ports.task}}
9094
- name: TIDEPOOL_USER_CLIENT_ADDRESS
91-
value: "http://internal.{{.Release.Namespace}}"
95+
value: "http://{{ include "hostname.internal" .}}"
9296
- name: TIDEPOOL_CLINIC_CLIENT_ADDRESS
93-
value: "http://internal.{{.Release.Namespace}}"
97+
value: "http://{{ include "hostname.internal" .}}"
9498
{{ end }}
9599

96100
{{ define "charts.tracing.common" }}
@@ -167,6 +171,12 @@ Create environment variables used by all platform services.
167171
{{ include "charts.mongo.params" . }}
168172
- name: TIDEPOOL_STORE_DATABASE
169173
value: tidepool
174+
- name: TIDEPOOL_DISABLE_INDEX_CREATION
175+
valueFrom:
176+
secretKeyRef:
177+
name: {{ .Values.mongo.secretName }}
178+
key: DisabledIndexCreation
179+
optional: true
170180
{{ end }}
171181

172182
{{- define "charts.routing.opts.shadowing" -}}
@@ -200,7 +210,7 @@ Create liveness and readiness probes for platform services.
200210
{{- define "charts.init.shoreline" -}}
201211
- name: init-shoreline
202212
image: busybox:1.31.1
203-
command: ['sh', '-c', 'until nc -zvv shoreline {{.Values.global.ports.shoreline}}; do echo waiting for shoreline; sleep 2; done;']
213+
command: ['sh', '-c', 'until nc -zvv {{.Values.global.hostnames.shoreline}} {{.Values.global.ports.shoreline}}; do echo waiting for shoreline; sleep 2; done;']
204214
{{- end -}}
205215

206216
{{- define "charts.labels.standard" }}

charts/tidepool/values.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,32 @@ global:
5656
linkerdsupport:
5757
# -- whether to include linkerdsupport subchart with Linkerd service profiles
5858
enabled: true
59+
# -- service hostnames
60+
hostnames:
61+
# -- auth service hostname
62+
auth: "auth"
63+
# -- blob service hostname
64+
blob: "blob"
65+
# -- clinic service hostname
66+
clinic: "clinic"
67+
# -- data service hostname
68+
data: "data"
69+
# -- devices service hostname
70+
devices: "devices"
71+
# -- gatekeeper service hostname
72+
gatekeeper: "gatekeeper"
73+
# -- hydrophone service hostname
74+
hydrophone: "hydrophone"
75+
# -- internal virtual service hostname
76+
internal: "internal"
77+
# -- metric service hostname
78+
metric: "highwater"
79+
# -- shoreline service hostname
80+
shoreline: "shoreline"
81+
# -- task service hostname
82+
task: "task"
83+
# -- user service hostname
84+
user: "user"
5985
ports:
6086
# -- blip service internal port
6187
blip: 31500

0 commit comments

Comments
 (0)