wormhole-explorer/deploy/tx-tracker/tx-tracker-service.yaml

117 lines
3.1 KiB
YAML

---
apiVersion: v1
kind: Service
metadata:
name: {{ .NAME }}
namespace: {{ .NAMESPACE }}
labels:
app: {{ .NAME }}
spec:
selector:
app: {{ .NAME }}
ports:
- port: 80
targetPort: 8000
name: {{ .NAME }}
protocol: TCP
---
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: tx-tracker
containers:
- name: {{ .NAME }}
image: {{ .IMAGE_NAME }}
imagePullPolicy: Always
volumeMounts:
- name: tx-tracker-config
mountPath: /opt/tx-tracker
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: "8000"
- name: LOG_LEVEL
value: "INFO"
- name: MONGODB_URI
valueFrom:
secretKeyRef:
name: mongodb
key: mongo-uri
- name: MONGODB_DATABASE
valueFrom:
configMapKeyRef:
name: config
key: mongo-database
- name: PIPELINE_SQS_URL
valueFrom:
configMapKeyRef:
name: tx-tracker
key: pipeline-sqs-url
- name: NOTIFICATIONS_SQS_URL
valueFrom:
configMapKeyRef:
name: tx-tracker
key: notifications-sqs-url
- name: AWS_REGION
valueFrom:
configMapKeyRef:
name: tx-tracker
key: aws-region
- name: P2P_NETWORK
value: {{ .P2P_NETWORK }}
- name: METRICS_ENABLED
value: "{{ .METRICS_ENABLED }}"
- name: RPC_PROVIDER_PATH
value: "/opt/tx-tracker/rpc-provider.json"
- name: CONSUMER_WORKERS_SIZE
value: "1"
resources:
limits:
memory: {{ .RESOURCES_LIMITS_MEMORY }}
cpu: {{ .RESOURCES_LIMITS_CPU }}
requests:
memory: {{ .RESOURCES_REQUESTS_MEMORY }}
cpu: {{ .RESOURCES_REQUESTS_CPU }}
volumes:
- name: tx-tracker-config
secret:
secretName: rpc-provider
items:
- key: rpc-provider.json
path: rpc-provider.json