The home for Hyperlane core contracts, sdk packages, and other infrastructure
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hyperlane-monorepo/rust/helm/optics-agent/templates/processor-statefulset.yaml

148 lines
5.0 KiB

{{- if .Values.optics.processor.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "optics-agent.fullname" . }}-processor
labels:
{{- include "optics-agent.labels" . | nindent 4 }}
role: processor
spec:
clusterIP: None
selector:
{{- include "optics-agent.selectorLabels" . | nindent 4 }}
role: processor
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ include "optics-agent.fullname" . }}-processor
labels:
{{- include "optics-agent.labels" . | nindent 4 }}
role: processor
spec:
selector:
matchLabels:
{{- include "optics-agent.selectorLabels" . | nindent 6 }}
role: processor
replicas: 1
serviceName: {{ include "optics-agent.fullname" . }}-processor
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "optics-agent.selectorLabels" . | nindent 8 }}
role: processor
{{- include "optics-agent.labels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
terminationGracePeriodSeconds: 10
containers:
- name: agent
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["./processor"]
env:
# Set AWS Keys if present in config
{{- if .Values.optics.awsAccessKeyId }}
- name: AWS_ACCESS_KEY_ID
value: {{ .Values.optics.awsAccessKeyId }}
{{- end }}
{{- if .Values.optics.awsSecretAccessKey }}
- name: AWS_SECRET_ACCESS_KEY
value: {{ .Values.optics.awsSecretAccessKey}}
{{- end }}
# Set the DB location to be the volume
- name: OPT_BASE_DBPATH
value: /usr/share/optics
# Set the log formatting
- name: OPT_BASE_TRACING_FMT
value: "json"
# Sets the config folder to use
- name: RUN_ENV
value: {{ .Values.optics.runEnv | quote }}
# Sets the base config to be used (switch between Homes)
- name: BASE_CONFIG
value: {{ .Values.optics.baseConfig }}
# Home Overrides
{{- if .Values.optics.homeChain.connectionUrl }}
- name: OPT_BASE_HOME_CONFIG_CONNECTION_URL
value: {{ .Values.optics.homeChain.connectionUrl }}
{{- end }}
{{- if .Values.optics.homeChain.connectionType }}
- name: OPT_BASE_HOME_CONFIG_CONNECTION_TYPE
value: {{ .Values.optics.homeChain.connectionType }}
{{- end }}
# Replica Overrides
{{- range .Values.optics.replicaChains }}
{{- if .connectionUrl }}
- name: OPT_BASE_REPLICAS_{{ .name | upper }}_CONNECTION_URL
value: {{ .connectionUrl }}
{{- end }}
{{- if .address }}
- name: OPT_BASE_REPLICAS_{{ .name | upper }}_ADDRESS
value: {{ .address }}
{{- end }}
{{- end }}
# Polling Interval Override
{{- if .Values.optics.processor.pollingInterval }}
- name: OPT_BASE_POLLINGINTERVAL
value: {{ .Values.optics.processor.pollingInterval | quote }}
{{- end }}
# Transaction Signer Keys
{{- range .Values.optics.processor.transactionSigners }}
{{- if .hexKey }}
- name: OPT_BASE_SIGNERS_{{ .name | upper }}_KEY
value: {{ .hexKey }}
{{- else }}
- name: OPT_BASE_SIGNERS_{{ .name | upper }}_TYPE
value: "aws"
- name: OPT_BASE_SIGNERS_{{ .name | upper }}_AWS_ID
value: {{ .aws.keyId }}
- name: OPT_BASE_SIGNERS_{{ .name | upper }}_AWS_REGION
value: {{ .aws.region }}
{{- end }}
{{- end }}
# Jaeger Config
{{- if .Values.optics.tracing.uri }}
- name: OPT_BASE_TRACING_JAEGER_NAME
value: {{ include "optics-agent.fullname" . }}-processor
- name: OPT_BASE_TRACING_JAEGER_COLLECTOR_URI
value: {{ $.Values.optics.tracing.uri }}
{{- end }}
- name: RUST_BACKTRACE
value: full
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- name: state
mountPath: /usr/share/optics
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
volumeClaimTemplates:
- metadata:
name: state
spec:
accessModes: [ "ReadWriteOnce" ]
storageClassName: {{ .Values.volumeStorageClass }}
resources:
requests:
storage: 10Gi
{{- end }}