-
Notifications
You must be signed in to change notification settings - Fork 9
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
Twins importer #360
Merged
Merged
Twins importer #360
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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,33 @@ | ||
{{- if and .Values.importer.cleaner.enabled .Values.importer.postgres.schemaSwitchEnabled }} | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: {{ include "twins.importer.name" . }}-cleaner | ||
labels: | ||
{{- include "twins.importer.labels" . | nindent 4 }} | ||
annotations: | ||
"helm.sh/hook": post-install,post-upgrade | ||
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded | ||
spec: | ||
backoffLimit: 0 | ||
template: | ||
metadata: | ||
name: {{ include "twins.importer.name" . }}-cleaner | ||
labels: | ||
{{- include "twins.importer.labels" . | nindent 8 }} | ||
spec: | ||
restartPolicy: Never | ||
containers: | ||
- name: cleaner-job | ||
image: {{ required "A valid .Values.dgctlDockerRegistry entry required" .Values.dgctlDockerRegistry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }} | ||
imagePullPolicy: {{ .Values.imagePullPolicy }} | ||
command: [ "twins-importer", "clear" ] | ||
resources: | ||
{{- toYaml .Values.importer.cleaner.resources | nindent 12 }} | ||
env: | ||
{{- include "twins.env.importer" . | nindent 12 }} | ||
{{- with .Values.importer.nodeSelector }} | ||
nodeSelector: | ||
{{- toYaml . | nindent 8 }} | ||
{{- 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{{- if .Values.importer.enabled }} | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: {{ include "twins.importer.name" . }} | ||
labels: | ||
{{- include "twins.importer.labels" . | nindent 4 }} | ||
annotations: | ||
"helm.sh/hook": pre-install,pre-upgrade | ||
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded | ||
"helm.sh/hook-weight": "10" | ||
spec: | ||
backoffLimit: 0 | ||
template: | ||
metadata: | ||
name: {{ include "twins.importer.name" . }} | ||
labels: | ||
{{- include "twins.importer.labels" . | nindent 8 }} | ||
spec: | ||
restartPolicy: Never | ||
{{- if .Values.importer.initialDelaySeconds }} | ||
initContainers: | ||
- name: delay | ||
image: {{ required "A valid .Values.dgctlDockerRegistry entry required" .Values.dgctlDockerRegistry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }} | ||
command: [ "sh", "-c", "sleep {{ .Values.importer.initialDelaySeconds }}" ] | ||
resources: | ||
{{- toYaml .Values.importer.resources | nindent 12 }} | ||
{{- end }} | ||
containers: | ||
- name: importer | ||
image: {{ required "A valid .Values.dgctlDockerRegistry entry required" .Values.dgctlDockerRegistry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }} | ||
imagePullPolicy: {{ .Values.imagePullPolicy }} | ||
command: [ "twins-importer", "import" ] | ||
resources: | ||
{{- toYaml .Values.importer.resources | nindent 12 }} | ||
env: | ||
{{- include "twins.env.importer" . | nindent 12 }} | ||
{{- if .Values.importer.persistentVolume.enabled }} | ||
volumeMounts: | ||
- name: {{ include "twins.importer.name" . }}-pv | ||
mountPath: "/tmp" | ||
{{- end }} | ||
{{- if .Values.importer.persistentVolume.enabled }} | ||
volumes: | ||
- name: {{ include "twins.importer.name" . }}-pv | ||
persistentVolumeClaim: | ||
claimName: {{ include "twins.importer.name" . }} | ||
{{- end }} | ||
{{- with .Values.importer.nodeSelector }} | ||
nodeSelector: | ||
{{- toYaml . | nindent 8 }} | ||
{{- 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{{- if .Values.importer.persistentVolume.enabled }} | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: {{ include "twins.importer.name" . }} | ||
labels: | ||
{{- include "twins.importer.labels" . | nindent 4 }} | ||
annotations: | ||
"helm.sh/hook": pre-install,pre-upgrade | ||
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded | ||
"helm.sh/hook-weight": "-20" | ||
spec: | ||
storageClassName: {{ .Values.importer.persistentVolume.storageClass }} | ||
{{- with .Values.importer.persistentVolume.accessModes }} | ||
accessModes: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
resources: | ||
requests: | ||
storage: {{ .Values.importer.persistentVolume.size }} | ||
{{- 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
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,16 @@ | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: {{ include "twins.secret.jobs.name" . }} | ||
labels: | ||
{{- include "twins.labels" . | nindent 4 }} | ||
annotations: | ||
"helm.sh/hook": post-install,post-upgrade | ||
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded | ||
"helm.sh/hook-weight": "-20" | ||
type: Opaque | ||
data: | ||
dbROPassword: {{ required "A valid .Values.postgres.ro.password required" .Values.postgres.ro.password | b64enc }} | ||
dbRWPassword: {{ required "A valid .Values.postgres.rw.password required" .Values.postgres.rw.password | b64enc }} | ||
dgctlStorageAccessKey: {{ required "A valid .Values.dgctlStorage.accessKey required" .Values.dgctlStorage.accessKey | b64enc }} | ||
dgctlStorageSecretKey: {{ required "A valid .Values.dgctlStorage.secretKey required" .Values.dgctlStorage.secretKey | b64enc }} |
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
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 |
---|---|---|
|
@@ -14,6 +14,21 @@ dgctlDockerRegistry: '' | |
|
||
imagePullSecrets: [] | ||
|
||
# @section Deployment Artifacts Storage settings | ||
|
||
# @param dgctlStorage.host S3 host. Format: `host:port`. **Required** | ||
# @param dgctlStorage.bucket S3 bucket name. **Required** | ||
# @param dgctlStorage.accessKey S3 access key for accessing the bucket. **Required** | ||
# @param dgctlStorage.secretKey S3 secret key for accessing the bucket. **Required** | ||
# @param dgctlStorage.manifest The path to the [manifest file](https://docs.2gis.com/en/on-premise/overview#nav-lvl2@paramCommon_deployment_steps). Format: `manifests/0000000000.json` <br> This file contains the description of pieces of data that the service requires to operate. **Required** | ||
|
||
dgctlStorage: | ||
host: '' | ||
bucket: '' | ||
accessKey: '' | ||
secretKey: '' | ||
denrockit marked this conversation as resolved.
Show resolved
Hide resolved
|
||
manifest: '' | ||
|
||
image: | ||
repository: 2gis-on-premise/twins-api | ||
tag: 1.6.0 | ||
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. 1.7.3 |
||
|
@@ -45,6 +60,12 @@ api: | |
|
||
replicas: 1 | ||
|
||
# @section api.resources **Kubernetes [resource management](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) settings** | ||
# @param api.resources.requests.cpu A CPU request. | ||
# @param api.resources.requests.memory A memory request. | ||
# @param api.resources.limits.cpu A CPU limit. | ||
# @param api.resources.limits.memory A memory limit. | ||
|
||
resources: | ||
requests: | ||
cpu: 50m | ||
|
@@ -131,6 +152,12 @@ migrate: | |
|
||
initialDelaySeconds: 0 | ||
|
||
# @section migrate.resources **Kubernetes [resource management](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) settings** | ||
# @param migrate.resources.requests.cpu A CPU request. | ||
# @param migrate.resources.requests.memory A memory request. | ||
# @param migrate.resources.limits.cpu A CPU limit. | ||
# @param migrate.resources.limits.memory A memory limit. | ||
|
||
resources: | ||
requests: | ||
cpu: 10m | ||
|
@@ -187,16 +214,82 @@ postgres: | |
password: '' | ||
|
||
|
||
# @section Limits | ||
# @section Kubernetes Importer job settings | ||
|
||
# @extra importer **Common settings** | ||
# @param importer.enabled If importer is enabled for the service | ||
# @param importer.nodeSelector Kubernetes [node selectors](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) | ||
# @param importer.initialDelaySeconds Number of seconds after the container has started before liveness or readiness probes are initiated | ||
# @param importer.retry.download.maxAttempts The maximum number of retries download before stopping | ||
# @param importer.retry.download.delay Delay until the retry attempts download | ||
# @param importer.retry.execute.maxAttempts The maximum number of retries execute psql command before stopping | ||
# @param importer.retry.execute.delay Delay until the retry attempts execute | ||
|
||
importer: | ||
enabled: true | ||
denrockit marked this conversation as resolved.
Show resolved
Hide resolved
|
||
nodeSelector: {} | ||
initialDelaySeconds: 1 | ||
retry: | ||
download: | ||
maxAttempts: 3 | ||
delay: 1s | ||
execute: | ||
maxAttempts: 3 | ||
delay: 1s | ||
|
||
# @section importer.postgres **Database settings** | ||
# @param importer.postgres.schemaSwitchEnabled Automatic switch PostgreSQL schema on releases | ||
|
||
# @extra api.resources **Limits for the API service** | ||
# @param api.resources.requests.cpu A CPU request. | ||
# @param api.resources.requests.memory A memory request. | ||
# @param api.resources.limits.cpu A CPU limit. | ||
# @param api.resources.limits.memory A memory limit. | ||
postgres: | ||
schemaSwitchEnabled: true | ||
|
||
# @extra migrate.resources **Limits for the Migrate service** | ||
# @param migrate.resources.requests.cpu A CPU request. | ||
# @param migrate.resources.requests.memory A memory request. | ||
# @param migrate.resources.limits.cpu A CPU limit. | ||
# @param migrate.resources.limits.memory A memory limit. | ||
# @section importer.persistentVolume **Persistent Volume settings** | ||
|
||
# @param importer.persistentVolume.enabled If [Persistent Volumes](https://kubernetes.io/docs/concepts/storage/persistent-volumes/) is enabled for the service | ||
# @param importer.persistentVolume.accessModes Persistent Volume [Access Mode](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes) | ||
# @param importer.persistentVolume.storageClass Kubernetes [Storage Classes](https://kubernetes.io/docs/concepts/storage/storage-classes/) | ||
# @param importer.persistentVolume.size Volume size | ||
|
||
persistentVolume: | ||
enabled: false | ||
accessModes: | ||
- ReadWriteOnce | ||
storageClass: topolvm-ext4 | ||
size: 50Gi | ||
|
||
# @section importer.resources **Kubernetes [resource management](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) settings** | ||
# @param importer.resources.requests.cpu A CPU request | ||
# @param importer.resources.requests.memory A memory request | ||
# @param importer.resources.limits.cpu A CPU limit | ||
# @param importer.resources.limits.memory A memory limit | ||
|
||
resources: | ||
requests: | ||
cpu: 256m | ||
memory: 512Mi | ||
limits: | ||
cpu: 2 | ||
memory: 2048Mi | ||
|
||
# @section importer.cleaner **Cleaner scheme settings** | ||
# @param importer.cleaner.enabled If clean schemes is enabled for the service | ||
# @param importer.cleaner.versionLimit Number of backup schemes | ||
|
||
|
||
cleaner: | ||
enabled: true | ||
versionLimit: 2 | ||
|
||
# @section importer.cleaner.resources **Kubernetes [resource management](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) settings** | ||
# @param importer.cleaner.resources.requests.cpu A CPU request | ||
# @param importer.cleaner.resources.requests.memory A memory request | ||
# @param importer.cleaner.resources.limits.cpu A CPU limit | ||
# @param importer.cleaner.resources.limits.memory A memory limit | ||
|
||
resources: | ||
requests: | ||
cpu: 50m | ||
memory: 128Mi | ||
limits: | ||
cpu: 1000m | ||
memory: 512Mi |
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.
Мы не стали использовать чтобы в secret-deploys не было лишних переменных и/или такая практика среди остальных проектов?