-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new Cronjob - pools-extractor (#54)
* Add new Cronjob - pools-extractor
- Loading branch information
1 parent
46e22a8
commit c15eb8b
Showing
5 changed files
with
115 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
charts/blockscout-admin/templates/pools-extractor-configmap.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{{- if .Values.poolsExtractor.enabled }} | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: pools-{{ include "blockscout-admin.fullname" . }}-config | ||
labels: | ||
{{- include "blockscout-admin.labels" . | nindent 4 }} | ||
data: | ||
networks.json: | | ||
{ | ||
"networks": { | ||
{{- $len := len .Values.config.network }} | ||
{{- range $i, $value := .Values.config.network }} | ||
"{{ .id }}": { | ||
"coingecko_terminal_network_id": "{{ .coingecko_terminal_network_id }}" | ||
}{{- if ne (sub $len 1) $i }},{{- end }} | ||
{{- end }} | ||
} | ||
} | ||
{{- end }} |
59 changes: 59 additions & 0 deletions
59
charts/blockscout-admin/templates/pools-extractor-cronjob.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
{{- if .Values.poolsExtractor.enabled }} | ||
apiVersion: batch/v1 | ||
kind: CronJob | ||
metadata: | ||
name: pools-extractor-{{ include "blockscout-admin.fullname" . }} | ||
spec: | ||
schedule: {{ .Values.poolsExtractor.schedule | quote }} | ||
concurrencyPolicy: "Forbid" | ||
jobTemplate: | ||
spec: | ||
backoffLimit: 6 | ||
completions: 1 | ||
parallelism: 1 | ||
template: | ||
spec: | ||
restartPolicy: Never | ||
{{- with .Values.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
containers: | ||
- name: {{ .Release.Name }}-pools-extractor | ||
image: "{{ .Values.poolsExtractor.image.repository }}:{{ .Values.poolsExtractor.image.tag | default .Chart.AppVersion }}" | ||
imagePullPolicy: Always | ||
env: | ||
- name: POOLS_EXTRACTOR__CONTRACTS_INFO__URL | ||
value: http://contracts-info-{{ include "blockscout-admin.fullname" . }}:{{ .Values.contractsInfo.service.port }} | ||
{{- range .Values.poolsExtractor.environment }} | ||
- name: {{ .name }} | ||
value: {{ .value | quote }} | ||
{{- end }} | ||
envFrom: | ||
- secretRef: | ||
name: pools-extractor-{{ include "blockscout-admin.fullname" . }}-env | ||
resources: | ||
{{- toYaml .Values.poolsExtractor.resources | nindent 16 }} | ||
volumeMounts: | ||
- name: config | ||
mountPath: /app/config/networks.json | ||
subPath: networks.json | ||
volumes: | ||
- configMap: | ||
name: pools-{{ include "blockscout-admin.fullname" . }}-config | ||
defaultMode: 0777 | ||
name: config | ||
{{- with .Values.nodeSelector }} | ||
nodeSelector: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.affinity }} | ||
affinity: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.tolerations }} | ||
tolerations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
--- | ||
{{- end}} |
14 changes: 14 additions & 0 deletions
14
charts/blockscout-admin/templates/pools-extractor-secret.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{{- if .Values.poolsExtractor.enabled }} | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: pools-extractor-{{ include "blockscout-admin.fullname" . }}-env | ||
labels: | ||
{{- include "blockscout-admin.labels" . | nindent 4 }} | ||
type: Opaque | ||
data: | ||
{{- range .Values.poolsExtractor.envFromSecret }} | ||
{{ .name }}: {{ .value | b64enc }} | ||
{{- end }} | ||
{{- end }} | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters