Skip to content

Commit

Permalink
Add readiness/liveness checks for third party components (#1121)
Browse files Browse the repository at this point in the history
* Add readiness/liveness checks for third party components

Any possible issues with the third party control plane components can wedge the services.

Take the best practices for prometheus/grafana and add them to our template. See #1116

* Update test fixtures for new output
  • Loading branch information
grampelberg committed Jun 14, 2018
1 parent 72415d1 commit 516807b
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 0 deletions.
24 changes: 24 additions & 0 deletions cli/cmd/testdata/install_default.golden
Original file line number Diff line number Diff line change
Expand Up @@ -411,10 +411,22 @@ spec:
- --config.file=/etc/prometheus/prometheus.yml
image: prom/prometheus:v2.2.1
imagePullPolicy: IfNotPresent
livenessProbe:
httpGet:
path: /-/healthy
port: 9090
initialDelaySeconds: 30
timeoutSeconds: 30
name: prometheus
ports:
- containerPort: 9090
name: admin-http
readinessProbe:
httpGet:
path: /-/ready
port: 9090
initialDelaySeconds: 30
timeoutSeconds: 30
resources: {}
volumeMounts:
- mountPath: /etc/prometheus
Expand Down Expand Up @@ -635,10 +647,22 @@ spec:
containers:
- image: gcr.io/runconduit/grafana:undefined
imagePullPolicy: IfNotPresent
livenessProbe:
httpGet:
path: /api/health
port: 3000
name: grafana
ports:
- containerPort: 3000
name: http
readinessProbe:
failureThreshold: 10
httpGet:
path: /api/health
port: 3000
initialDelaySeconds: 60
periodSeconds: 10
timeoutSeconds: 30
resources: {}
volumeMounts:
- mountPath: /etc/grafana
Expand Down
24 changes: 24 additions & 0 deletions cli/cmd/testdata/install_output.golden
Original file line number Diff line number Diff line change
Expand Up @@ -414,10 +414,22 @@ spec:
- --config.file=/etc/prometheus/prometheus.yml
image: PrometheusImage
imagePullPolicy: ImagePullPolicy
livenessProbe:
httpGet:
path: /-/healthy
port: 9090
initialDelaySeconds: 30
timeoutSeconds: 30
name: prometheus
ports:
- containerPort: 9090
name: admin-http
readinessProbe:
httpGet:
path: /-/ready
port: 9090
initialDelaySeconds: 30
timeoutSeconds: 30
resources: {}
volumeMounts:
- mountPath: /etc/prometheus
Expand Down Expand Up @@ -639,10 +651,22 @@ spec:
containers:
- image: GrafanaImage
imagePullPolicy: ImagePullPolicy
livenessProbe:
httpGet:
path: /api/health
port: 3000
name: grafana
ports:
- containerPort: 3000
name: http
readinessProbe:
failureThreshold: 10
httpGet:
path: /api/health
port: 3000
initialDelaySeconds: 60
periodSeconds: 10
timeoutSeconds: 30
resources: {}
volumeMounts:
- mountPath: /etc/grafana
Expand Down
24 changes: 24 additions & 0 deletions cli/install/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,18 @@ spec:
args:
- "--storage.tsdb.retention=6h"
- "--config.file=/etc/prometheus/prometheus.yml"
readinessProbe:
httpGet:
path: /-/ready
port: 9090
initialDelaySeconds: 30
timeoutSeconds: 30
livenessProbe:
httpGet:
path: /-/healthy
port: 9090
initialDelaySeconds: 30
timeoutSeconds: 30
---
kind: ConfigMap
Expand Down Expand Up @@ -482,6 +494,18 @@ spec:
readOnly: true
image: {{.GrafanaImage}}
imagePullPolicy: {{.ImagePullPolicy}}
livenessProbe:
httpGet:
path: /api/health
port: 3000
readinessProbe:
httpGet:
path: /api/health
port: 3000
initialDelaySeconds: 60
timeoutSeconds: 30
failureThreshold: 10
periodSeconds: 10
---
kind: ConfigMap
Expand Down

0 comments on commit 516807b

Please sign in to comment.