Skip to content

Commit

Permalink
Fix helm-chart replication only
Browse files Browse the repository at this point in the history
- Incorrect retry policy
- Missed config hash for restart
- Missed match-selectors
- Configurable logs-output

---

Pull Request resolved: #92
commit_hash:741ff74f92e8a33a7d8ab56f26f1bdb4120b8802
  • Loading branch information
laskoviymishka authored and robot-piglet committed Nov 7, 2024
1 parent 3ac7f03 commit db55cc8
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 4 deletions.
8 changes: 7 additions & 1 deletion helm/transfer/templates/_activate-job-ondemand.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: batch/v1
kind: CronJob
metadata:
name: transfer-{{ .Values.transferSpec.id }}-on-demand-snapshot
name: transfer-{{ .Values.transferSpec.id }}-adhoc
spec:
suspend: {{.Values.transferSpec.regular_snapshot.enabled}}
schedule: {{.Values.transferSpec.regular_snapshot.cron_expression}}
Expand All @@ -12,6 +12,12 @@ spec:
completionMode: Indexed
backoffLimit: 6
template:
metadata:
annotations:
prometheus.io/path: /metrics
prometheus.io/port: '9091'
prometheus.io/scrape: 'true'
spec:
restartPolicy: Never
{{- include "transfer.spec" (dict "commandType" "activate" "Values" .Values) | nindent 10 }}

6 changes: 6 additions & 0 deletions helm/transfer/templates/_activate-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,11 @@ spec:
completionMode: Indexed
backoffLimit: 6
template:
metadata:
annotations:
prometheus.io/path: /metrics
prometheus.io/port: '9091'
prometheus.io/scrape: 'true'
spec:
restartPolicy: Never
{{- include "transfer.spec" (dict "commandType" "activate" "Values" .Values) | nindent 6 }}
14 changes: 13 additions & 1 deletion helm/transfer/templates/_replication-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,20 @@ kind: StatefulSet
metadata:
name: transfer-{{ .Values.transferSpec.id }}-replication
spec:
selector:
matchLabels:
name: transfer-{{ .Values.transferSpec.id }}-replication
serviceName: transfer-{{ .Values.transferSpec.id }}-replication
replicas: {{ .Values.replication.worker_count }}
template:
metadata:
annotations:
prometheus.io/path: /metrics
prometheus.io/port: '9091'
prometheus.io/scrape: 'true'
checksum/config: '{{ .Values.transferSpec.src.params | toJson | sha256sum }}-{{ .Values.transferSpec.dst.params | toJson | sha256sum }}'
labels:
name: transfer-{{ .Values.transferSpec.id }}-replication
spec:
{{- include "transfer.spec" (dict "commandType" "replication" "Values" .Values) | nindent 6 }}
restartPolicy: Always
{{- include "transfer.spec" (dict "commandType" "replicate" "Values" .Values) | nindent 6 }}
15 changes: 14 additions & 1 deletion helm/transfer/templates/_transfer_spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ containers:
- "{{.Values.coordinator.type}}"
- "--coordinator-s3-bucket"
- "{{.Values.coordinator.bucket}}"
- "--log-level"
- "{{.Values.log.level}}"
- "--log-config"
- "{{.Values.log.config}}"
env:
{{- range $name, $value := .Values.env }}
- name: {{ $name }}
Expand All @@ -19,6 +23,16 @@ containers:
- name: config-volume
mountPath: /var/config/config.yaml
subPath: config.yaml
ports:
- name: prometheus
protocol: TCP
containerPort: 9091
- name: pprof
protocol: TCP
containerPort: 8080
- name: health
protocol: TCP
containerPort: 3000
resources:
requests:
memory: {{ .Values.resources.requests.memory }}
Expand All @@ -27,7 +41,6 @@ containers:
memory: {{ .Values.resources.limits.memory }}
cpu: {{ .Values.resources.limits.cpu }}

restartPolicy: Never
volumes:
- name: config-volume
configMap:
Expand Down
6 changes: 5 additions & 1 deletion helm/transfer/values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
image: ghcr.io/doublecloud/transfer:latest
image: ghcr.io/doublecloud/transfer:v0.0.0-rc7

resources:
requests:
Expand Down Expand Up @@ -39,3 +39,7 @@ coordinator:

env:
NO_KEY: NO_VALUE

log:
level: info # ("panic", "fatal", "error", "warning", "info", "debug")
config: minimal # ("console", "json", "minimal")

0 comments on commit db55cc8

Please sign in to comment.