diff --git a/charts/rafiki-auth/Chart.yaml b/charts/rafiki-auth/Chart.yaml index f1957f3..249af41 100644 --- a/charts/rafiki-auth/Chart.yaml +++ b/charts/rafiki-auth/Chart.yaml @@ -17,7 +17,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.4.0 +version: 0.4.1 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/rafiki-auth/templates/configmap.yaml b/charts/rafiki-auth/templates/configmap.yaml index 4d529ce..cffdba0 100644 --- a/charts/rafiki-auth/templates/configmap.yaml +++ b/charts/rafiki-auth/templates/configmap.yaml @@ -19,3 +19,4 @@ data: NODE_ENV: "{{ .Values.nodeEnv }}" PORT: "{{ .Values.port.auth }}" WAIT_SECONDS: "{{ .Values.grant.waitSeconds }}" + ENABLE_MANUAL_MIGRATIONS: "{{ .Values.enableManualMigrations }}" diff --git a/charts/rafiki-auth/templates/deployment.yaml b/charts/rafiki-auth/templates/deployment.yaml index 38e90fe..051d10e 100644 --- a/charts/rafiki-auth/templates/deployment.yaml +++ b/charts/rafiki-auth/templates/deployment.yaml @@ -21,24 +21,33 @@ spec: app.kubernetes.io/name: {{ include "rafiki-auth.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} spec: - {{- with .Values.imagePullSecrets }} + {{- with .Values.imagePullSecrets -}} imagePullSecrets: {{- toYaml . | nindent 8 }} - {{- end }} - {{ if .Values.serviceAccount.create }} + {{- end -}} + {{- if .Values.serviceAccount.create }} serviceAccountName: {{ template "auth.serviceAccountName" . }} + {{ with .Values.podSecurityContext -}} securityContext: - {{- toYaml .Values.podSecurityContext | nindent 8 }} - {{ end }} + {{- toYaml . | nindent 8 -}} + {{- end -}} + {{- end }} + {{- if .Values.serviceAccount.create -}} volumes: - {{ if .Values.serviceAccount.create }} - name: {{ include "rafiki-auth.fullname" . }}-sa-key secret: secretName: {{ include "rafiki-auth.fullname" . }}-sa-key - {{ end }} + {{- end }} + {{- if .Values.enableManualMigrations }} + initContainers: + - name: database-migrations + image: {{ include "auth.image" . }} + command: ["npm", "run", "knex -- migrate:latest --env production"] + workingDir: /home/rafiki/packages/auth/ + {{- end }} containers: - name: {{ .Chart.Name }} - securityContext: + securityContext: {{- toYaml .Values.securityContext | nindent 12 }} image: {{ include "auth.image" . }} imagePullPolicy: {{ .Values.image.pullPolicy }} @@ -57,21 +66,7 @@ spec: - name: introspection containerPort: {{ .Values.port.introspection }} protocol: TCP - #livenessProbe: - # failureThreshold: 15 - # initialDelaySeconds: 30 - # periodSeconds: 10 - # timeoutSeconds: 10 - # httpGet: - # path: /healthz - # port: admin - #readinessProbe: - # failureThreshold: 3 - # initialDelaySeconds: 5 - # periodSeconds: 5 - # timeoutSeconds: 5 - # httpGet: - # path: /healthz - # port: http + {{- with .Values.resources -}} resources: - {{- toYaml .Values.resources | nindent 12 }} + {{- toYaml . | nindent 12 }} + {{- end -}} diff --git a/charts/rafiki-auth/values.yaml b/charts/rafiki-auth/values.yaml index f344f7e..05b0708 100644 --- a/charts/rafiki-auth/values.yaml +++ b/charts/rafiki-auth/values.yaml @@ -1,5 +1,6 @@ nodeEnv: development logLevel: debug +enableManualMigrations: true postgresql: host: "postgres.example.com" port: 5432 diff --git a/charts/rafiki-backend/Chart.yaml b/charts/rafiki-backend/Chart.yaml index febf991..648dc5f 100644 --- a/charts/rafiki-backend/Chart.yaml +++ b/charts/rafiki-backend/Chart.yaml @@ -17,7 +17,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.4.0 +version: 0.4.1 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/rafiki-backend/templates/configmap.yaml b/charts/rafiki-backend/templates/configmap.yaml index 245d847..d65c22e 100644 --- a/charts/rafiki-backend/templates/configmap.yaml +++ b/charts/rafiki-backend/templates/configmap.yaml @@ -43,4 +43,5 @@ data: WEBHOOK_URL: "{{ .Values.serviceUrls.WEBHOOK_URL }}" WEBHOOK_WORKERS: "{{ .Values.workers.webhook }}" WEBHOOK_WORKER_IDLE: "{{ .Values.workerIdle }}" - WITHDRAWAL_THROTTLE_DELAY: "{{ .Values.withdrawalThrottleDelay }}" \ No newline at end of file + WITHDRAWAL_THROTTLE_DELAY: "{{ .Values.withdrawalThrottleDelay }}" + ENABLE_MANUAL_MIGRATIONS: "{{ .Values.enableManualMigrations }}" \ No newline at end of file diff --git a/charts/rafiki-backend/templates/deployment.yaml b/charts/rafiki-backend/templates/deployment.yaml index cc2c6c5..5ffe58c 100644 --- a/charts/rafiki-backend/templates/deployment.yaml +++ b/charts/rafiki-backend/templates/deployment.yaml @@ -21,21 +21,30 @@ spec: app.kubernetes.io/name: {{ include "rafiki-backend.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} spec: - {{- with .Values.imagePullSecrets }} + {{- with .Values.imagePullSecrets -}} imagePullSecrets: {{- toYaml . | nindent 8 }} - {{- end }} - {{ if .Values.serviceAccount.create }} + {{- end -}} + {{- if .Values.serviceAccount.create }} serviceAccountName: {{ template "backend.serviceAccountName" . }} + {{ with .Values.podSecurityContext -}} securityContext: - {{- toYaml .Values.podSecurityContext | nindent 8 }} - {{ end }} + {{- toYaml . | nindent 8 -}} + {{- end -}} + {{- end }} + {{- if .Values.serviceAccount.create -}} volumes: - {{ if .Values.serviceAccount.create }} - name: {{ include "rafiki-backend.fullname" . }}-sa-key secret: secretName: {{ include "rafiki-backend.fullname" . }}-sa-key - {{ end }} + {{- end }} + {{- if .Values.enableManualMigrations }} + initContainers: + - name: database-migrations + image: {{ include "backend.image" . }} + command: ["npm", "run", "knex -- migrate:latest --env production"] + workingDir: /home/rafiki/packages/backend/ + {{- end }} containers: - name: {{ .Chart.Name }} securityContext: @@ -57,21 +66,5 @@ spec: - name: connector containerPort: {{ .Values.port.connector }} protocol: TCP - #livenessProbe: - # failureThreshold: 15 - # initialDelaySeconds: 30 - # periodSeconds: 10 - # timeoutSeconds: 10 - # httpGet: - # path: /healthz - # port: admin - #readinessProbe: - # failureThreshold: 3 - # initialDelaySeconds: 5 - # periodSeconds: 5 - # timeoutSeconds: 5 - # httpGet: - # path: /healthz - # port: http resources: {{- toYaml .Values.resources | nindent 12 }} diff --git a/charts/rafiki-backend/values.yaml b/charts/rafiki-backend/values.yaml index 907aa6d..00ab5cf 100644 --- a/charts/rafiki-backend/values.yaml +++ b/charts/rafiki-backend/values.yaml @@ -1,5 +1,6 @@ nodeEnv: development logLevel: debug +enableManualMigrations: true serviceUrls: PUBLIC_HOST: http://rafiki-backend OPEN_PAYMENTS_URL: http://rafiki-backend diff --git a/charts/rafiki-frontend/Chart.yaml b/charts/rafiki-frontend/Chart.yaml index 42004f7..0ce9097 100644 --- a/charts/rafiki-frontend/Chart.yaml +++ b/charts/rafiki-frontend/Chart.yaml @@ -17,7 +17,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.4.0 +version: 0.4.1 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/rafiki-frontend/values.yaml b/charts/rafiki-frontend/values.yaml index c51bb4a..3a5fd6e 100644 --- a/charts/rafiki-frontend/values.yaml +++ b/charts/rafiki-frontend/values.yaml @@ -17,10 +17,3 @@ serviceAccount: name: '' securityContext: {} -# resources: -# limits: -# memory: 1Gi -# cpu: 450m -# requests: -# memory: 800Mi -# cpu: 300m