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

Allow starting services in read-only mode #228

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions charts/tidepool/charts/auth/templates/0-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ data:
AppleDeviceCheckKeyId: {{ .AppleDeviceCheckKeyId | default "" }}
AppleDeviceCheckKeyIssuer: {{ .AppleDeviceCheckKeyIssuer | default "" }}
AppleDeviceCheckUseDevelopment: "{{ .AppleDeviceCheckUseDevelopment | default "true" }}"
UserEventsHandlerDisable: "{{ .UserEventsHandlerDisable | default "false" }}"
{{- end }}
8 changes: 7 additions & 1 deletion charts/tidepool/charts/auth/templates/1-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ spec:
app: auth
app.kubernetes.io/name: {{ include "charts.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
replicas: {{ .Values.deployment.replicas | default 1 }}
replicas: {{ .Values.deployment.replicas }}
strategy: {}
template:
metadata:
Expand Down Expand Up @@ -87,6 +87,12 @@ spec:
name: dexcom
key: StateSalt
optional: true
- name: TIDEPOOL_AUTH_SERVICE_USER_EVENTS_HANDLER_DISABLE
valueFrom:
configMapKeyRef:
name: auth
key: UserEventsHandlerDisable
optional: true
- name: TIDEPOOL_AUTH_SERVICE_DOMAIN
value: {{ .Values.global.gateway.default.domain }}
- name: TIDEPOOL_AUTH_SERVICE_SERVER_ADDRESS
Expand Down
1 change: 1 addition & 0 deletions charts/tidepool/charts/auth/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ configmap:
AppleDeviceCheckKeyIssuer: "75U4X84TEG"
AppleDeviceCheckKeyId: "B542R658GF"
AppleDeviceCheckUseDevelopment: "true"
UserEventsHandlerDisable: "false"
deployment:
# -- auth Docker image
image: tidepool/platform-auth:master-latest
Expand Down
6 changes: 6 additions & 0 deletions charts/tidepool/charts/blob/templates/1-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ spec:
{{ include "charts.platform.env.clients" .}}
{{ include "charts.kafka.common" .}}
{{ include "charts.kafka.cloudevents.client" (dict "Values" .Values "Release" .Release "client" "blob") }}
- name: TIDEPOOL_BLOB_SERVICE_USER_EVENTS_HANDLER_DISABLE
valueFrom:
configMapKeyRef:
name: blob
key: UserEventsHandlerDisable
optional: true
- name: TIDEPOOL_BLOB_SERVICE_SECRET
valueFrom:
secretKeyRef:
Expand Down
6 changes: 6 additions & 0 deletions charts/tidepool/charts/data/templates/1-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ spec:
{{ include "charts.platform.env.clients" .}}
{{ include "charts.kafka.common" .}}
{{ include "charts.kafka.cloudevents.client" (dict "Values" .Values "Release" .Release "client" "data") }}
- name: TIDEPOOL_DATA_SERVICE_USER_EVENTS_HANDLER_DISABLE
valueFrom:
configMapKeyRef:
name: data
key: UserEventsHandlerDisable
optional: true
- name: TIDEPOOL_DATA_SERVICE_SECRET
valueFrom:
secretKeyRef:
Expand Down
36 changes: 23 additions & 13 deletions charts/tidepool/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -47,24 +47,28 @@ Create environment variables used by all platform services.
*/}}
}

{{- define "hostname.internal" -}}
{{- .Values.global.hostnames.internal | default (printf "internal-%s" .Release.Namespace) -}}
{{- end -}}

