From d4f53396ee64986a84e2385d5f329dee590d3888 Mon Sep 17 00:00:00 2001 From: Toby Retallick Date: Fri, 11 Jan 2019 08:55:42 +0000 Subject: [PATCH] Do not deploy Prometheus metrics as a separate pod, rather, have one per replica --- deploy/deployment.yaml | 58 +++++++++++++----------------------------- 1 file changed, 18 insertions(+), 40 deletions(-) diff --git a/deploy/deployment.yaml b/deploy/deployment.yaml index 572da41..b9fbb86 100644 --- a/deploy/deployment.yaml +++ b/deploy/deployment.yaml @@ -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 @@ -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