{{- if .Values.optics.kathy.enabled }} apiVersion: apps/v1 kind: StatefulSet metadata: name: {{ include "optics-agent.fullname" . }}-kathy labels: {{- include "optics-agent.labels" . | nindent 4 }} app.kubernetes.io/component: kathy spec: selector: matchLabels: {{- include "optics-agent.selectorLabels" . | nindent 6 }} app.kubernetes.io/component: kathy replicas: 1 serviceName: {{ include "optics-agent.fullname" . }}-kathy template: metadata: annotations: checksum/configmap: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} {{- with .Values.podAnnotations }} {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.optics.kathy.podAnnotations }} {{ toYaml . | nindent 8 }} {{- end }} labels: {{- include "optics-agent.labels" . | nindent 8 }} app.kubernetes.io/component: kathy {{- with .Values.podCommonLabels }} {{ toYaml . | nindent 8 }} {{- end }} {{- with .Values.optics.kathy.podLabels }} {{ toYaml . | nindent 8 }} {{- end }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} terminationGracePeriodSeconds: 10 securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} containers: - name: {{ .Chart.Name }} securityContext: {{- toYaml .Values.securityContext | nindent 10 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} command: ["./kathy"] envFrom: - configMapRef: name: {{ include "optics-agent.fullname" . }} env: {{- if .Values.optics.kathy.messageInterval }} - name: OPT_KATHY_INTERVAL value: {{ .Values.optics.kathy.messageInterval | quote }} {{- end }} {{- range .Values.optics.kathy.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" . }}-kathy {{- end }} resources: {{- toYaml .Values.optics.kathy.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.kathy.storage.snapshot.enabled }} dataSource: name: {{ .Values.optics.kathy.storage.snapshot.name }} kind: VolumeSnapshot apiGroup: snapshot.storage.k8s.io {{- end }} resources: requests: storage: {{ .Values.optics.kathy.storage.size }} {{- end }}