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/relayer-statefulset.yaml

130 lines
4.3 KiB

{{- if .Values.optics.relayer.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "optics-agent.fullname" . }}-relayer
labels:
{{- include "optics-agent.labels" . | nindent 4 }}
role: relayer
spec:
clusterIP: None
selector:
{{- include "optics-agent.selectorLabels" . | nindent 4 }}
role: relayer
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ include "optics-agent.fullname" . }}-relayer
labels:
{{- include "optics-agent.labels" . | nindent 4 }}
role: relayer
spec:
selector:
matchLabels:
{{- include "optics-agent.selectorLabels" . | nindent 6 }}
role: relayer
replicas: 1
serviceName: {{ include "optics-agent.fullname" . }}-relayer
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "optics-agent.selectorLabels" . | nindent 8 }}
role: relayer
{{- 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: ["./relayer"]
env:
# Set the DB location to be the volume
- name: OPT_BASE_DBPATH
value: /usr/share/optics
# Set the log formatting
- name: OPT_BASE_TRACING_STYLE
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.relayer.pollingInterval }}
- name: OPT_BASE_POLLINGINTERVAL
value: {{ .Values.optics.relayer.pollingInterval | quote }}
{{- end }}
# Transaction Signer Keys
{{- range .Values.optics.relayer.transactionSigners }}
- name: OPT_BASE_SIGNERS_{{ .name | upper }}_KEY
value: {{ .key }}
{{- end }}
# Jaeger Config
{{- if .Values.optics.tracing.uri }}
- name: OPT_BASE_TRACING_JAEGER_NAME
value: {{ include "optics-agent.fullname" . }}-relayer
- 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 }}