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.
128 lines
4.5 KiB
128 lines
4.5 KiB
3 years ago
|
{{- if .Values.abacus.validator.enabled }}
|
||
3 years ago
|
apiVersion: apps/v1
|
||
|
kind: StatefulSet
|
||
|
metadata:
|
||
3 years ago
|
name: {{ include "abacus-agent.fullname" . }}-validator
|
||
3 years ago
|
labels:
|
||
3 years ago
|
{{- include "abacus-agent.labels" . | nindent 4 }}
|
||
3 years ago
|
app.kubernetes.io/component: validator
|
||
3 years ago
|
spec:
|
||
|
selector:
|
||
|
matchLabels:
|
||
3 years ago
|
{{- include "abacus-agent.selectorLabels" . | nindent 6 }}
|
||
3 years ago
|
app.kubernetes.io/component: validator
|
||
|
replicas: {{ len .Values.abacus.validator.configs }}
|
||
|
serviceName: {{ include "abacus-agent.fullname" . }}-validator
|
||
3 years ago
|
template:
|
||
|
metadata:
|
||
|
annotations:
|
||
3 years ago
|
checksum/configmap: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
|
||
3 years ago
|
checksum/validator-configmap: {{ include (print $.Template.BasePath "/validator-configmap.yaml") . | sha256sum }}
|
||
3 years ago
|
{{- with .Values.podAnnotations }}
|
||
3 years ago
|
{{- toYaml . | nindent 8 }}
|
||
3 years ago
|
{{- end }}
|
||
3 years ago
|
{{- with .Values.abacus.validator.podAnnotations }}
|
||
3 years ago
|
{{ toYaml . | nindent 8 }}
|
||
|
{{- end }}
|
||
3 years ago
|
labels:
|
||
3 years ago
|
{{- include "abacus-agent.labels" . | nindent 8 }}
|
||
3 years ago
|
app.kubernetes.io/component: validator
|
||
3 years ago
|
{{- with .Values.podCommonLabels }}
|
||
|
{{ toYaml . | nindent 8 }}
|
||
|
{{- end }}
|
||
3 years ago
|
{{- with .Values.abacus.validator.podLabels }}
|
||
3 years ago
|
{{ toYaml . | nindent 8 }}
|
||
|
{{- end }}
|
||
3 years ago
|
spec:
|
||
|
{{- with .Values.imagePullSecrets }}
|
||
|
imagePullSecrets:
|
||
|
{{- toYaml . | nindent 8 }}
|
||
|
{{- end }}
|
||
|
terminationGracePeriodSeconds: 10
|
||
3 years ago
|
securityContext:
|
||
|
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
||
3 years ago
|
containers:
|
||
|
- name: agent
|
||
|
securityContext:
|
||
3 years ago
|
{{- toYaml .Values.securityContext | nindent 10 }}
|
||
3 years ago
|
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
||
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||
3 years ago
|
command: ["/bin/sh", "-c"]
|
||
|
args:
|
||
|
- |
|
||
|
RID=$(echo $REPLICA_NAME | grep -Eo '[0-9]+$')
|
||
|
env $(cat /config-env-vars/validator-$RID.env /secret-env-vars/validator-$RID.env | xargs) ./validator
|
||
3 years ago
|
envFrom:
|
||
|
- configMapRef:
|
||
3 years ago
|
name: {{ include "abacus-agent.fullname" . }}
|
||
3 years ago
|
- secretRef:
|
||
3 years ago
|
name: {{ include "abacus-agent.fullname" . }}-secret
|
||
3 years ago
|
- secretRef:
|
||
3 years ago
|
name: {{ include "abacus-agent.fullname" . }}-validator-secret
|
||
|
env:
|
||
|
- name: REPLICA_NAME
|
||
|
valueFrom:
|
||
|
fieldRef:
|
||
|
fieldPath: metadata.name
|
||
|
{{- range .Values.abacus.validator.signers }}
|
||
3 years ago
|
{{- if (hasKey . "aws") }}
|
||
3 years ago
|
- name: OPT_BASE_SIGNERS_{{ .name | upper }}_TYPE
|
||
|
value: "aws"
|
||
3 years ago
|
- name: OPT_BASE_SIGNERS_{{ .name | upper }}_ID
|
||
3 years ago
|
value: {{ .aws.keyId }}
|
||
3 years ago
|
- name: OPT_BASE_SIGNERS_{{ .name | upper }}_REGION
|
||
3 years ago
|
value: {{ .aws.region }}
|
||
|
{{- end }}
|
||
3 years ago
|
{{- end }}
|
||
3 years ago
|
{{- if .Values.abacus.tracing.uri }}
|
||
3 years ago
|
- name: OPT_BASE_TRACING_JAEGER_NAME
|
||
3 years ago
|
value: {{ include "abacus-agent.fullname" . }}-validator
|
||
3 years ago
|
{{- end }}
|
||
|
resources:
|
||
3 years ago
|
{{- toYaml .Values.abacus.validator.resources | nindent 10 }}
|
||
3 years ago
|
volumeMounts:
|
||
|
- name: state
|
||
3 years ago
|
mountPath: {{ .Values.abacus.dbPath }}
|
||
3 years ago
|
- name: config-env-vars
|
||
|
mountPath: /config-env-vars
|
||
|
- name: secret-env-vars
|
||
|
mountPath: /secret-env-vars
|
||
3 years ago
|
ports:
|
||
|
- name: metrics
|
||
3 years ago
|
containerPort: {{ .Values.abacus.metrics.port }}
|
||
3 years ago
|
volumes:
|
||
|
- name: config-env-vars
|
||
|
configMap:
|
||
|
name: {{ include "abacus-agent.fullname" . }}-validator
|
||
|
- name: secret-env-vars
|
||
|
secret:
|
||
|
secretName: {{ include "abacus-agent.fullname" . }}-validator-secret
|
||
3 years ago
|
{{- 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:
|
||
3 years ago
|
storageClassName: {{ .Values.storage.storageClass }}
|
||
|
accessModes: [ {{ .Values.storage.accessModes }} ]
|
||
3 years ago
|
{{- if .Values.abacus.validator.storage.snapshot.enabled }}
|
||
3 years ago
|
dataSource:
|
||
3 years ago
|
name: {{ .Values.abacus.validator.storage.snapshot.name }}
|
||
3 years ago
|
kind: VolumeSnapshot
|
||
|
apiGroup: snapshot.storage.k8s.io
|
||
|
{{- end }}
|
||
3 years ago
|
resources:
|
||
|
requests:
|
||
3 years ago
|
storage: {{ .Values.abacus.validator.storage.size }}
|
||
3 years ago
|
{{- end }}
|