Skip to content
This repository has been archived by the owner on Feb 7, 2019. It is now read-only.

Commit

Permalink
Do not deploy Prometheus metrics as a separate pod, rather, have one …
Browse files Browse the repository at this point in the history
…per replica
  • Loading branch information
TobyRet committed Jan 11, 2019
1 parent 9a44ccb commit d4f5339
Showing 1 changed file with 18 additions and 40 deletions.
58 changes: 18 additions & 40 deletions deploy/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,24 @@ spec:
labels:
app: allocation-api
spec:
- name: allocation-api-metrics
image: 926803513772.dkr.ecr.eu-west-1.amazonaws.com/offender-management/offender-management-allocation-api:latest
imagePullPolicy: Always
command: ['sh', '-c', "bundle exec puma prometheus_exporter --pidfile /tmp/server.pid"]
ports:
- containerPort: 9394
livenessProbe:
httpGet:
path: /metrics
port: 9394
initialDelaySeconds: 10
periodSeconds: 60
readinessProbe:
httpGet:
path: /metrics
port: 9394
initialDelaySeconds: 10
periodSeconds: 60
containers:
- name: allocation-api
image: 926803513772.dkr.ecr.eu-west-1.amazonaws.com/offender-management/offender-management-allocation-api:latest
Expand Down Expand Up @@ -89,43 +107,3 @@ spec:
secretKeyRef:
name: allocation-api-secrets
key: nomis_oauth_pub_key

---

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: allocation-api-metrics
labels:
app: allocation-api-metrics
spec:
replicas: 1
revisionHistoryLimit: 1
minReadySeconds: 10
selector:
matchLabels:
app: allocation-api-metrics
template:
metadata:
labels:
app: allocation-api-metrics
spec:
containers:
- name: allocation-api-metrics
image: 926803513772.dkr.ecr.eu-west-1.amazonaws.com/offender-management/offender-management-allocation-api:latest
imagePullPolicy: Always
command: ['sh', '-c', "bundle exec puma prometheus_exporter --pidfile /tmp/server.pid"]
ports:
- containerPort: 9394
livenessProbe:
httpGet:
path: /metrics
port: 9394
initialDelaySeconds: 10
periodSeconds: 60
readinessProbe:
httpGet:
path: /metrics
port: 9394
initialDelaySeconds: 10
periodSeconds: 60

0 comments on commit d4f5339

Please sign in to comment.