{{ define "charts.platform.env.clients" }}
- name: TIDEPOOL_AUTH_CLIENT_ADDRESS
value: http://auth:{{.Values.global.ports.auth}}
value: http://{{.Values.global.hostnames.auth}}:{{.Values.global.ports.auth}}
- name: TIDEPOOL_AUTH_CLIENT_EXTERNAL_ADDRESS
value: "http://internal.{{.Release.Namespace}}"
value: "http://{{ include "hostname.internal" .}}"
- name: TIDEPOOL_AUTH_CLIENT_EXTERNAL_SERVER_SESSION_TOKEN_SECRET
valueFrom:
secretKeyRef:
name: server
key: ServiceAuth
- name: TIDEPOOL_BLOB_CLIENT_ADDRESS
value: http://blob:{{.Values.global.ports.blob}}
value: http://{{.Values.global.hostnames.blob}}:{{.Values.global.ports.blob}}
- name: TIDEPOOL_DATA_CLIENT_ADDRESS
value: http://data:{{.Values.global.ports.data}}
value: http://{{.Values.global.hostnames.data}}:{{.Values.global.ports.data}}
- name: TIDEPOOL_DATA_SOURCE_CLIENT_ADDRESS
value: http://data:{{.Values.global.ports.data}}
value: http://{{.Values.global.hostnames.data}}:{{.Values.global.ports.data}}
- name: TIDEPOOL_DEVICES_CLIENT_ADDRESS
value: devices:{{.Values.global.ports.devices_grpc}}
value: {{.Values.global.hostnames.devices}}:{{.Values.global.ports.devices_grpc}}
- name: TIDEPOOL_DEXCOM_CLIENT_ADDRESS
valueFrom:
configMapKeyRef:
Expand All @@ -76,17 +80,17 @@ Create environment variables used by all platform services.
name: dexcom
key: AuthorizeURL
- name: TIDEPOOL_METRIC_CLIENT_ADDRESS
value: "http://internal.{{.Release.Namespace}}"
value: "http://{{ include "hostname.internal" .}}"
- name: TIDEPOOL_PERMISSION_CLIENT_ADDRESS
value: http://gatekeeper:{{.Values.global.ports.gatekeeper}}
value: http://{{.Values.global.hostnames.gatekeeper}}:{{.Values.global.ports.gatekeeper}}
- name: TIDEPOOL_CONFIRMATION_CLIENT_ADDRESS
value: "http://hydrophone:{{.Values.global.ports.hydrophone}}"
value: "http://{{.Values.global.hostnames.hydrophone}}:{{.Values.global.ports.hydrophone}}"
- name: TIDEPOOL_TASK_CLIENT_ADDRESS
value: http://task:{{.Values.global.ports.task}}
value: http://{{.Values.global.hostnames.task}}:{{.Values.global.ports.task}}
- name: TIDEPOOL_USER_CLIENT_ADDRESS
value: "http://internal.{{.Release.Namespace}}"
value: "http://{{ include "hostname.internal" .}}"
- name: TIDEPOOL_CLINIC_CLIENT_ADDRESS
value: "http://internal.{{.Release.Namespace}}"
value: "http://{{ include "hostname.internal" .}}"
{{ end }}

{{ define "charts.tracing.common" }}
Expand Down Expand Up @@ -163,6 +167,12 @@ Create environment variables used by all platform services.
{{ include "charts.mongo.params" . }}
- name: TIDEPOOL_STORE_DATABASE
value: tidepool
- name: TIDEPOOL_DISABLE_INDEX_CREATION
valueFrom:
secretKeyRef:
name: {{ .Values.mongo.secretName }}
key: DisabledIndexCreation
optional: true
{{ end }}

{{/*
Expand All @@ -188,7 +198,7 @@ Create liveness and readiness probes for platform services.
{{- define "charts.init.shoreline" -}}
- name: init-shoreline
image: busybox:1.31.1
command: ['sh', '-c', 'until nc -zvv shoreline {{.Values.global.ports.shoreline}}; do echo waiting for shoreline; sleep 2; done;']
command: ['sh', '-c', 'until nc -zvv {{.Values.global.hostnames.shoreline}} {{.Values.global.ports.shoreline}}; do echo waiting for shoreline; sleep 2; done;']
{{- end -}}

{{- define "charts.labels.standard" }}
Expand Down
26 changes: 26 additions & 0 deletions charts/tidepool/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,32 @@ global:
linkerdsupport:
# -- whether to include linkerdsupport subchart with Linkerd service profiles
enabled: true
# -- service hostnames
hostnames:
# -- auth service hostname
auth: "auth"
# -- blob service hostname
blob: "blob"
# -- clinic service hostname
clinic: "clinic"
# -- data service hostname
data: "data"
# -- devices service hostname
devices: "devices"
# -- gatekeeper service hostname
gatekeeper: "gatekeeper"
# -- hydrophone service hostname
hydrophone: "hydrophone"
# -- internal virtual service hostname
internal: "internal"
# -- metric service hostname
metric: "highwater"
# -- shoreline service hostname
shoreline: "shoreline"
# -- task service hostname
task: "task"
# -- user service hostname
user: "user"
ports:
# -- blip service internal port
blip: 31500
Expand Down