-
Notifications
You must be signed in to change notification settings - Fork 11
Add support for replication service #380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
20b6b32
Add Replication to chart
guy-har 7b0b5bd
Add replication support
idanovo 9701012
Changelog
idanovo daec0b7
Re-use lakeFS ref-store in replication
idanovo d27c9a0
Pull from main
idanovo ff0fda3
Moved replication to a new dir and add liveness readiness probes
idanovo fe3eb88
Limit replications replica to one
idanovo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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.replication.enabled }} | ||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: {{ include "replication.fullname" . }} | ||
| labels: | ||
| {{- include "replication.labels" . | nindent 4 }} | ||
| data: | ||
| config.yaml: | | ||
| {{- $config := deepCopy .Values.replication.config }} | ||
| {{- $_ := set $config "committed" (dict "local_cache" (dict "dir" (printf "%s/cache" .Values.replication.local_cache.base_dir) "size_bytes" .Values.replication.local_cache.size_bytes)) }} | ||
| {{- /* Auto-populate refstore_database from lakefsConfig.database if not explicitly set */ -}} | ||
| {{- if not (hasKey $config "refstore_database") }} | ||
| {{- $lakefsConf := fromYaml .Values.lakefsConfig }} | ||
| {{- if and $lakefsConf (hasKey $lakefsConf "database") }} | ||
| {{- $_ := set $config "refstore_database" $lakefsConf.database }} | ||
| {{- end }} | ||
| {{- end }} | ||
| {{- toYaml $config | nindent 4 }} | ||
| {{- end }} |
This file contains hidden or 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,96 @@ | ||
| {{- if .Values.replication.enabled }} | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: {{ include "replication.fullname" . }} | ||
| labels: | ||
| {{- include "replication.labels" . | nindent 4 }} | ||
| spec: | ||
| # Increasing replicas will not improve performance and is not recommended. | ||
| # The service uses internal concurrency controls and running multiple replicas | ||
| # may cause conflicts. | ||
| replicas: 1 | ||
| selector: | ||
| matchLabels: | ||
| {{- include "replication.selectorLabels" . | nindent 6 }} | ||
| template: | ||
| metadata: | ||
| annotations: | ||
| checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} | ||
| {{- with .Values.replication.podAnnotations }} | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| labels: | ||
| {{- include "replication.selectorLabels" . | nindent 8 }} | ||
| spec: | ||
| {{- if .Values.replication.serviceAccountName }} | ||
| serviceAccountName: {{ .Values.replication.serviceAccountName }} | ||
| {{- end }} | ||
| containers: | ||
| - name: replication | ||
| image: "{{ .Values.replication.image.repository }}:{{ .Values.replication.image.tag }}" | ||
| imagePullPolicy: {{ .Values.replication.image.pullPolicy }} | ||
| args: ["run", "--config", "/etc/replication/config.yaml"] | ||
| ports: | ||
| - containerPort: {{ .Values.replication.port }} | ||
| protocol: TCP | ||
| {{- if or .Values.replication.extraEnvVars .Values.replication.extraEnvVarsSecret }} | ||
| env: | ||
| {{- with .Values.replication.extraEnvVars }} | ||
| {{- toYaml . | nindent 12 }} | ||
| {{- end }} | ||
| {{- if .Values.replication.extraEnvVarsSecret }} | ||
| - name: REPLICATION_LAKEFS_ACCESS_KEY_ID | ||
| valueFrom: | ||
| secretKeyRef: | ||
| name: {{ .Values.replication.extraEnvVarsSecret }} | ||
| key: source_lakefs_access_key_id | ||
|
Comment on lines
+43
to
+47
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure this should a env var or a secret, but it's fine like this |
||
| - name: REPLICATION_LAKEFS_SECRET_ACCESS_KEY | ||
| valueFrom: | ||
| secretKeyRef: | ||
| name: {{ .Values.replication.extraEnvVarsSecret }} | ||
| key: source_lakefs_secret_access_key | ||
| - name: REPLICATION_AUTH_ENCRYPT_SECRET_KEY | ||
| valueFrom: | ||
| secretKeyRef: | ||
| name: {{ .Values.replication.extraEnvVarsSecret }} | ||
| key: auth_encrypt_secret_key | ||
| {{- end }} | ||
| {{- end }} | ||
| volumeMounts: | ||
| - name: config | ||
| mountPath: /etc/replication | ||
| readOnly: true | ||
| - name: cache | ||
| mountPath: {{ .Values.replication.local_cache.base_dir }} | ||
| readinessProbe: | ||
| httpGet: | ||
| path: /_health | ||
| port: {{ .Values.replication.port }} | ||
| initialDelaySeconds: 5 | ||
| periodSeconds: 10 | ||
| livenessProbe: | ||
| httpGet: | ||
| path: /_health | ||
| port: {{ .Values.replication.port }} | ||
| initialDelaySeconds: 10 | ||
| periodSeconds: 30 | ||
| {{- with .Values.replication.resources }} | ||
| resources: | ||
| {{- toYaml . | nindent 12 }} | ||
| {{- end }} | ||
| volumes: | ||
| - name: config | ||
| configMap: | ||
| name: {{ include "replication.fullname" . }} | ||
| - name: cache | ||
| emptyDir: {} | ||
| {{- if (.Values.image.privateRegistry).enabled }} | ||
| imagePullSecrets: | ||
| {{- if (.Values.image.privateRegistry).secretToken }} | ||
| - name: "docker-registry" | ||
| {{- else if (.Values.image.privateRegistry).secretName }} | ||
| - name: {{ .Values.image.privateRegistry.secretName }} | ||
| {{- end }} | ||
| {{- end }} | ||
| {{- end }} | ||
This file contains hidden or 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,16 @@ | ||
| {{- if .Values.replication.enabled }} | ||
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| name: {{ include "replication.fullname" . }} | ||
| labels: | ||
| {{- include "replication.labels" . | nindent 4 }} | ||
| spec: | ||
| type: ClusterIP | ||
| ports: | ||
| - port: {{ .Values.replication.port }} | ||
| targetPort: {{ .Values.replication.port }} | ||
| protocol: TCP | ||
| selector: | ||
| {{- include "replication.selectorLabels" . | nindent 4 }} | ||
| {{- end }} |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should wait for the next version, which should be released today/tomorrow. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's necessary
I don't want to be a blocker for whoever is going to release a new version.
Replication app version can always be changed by the user or us
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can set the default tag to be 0.1.17, which will be released tomorrow instead