Skip to content

Commit

Permalink
Implement gRPC Health Protocol. #47
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgevillaverde-sitewhere committed May 15, 2019
1 parent 1073ed7 commit f06cc0b
Show file tree
Hide file tree
Showing 20 changed files with 178 additions and 0 deletions.
9 changes: 9 additions & 0 deletions charts/sitewhere/templates/Asset-Management.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ spec:
requests:
memory: {{ .Values.services.asset_management.resources.requests.memory | default .Values.services.resources.requests.memory | quote }}
cpu: {{ .Values.services.asset_management.resources.requests.cpu | default .Values.services.resources.requests.cpu | quote }}
readinessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:{{ .Values.services.health.port }}"]
initialDelaySeconds: {{ .Values.services.health.readinessProbe.initialDelay }}
livenessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:{{ .Values.services.health.port }}"]
initialDelaySeconds: {{ .Values.services.health.livenessProbe.initialDelay }}
periodSeconds: {{ .Values.services.health.livenessProbe.periodSeconds }}
---
apiVersion: v1
kind: Service
Expand Down
9 changes: 9 additions & 0 deletions charts/sitewhere/templates/Batch-Operations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ spec:
requests:
memory: {{ .Values.services.batch_operations.resources.requests.memory | default .Values.services.resources.requests.memory | quote }}
cpu: {{ .Values.services.batch_operations.resources.requests.cpu | default .Values.services.resources.requests.cpu | quote }}
readinessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:{{ .Values.services.health.port }}"]
initialDelaySeconds: {{ .Values.services.health.readinessProbe.initialDelay }}
livenessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:{{ .Values.services.health.port }}"]
initialDelaySeconds: {{ .Values.services.health.livenessProbe.initialDelay }}
periodSeconds: {{ .Values.services.health.livenessProbe.periodSeconds }}
---
apiVersion: v1
kind: Service
Expand Down
9 changes: 9 additions & 0 deletions charts/sitewhere/templates/Command-Delivery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ spec:
requests:
memory: {{ .Values.services.command_delivery.resources.requests.memory | default .Values.services.resources.requests.memory | quote }}
cpu: {{ .Values.services.command_delivery.resources.requests.cpu | default .Values.services.resources.requests.cpu | quote }}
readinessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:{{ .Values.services.health.port }}"]
initialDelaySeconds: {{ .Values.services.health.readinessProbe.initialDelay }}
livenessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:{{ .Values.services.health.port }}"]
initialDelaySeconds: {{ .Values.services.health.livenessProbe.initialDelay }}
periodSeconds: {{ .Values.services.health.livenessProbe.periodSeconds }}
---
apiVersion: v1
kind: Service
Expand Down
9 changes: 9 additions & 0 deletions charts/sitewhere/templates/Device-Management.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ spec:
requests:
memory: {{ .Values.services.device_management.resources.requests.memory | default .Values.services.resources.requests.memory | quote }}
cpu: {{ .Values.services.device_management.resources.requests.cpu | default .Values.services.resources.requests.cpu | quote }}
readinessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:{{ .Values.services.health.port }}"]
initialDelaySeconds: {{ .Values.services.health.readinessProbe.initialDelay }}
livenessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:{{ .Values.services.health.port }}"]
initialDelaySeconds: {{ .Values.services.health.livenessProbe.initialDelay }}
periodSeconds: {{ .Values.services.health.livenessProbe.periodSeconds }}
---
apiVersion: v1
kind: Service
Expand Down
9 changes: 9 additions & 0 deletions charts/sitewhere/templates/Device-Registration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ spec:
requests:
memory: {{ .Values.services.device_registration.resources.requests.memory | default .Values.services.resources.requests.memory | quote }}
cpu: {{ .Values.services.device_registration.resources.requests.cpu | default .Values.services.resources.requests.cpu | quote }}
readinessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:{{ .Values.services.health.port }}"]
initialDelaySeconds: {{ .Values.services.health.readinessProbe.initialDelay }}
livenessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:{{ .Values.services.health.port }}"]
initialDelaySeconds: {{ .Values.services.health.livenessProbe.initialDelay }}
periodSeconds: {{ .Values.services.health.livenessProbe.periodSeconds }}
---
apiVersion: v1
kind: Service
Expand Down
9 changes: 9 additions & 0 deletions charts/sitewhere/templates/Device-State.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ spec:
requests:
memory: {{ .Values.services.device_state.resources.requests.memory | default .Values.services.resources.requests.memory | quote }}
cpu: {{ .Values.services.device_state.resources.requests.cpu | default .Values.services.resources.requests.cpu | quote }}
readinessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:{{ .Values.services.health.port }}"]
initialDelaySeconds: {{ .Values.services.health.readinessProbe.initialDelay }}
livenessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:{{ .Values.services.health.port }}"]
initialDelaySeconds: {{ .Values.services.health.livenessProbe.initialDelay }}
periodSeconds: {{ .Values.services.health.livenessProbe.periodSeconds }}
---
apiVersion: v1
kind: Service
Expand Down
9 changes: 9 additions & 0 deletions charts/sitewhere/templates/Event-Management.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ spec:
requests:
memory: {{ .Values.services.event_management.resources.requests.memory | default .Values.services.resources.requests.memory | quote }}
cpu: {{ .Values.services.event_management.resources.requests.cpu | default .Values.services.resources.requests.cpu | quote }}
readinessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:{{ .Values.services.health.port }}"]
initialDelaySeconds: {{ .Values.services.health.readinessProbe.initialDelay }}
livenessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:{{ .Values.services.health.port }}"]
initialDelaySeconds: {{ .Values.services.health.livenessProbe.initialDelay }}
periodSeconds: {{ .Values.services.health.livenessProbe.periodSeconds }}
---
apiVersion: v1
kind: Service
Expand Down
9 changes: 9 additions & 0 deletions charts/sitewhere/templates/Event-Search.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ spec:
requests:
memory: {{ .Values.services.event_search.resources.requests.memory | default .Values.services.resources.requests.memory | quote }}
cpu: {{ .Values.services.event_search.resources.requests.cpu | default .Values.services.resources.requests.cpu | quote }}
readinessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:{{ .Values.services.health.port }}"]
initialDelaySeconds: {{ .Values.services.health.readinessProbe.initialDelay }}
livenessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:{{ .Values.services.health.port }}"]
initialDelaySeconds: {{ .Values.services.health.livenessProbe.initialDelay }}
periodSeconds: {{ .Values.services.health.livenessProbe.periodSeconds }}
---
apiVersion: v1
kind: Service
Expand Down
9 changes: 9 additions & 0 deletions charts/sitewhere/templates/Event-Sources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ spec:
requests:
memory: {{ .Values.services.event_sources.resources.requests.memory | default .Values.services.resources.requests.memory | quote }}
cpu: {{ .Values.services.event_sources.resources.requests.cpu | default .Values.services.resources.requests.cpu | quote }}
readinessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:{{ .Values.services.health.port }}"]
initialDelaySeconds: {{ .Values.services.health.readinessProbe.initialDelay }}
livenessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:{{ .Values.services.health.port }}"]
initialDelaySeconds: {{ .Values.services.health.livenessProbe.initialDelay }}
periodSeconds: {{ .Values.services.health.livenessProbe.periodSeconds }}
---
apiVersion: v1
kind: Service
Expand Down
9 changes: 9 additions & 0 deletions charts/sitewhere/templates/Inbound-Processing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ spec:
requests:
memory: {{ .Values.services.inbound_processing.resources.requests.memory | default .Values.services.resources.requests.memory | quote }}
cpu: {{ .Values.services.inbound_processing.resources.requests.cpu | default .Values.services.resources.requests.cpu | quote }}
readinessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:{{ .Values.services.health.port }}"]
initialDelaySeconds: {{ .Values.services.health.readinessProbe.initialDelay }}
livenessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:{{ .Values.services.health.port }}"]
initialDelaySeconds: {{ .Values.services.health.livenessProbe.initialDelay }}
periodSeconds: {{ .Values.services.health.livenessProbe.periodSeconds }}
---
apiVersion: v1
kind: Service
Expand Down
9 changes: 9 additions & 0 deletions charts/sitewhere/templates/Instance-Management.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ spec:
requests:
memory: {{ .Values.services.instance_management.resources.requests.memory | default .Values.services.resources.requests.memory | quote }}
cpu: {{ .Values.services.instance_management.resources.requests.cpu | default .Values.services.resources.requests.cpu | quote }}
readinessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:{{ .Values.services.health.port }}"]
initialDelaySeconds: {{ .Values.services.health.readinessProbe.initialDelay }}
livenessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:{{ .Values.services.health.port }}"]
initialDelaySeconds: {{ .Values.services.health.livenessProbe.initialDelay }}
periodSeconds: {{ .Values.services.health.livenessProbe.periodSeconds }}
---
apiVersion: v1
kind: Service
Expand Down
9 changes: 9 additions & 0 deletions charts/sitewhere/templates/Label-Generation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ spec:
requests:
memory: {{ .Values.services.label_generation.resources.requests.memory | default .Values.services.resources.requests.memory | quote }}
cpu: {{ .Values.services.label_generation.resources.requests.cpu | default .Values.services.resources.requests.cpu | quote }}
readinessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:{{ .Values.services.health.port }}"]
initialDelaySeconds: {{ .Values.services.health.readinessProbe.initialDelay }}
livenessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:{{ .Values.services.health.port }}"]
initialDelaySeconds: {{ .Values.services.health.livenessProbe.initialDelay }}
periodSeconds: {{ .Values.services.health.livenessProbe.periodSeconds }}
---
apiVersion: v1
kind: Service
Expand Down
9 changes: 9 additions & 0 deletions charts/sitewhere/templates/Outbound-Connectors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ spec:
requests:
memory: {{ .Values.services.outbound_connectors.resources.requests.memory | default .Values.services.resources.requests.memory | quote }}
cpu: {{ .Values.services.outbound_connectors.resources.requests.cpu | default .Values.services.resources.requests.cpu | quote }}
readinessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:{{ .Values.services.health.port }}"]
initialDelaySeconds: {{ .Values.services.health.readinessProbe.initialDelay }}
livenessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:{{ .Values.services.health.port }}"]
initialDelaySeconds: {{ .Values.services.health.livenessProbe.initialDelay }}
periodSeconds: {{ .Values.services.health.livenessProbe.periodSeconds }}
---
apiVersion: v1
kind: Service
Expand Down
9 changes: 9 additions & 0 deletions charts/sitewhere/templates/Rule-Processing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ spec:
requests:
memory: {{ .Values.services.rule_processing.resources.requests.memory | default .Values.services.resources.requests.memory | quote }}
cpu: {{ .Values.services.rule_processing.resources.requests.cpu | default .Values.services.resources.requests.cpu | quote }}
readinessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:{{ .Values.services.health.port }}"]
initialDelaySeconds: {{ .Values.services.health.readinessProbe.initialDelay }}
livenessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:{{ .Values.services.health.port }}"]
initialDelaySeconds: {{ .Values.services.health.livenessProbe.initialDelay }}
periodSeconds: {{ .Values.services.health.livenessProbe.periodSeconds }}
---
apiVersion: v1
kind: Service
Expand Down
9 changes: 9 additions & 0 deletions charts/sitewhere/templates/Schedule-Management.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ spec:
requests:
memory: {{ .Values.services.schedule_management.resources.requests.memory | default .Values.services.resources.requests.memory | quote }}
cpu: {{ .Values.services.schedule_management.resources.requests.cpu | default .Values.services.resources.requests.cpu | quote }}
readinessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:{{ .Values.services.health.port }}"]
initialDelaySeconds: {{ .Values.services.health.readinessProbe.initialDelay }}
livenessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:{{ .Values.services.health.port }}"]
initialDelaySeconds: {{ .Values.services.health.livenessProbe.initialDelay }}
periodSeconds: {{ .Values.services.health.livenessProbe.periodSeconds }}
---
apiVersion: v1
kind: Service
Expand Down
9 changes: 9 additions & 0 deletions charts/sitewhere/templates/Streaming-Media.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ spec:
requests:
memory: {{ .Values.services.streaming_media.resources.requests.memory | default .Values.services.resources.requests.memory | quote }}
cpu: {{ .Values.services.streaming_media.resources.requests.cpu | default .Values.services.resources.requests.cpu | quote }}
readinessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:{{ .Values.services.health.port }}"]
initialDelaySeconds: {{ .Values.services.health.readinessProbe.initialDelay }}
livenessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:{{ .Values.services.health.port }}"]
initialDelaySeconds: {{ .Values.services.health.livenessProbe.initialDelay }}
periodSeconds: {{ .Values.services.health.livenessProbe.periodSeconds }}
---
apiVersion: v1
kind: Service
Expand Down
9 changes: 9 additions & 0 deletions charts/sitewhere/templates/Tenant-Management.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ spec:
requests:
memory: {{ .Values.services.tenant_management.resources.requests.memory | default .Values.services.resources.requests.memory | quote }}
cpu: {{ .Values.services.tenant_management.resources.requests.cpu | default .Values.services.resources.requests.cpu | quote }}
readinessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:{{ .Values.services.health.port }}"]
initialDelaySeconds: {{ .Values.services.health.readinessProbe.initialDelay }}
livenessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:{{ .Values.services.health.port }}"]
initialDelaySeconds: {{ .Values.services.health.livenessProbe.initialDelay }}
periodSeconds: {{ .Values.services.health.livenessProbe.periodSeconds }}
---
apiVersion: v1
kind: Service
Expand Down
9 changes: 9 additions & 0 deletions charts/sitewhere/templates/User-Management.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ spec:
requests:
memory: {{ .Values.services.user_management.resources.requests.memory | default .Values.services.resources.requests.memory | quote }}
cpu: {{ .Values.services.user_management.resources.requests.cpu | default .Values.services.resources.requests.cpu | quote }}
readinessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:{{ .Values.services.health.port }}"]
initialDelaySeconds: {{ .Values.services.health.readinessProbe.initialDelay }}
livenessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:{{ .Values.services.health.port }}"]
initialDelaySeconds: {{ .Values.services.health.livenessProbe.initialDelay }}
periodSeconds: {{ .Values.services.health.livenessProbe.periodSeconds }}
---
apiVersion: v1
kind: Service
Expand Down
9 changes: 9 additions & 0 deletions charts/sitewhere/templates/Web-Rest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ spec:
requests:
memory: {{ .Values.services.web_rest.resources.requests.memory | default .Values.services.resources.requests.memory | quote }}
cpu: {{ .Values.services.web_rest.resources.requests.cpu | default .Values.services.resources.requests.cpu | quote }}
readinessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:{{ .Values.services.health.port }}"]
initialDelaySeconds: {{ .Values.services.health.readinessProbe.initialDelay }}
livenessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:{{ .Values.services.health.port }}"]
initialDelaySeconds: {{ .Values.services.health.livenessProbe.initialDelay }}
periodSeconds: {{ .Values.services.health.livenessProbe.periodSeconds }}
---
apiVersion: v1
kind: Service
Expand Down
7 changes: 7 additions & 0 deletions charts/sitewhere/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ services:
# profile: default|minimal
profile: default
debug: false
health:
port: 9002
readinessProbe:
initialDelay: 120
livenessProbe:
initialDelaySeconds: 300
periodSeconds: 60
image:
registry: docker.io
repository: sitewhere
Expand Down

0 comments on commit f06cc0b

Please sign in to comment.