-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #72 from RasaHQ/db_migration_service
Add the database migration service
- Loading branch information
Showing
9 changed files
with
238 additions
and
4 deletions.
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
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
78 changes: 78 additions & 0 deletions
78
charts/rasa-x/templates/db-migration-service-deployment.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,78 @@ | ||
{{ if and (eq "true" (include "db-migration-service.requiredVersion" .)) .Values.separateDBMigrationService }} | ||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
name: {{ .Release.Name }}-db-migration-service | ||
labels: | ||
{{- include "rasa-x.labels" . | nindent 4 }} | ||
app.kubernetes.io/component: db-migration-service | ||
spec: | ||
serviceName: "default" | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
{{- include "rasa-x.selectorLabels" . | nindent 6 }} | ||
app.kubernetes.io/component: db-migration-service | ||
template: | ||
metadata: | ||
labels: | ||
{{- include "rasa-x.selectorLabels" . | nindent 8 }} | ||
app.kubernetes.io/component: db-migration-service | ||
spec: | ||
automountServiceAccountToken: false | ||
{{ include "rasa-x.spec" . }} | ||
{{- if .Values.dbMigrationService.nodeSelector }} | ||
nodeSelector: | ||
{{ toYaml .Values.dbMigrationService.nodeSelector | indent 8 }} | ||
{{- end }} | ||
{{- if .Values.dbMigrationService.tolerations }} | ||
tolerations: | ||
{{ toYaml .Values.dbMigrationService.tolerations | indent 6 }} | ||
{{- end }} | ||
containers: | ||
- name: db-migration-service | ||
image: "{{ .Values.dbMigrationService.name }}:{{ include "db-migration-service.version" . }}" | ||
imagePullPolicy: {{ .Values.images.pullPolicy }} | ||
{{- if .Values.dbMigrationService.command }} | ||
command: | ||
{{- toYaml .Values.dbMigrationService.command | nindent 10 }} | ||
{{- end }} | ||
args: | ||
- python | ||
- -m | ||
- rasax.community.services.db_migration_service | ||
{{- if .Values.dbMigrationService.args }} | ||
{{- toYaml .Values.dbMigrationService.args | nindent 10 }} | ||
{{- end }} | ||
ports: | ||
- name: "http" | ||
containerPort: {{ .Values.dbMigrationService.port }} | ||
protocol: "TCP" | ||
livenessProbe: | ||
httpGet: | ||
path: "/health" | ||
port: "http" | ||
readinessProbe: | ||
httpGet: | ||
path: "/health" | ||
port: "http" | ||
{{- if .Values.dbMigrationService.extraVolumeMounts }} | ||
volumeMounts: | ||
{{ toYaml .Values.dbMigrationService.extraVolumeMounts | indent 8 }} | ||
{{- end }} | ||
env: | ||
- name: "SELF_PORT" | ||
value: {{ .Values.dbMigrationService.port | quote }} | ||
- name: "RUN_DATABASE_MIGRATION_AS_SEPARATE_SERVICE" | ||
value: "true" | ||
{{- include "rasa-x.psql.envs" . | nindent 8 }} | ||
{{- include "rasax.db-migration-service.extra.envs" . | nindent 8 }} | ||
{{- with .Values.dbMigrationService.resources }} | ||
resources: | ||
{{- toYaml . | nindent 10 }} | ||
{{- end }} | ||
{{- if .Values.dbMigrationService.extraVolumes }} | ||
volumes: | ||
{{ toYaml .Values.dbMigrationService.extraVolumes | indent 6 }} | ||
{{- 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,19 @@ | ||
{{ if and (eq "true" (include "db-migration-service.requiredVersion" .)) .Values.separateDBMigrationService }} | ||
apiVersion: "v1" | ||
kind: "Service" | ||
metadata: | ||
name: {{ include "rasa-x.fullname" . }}-db-migration-service-headless | ||
labels: | ||
{{- include "rasa-x.labels" . | nindent 4 }} | ||
app.kubernetes.io/component: db-migration-service | ||
spec: | ||
clusterIP: "None" | ||
ports: | ||
- port: {{ .Values.dbMigrationService.port }} | ||
targetPort: {{ .Values.dbMigrationService.port }} | ||
protocol: "TCP" | ||
name: "http" | ||
selector: | ||
{{- include "rasa-x.selectorLabels" . | nindent 4 }} | ||
app.kubernetes.io/component: db-migration-service | ||
{{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
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