Skip to content

Commit

Permalink
Add deployment settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Agustin Godnic committed Aug 4, 2023
1 parent 32eb027 commit e7885a3
Show file tree
Hide file tree
Showing 5 changed files with 129 additions and 0 deletions.
15 changes: 15 additions & 0 deletions deploy/event-watcher/env/production-mainnet.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
ENVIRONMENT=production-mainnet
NAMESPACE=wormscan
NAME=wormscan-event-watcher
REPLICAS=5
IMAGE_NAME=
RESOURCES_LIMITS_MEMORY=512Mi
RESOURCES_LIMITS_CPU=700m
RESOURCES_REQUESTS_MEMORY=384Mi
RESOURCES_REQUESTS_CPU=500m
P2P_NETWORK=mainnet
PPROF_ENABLED=false
MONITORING_PORT=8000
MONGODB_URI=
MONGODB_DATABASE=
LOG_LEVEL=INFO
15 changes: 15 additions & 0 deletions deploy/event-watcher/env/production-testnet.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
ENVIRONMENT=production-testnet
NAMESPACE=wormscan-testnet
NAME=wormscan-event-watcher
REPLICAS=3
IMAGE_NAME=
RESOURCES_LIMITS_MEMORY=256Mi
RESOURCES_LIMITS_CPU=500m
RESOURCES_REQUESTS_MEMORY=128Mi
RESOURCES_REQUESTS_CPU=250m
P2P_NETWORK=testnet
PPROF_ENABLED=false
MONITORING_PORT=8000
MONGODB_URI=
MONGODB_DATABASE=
LOG_LEVEL=INFO
15 changes: 15 additions & 0 deletions deploy/event-watcher/env/staging-mainnet.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
ENVIRONMENT=staging-mainnet
NAMESPACE=wormscan
NAME=wormscan-event-watcher
REPLICAS=3
IMAGE_NAME=
RESOURCES_LIMITS_MEMORY=512Mi
RESOURCES_LIMITS_CPU=700m
RESOURCES_REQUESTS_MEMORY=384Mi
RESOURCES_REQUESTS_CPU=500m
P2P_NETWORK=mainnet
PPROF_ENABLED=false
MONITORING_PORT=8000
MONGODB_URI=
MONGODB_DATABASE=
LOG_LEVEL=INFO
15 changes: 15 additions & 0 deletions deploy/event-watcher/env/staging-testnet.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
ENVIRONMENT=staging-testnet
NAMESPACE=wormscan-testnet
NAME=wormscan-event-watcher
REPLICAS=2
IMAGE_NAME=
RESOURCES_LIMITS_MEMORY=256Mi
RESOURCES_LIMITS_CPU=500m
RESOURCES_REQUESTS_MEMORY=128Mi
RESOURCES_REQUESTS_CPU=250m
P2P_NETWORK=testnet
PPROF_ENABLED=false
MONITORING_PORT=8000
MONGODB_URI=
MONGODB_DATABASE=
LOG_LEVEL=INFO
69 changes: 69 additions & 0 deletions deploy/event-watcher/event-watcher-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .NAME }}
namespace: {{ .NAMESPACE }}
spec:
replicas: {{ .REPLICAS }}
selector:
matchLabels:
app: {{ .NAME }}
template:
metadata:
labels:
app: {{ .NAME }}
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "8000"
spec:
restartPolicy: Always
terminationGracePeriodSeconds: 40
serviceAccountName: fly
containers:
- name: {{ .NAME }}
image: {{ .IMAGE_NAME }}
imagePullPolicy: Always
readinessProbe:
initialDelaySeconds: 30
periodSeconds: 20
timeoutSeconds: 3
failureThreshold: 3
httpGet:
path: /api/ready
port: 8000
livenessProbe:
initialDelaySeconds: 30
periodSeconds: 30
timeoutSeconds: 3
failureThreshold: 3
httpGet:
path: /api/health
port: 8000
env:
- name: ENVIRONMENT
value: {{ .ENVIRONMENT }}
- name: MONITORING_PORT
value: "{{ .MONITORING_PORT }}"
- name: LOG_LEVEL
value: "{{ .LOG_LEVEL }}"
- name: MONGODB_URI
valueFrom:
secretKeyRef:
name: mongodb
key: mongo-uri
- name: MONGODB_DATABASE
valueFrom:
configMapKeyRef:
name: config
key: mongo-database
- name: P2P_NETWORK
value: {{ .P2P_NETWORK }}
- name: PPROF_ENABLED
value: "{{ .PPROF_ENABLED }}"
resources:
limits:
memory: {{ .RESOURCES_LIMITS_MEMORY }}
cpu: {{ .RESOURCES_LIMITS_CPU }}
requests:
memory: {{ .RESOURCES_REQUESTS_MEMORY }}
cpu: {{ .RESOURCES_REQUESTS_CPU }}

0 comments on commit e7885a3

Please sign in to comment.