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.
130 lines
4.3 KiB
130 lines
4.3 KiB
3 years ago
|
{{- 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 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.processor.pollingInterval }}
|
||
|
- name: OPT_BASE_POLLINGINTERVAL
|
||
|
value: {{ .Values.optics.processor.pollingInterval | quote }}
|
||
|
{{- end }}
|
||
|
# Transaction Signer Keys
|
||
|
{{- range .Values.optics.processor.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" . }}-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 }}
|