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

121 lines
4.2 KiB

{{- if .Values.optics.processor.enabled }}
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ include "optics-agent.fullname" . }}-processor
labels:
{{- include "optics-agent.labels" . | nindent 4 }}
app.kubernetes.io/component: processor
spec:
selector:
matchLabels:
{{- include "optics-agent.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: processor
replicas: 1
serviceName: {{ include "optics-agent.fullname" . }}-processor
template:
metadata:
annotations:
checksum/configmap: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.optics.processor.podAnnotations }}
{{ toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "optics-agent.labels" . | nindent 8 }}
app.kubernetes.io/component: processor
{{- with .Values.podCommonLabels }}
{{ toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.optics.processor.podLabels }}
{{ toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
terminationGracePeriodSeconds: 10
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: agent
securityContext:
{{- toYaml .Values.securityContext | nindent 10 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["./processor"]
envFrom:
- configMapRef:
name: {{ include "optics-agent.fullname" . }}
env:
{{- if .Values.optics.processor.pollingInterval }}
- name: OPT_PROCESSOR_INTERVAL
value: {{ .Values.optics.processor.pollingInterval | quote }}
{{ range .Values.optics.processor.indexonly }}
- name: OPT_PROCESSOR_INDEXON_{{ . | upper }}
value: "true"
{{ end }}
{{- if .hexKey }}
- name: OPT_PROCESSOR_S3_BUCKET
value: {{ .Values.optics.processor.s3BucketName }}
- name: OPT_PROCESSOR_S3_REGION
value: {{ .aws.region }}
{{- end }}
{{- end }}
{{- 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 }}_ID
value: {{ .aws.keyId }}
- name: OPT_BASE_SIGNERS_{{ .name | upper }}_REGION
value: {{ .aws.region }}
{{- end }}
{{- end }}
{{- if .Values.optics.tracing.uri }}
- name: OPT_BASE_TRACING_JAEGER_NAME
value: {{ include "optics-agent.fullname" . }}-processor
{{- end }}
resources:
{{- toYaml .Values.optics.processor.resources | nindent 10 }}
volumeMounts:
- name: state
mountPath: {{ .Values.optics.dbPath }}
ports:
- name: metrics
containerPort: {{ .Values.optics.metrics.port }}
{{- 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:
storageClassName: {{ .Values.storage.storageClass }}
accessModes: [ {{ .Values.storage.accessModes }} ]
{{- if .Values.optics.processor.storage.snapshot.enabled }}
dataSource:
name: {{ .Values.optics.processor.storage.snapshot.name }}
kind: VolumeSnapshot
apiGroup: snapshot.storage.k8s.io
{{- end }}
resources:
requests:
storage: {{ .Values.optics.processor.storage.size }}
{{- end }}