{{- if .Values.optics.updater.enabled }} apiVersion: apps/v1 kind: StatefulSet metadata: name: {{ include "optics-agent.fullname" . }}-updater labels: {{- include "optics-agent.labels" . | nindent 4 }} app.kubernetes.io/component: updater spec: selector: matchLabels: {{- include "optics-agent.selectorLabels" . | nindent 6 }} app.kubernetes.io/component: updater replicas: 1 serviceName: {{ include "optics-agent.fullname" . }}-updater template: metadata: annotations: checksum/configmap: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} {{- with .Values.podAnnotations }} {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.optics.updater.podAnnotations }} {{ toYaml . | nindent 8 }} {{- end }} labels: {{- include "optics-agent.labels" . | nindent 8 }} app.kubernetes.io/component: updater {{- with .Values.podCommonLabels }} {{ toYaml . | nindent 8 }} {{- end }} {{- with .Values.optics.updater.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: ["./updater"] envFrom: - configMapRef: name: {{ include "optics-agent.fullname" . }} env: {{- if .Values.optics.updater.pollingInterval }} - name: OPT_BASE_POLLINGINTERVAL value: {{ .Values.optics.updater.pollingInterval | quote }} {{- end }} {{- range .Values.optics.updater.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.updater.attestationSigner.hexKey }} - name: OPT_BASE_UPDATER_KEY value: {{ .Values.optics.updater.attestationSigner.hexKey }} {{- else }} - name: OPT_BASE_UPDATER_TYPE value: "aws" - name: OPT_BASE_UPDATER_ID value: {{ .Values.optics.updater.attestationSigner.aws.keyId }} - name: OPT_BASE_UPDATER_REGION value: {{ .Values.optics.updater.attestationSigner.aws.region }} {{- end }} {{- if .Values.optics.tracing.uri }} - name: OPT_BASE_TRACING_JAEGER_NAME value: {{ include "optics-agent.fullname" . }}-updater {{- end }} resources: {{- toYaml .Values.optics.updater.resources | nindent 10 }} volumeMounts: - name: state mountPath: {{ .Values.optics.dbPath }} {{- 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.updater.storage.snapshot.enabled }} dataSource: name: {{ .Values.optics.updater.storage.snapshot.name }} kind: VolumeSnapshot apiGroup: snapshot.storage.k8s.io {{- end }} resources: requests: storage: {{ .Values.optics.updater.storage.size }} {{- end }}