diff --git a/charts/sophora-server/Chart.yaml b/charts/sophora-server/Chart.yaml index e0e5356..9cad05d 100644 --- a/charts/sophora-server/Chart.yaml +++ b/charts/sophora-server/Chart.yaml @@ -15,9 +15,9 @@ 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: 1.1.1 +version: 1.2.0 # 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 # follow Semantic Versioning. They should reflect the version the application is using. -appVersion: 4.16.0 +appVersion: 4.16.3 diff --git a/charts/sophora-server/README.md b/charts/sophora-server/README.md index b08a26d..3c5448f 100644 --- a/charts/sophora-server/README.md +++ b/charts/sophora-server/README.md @@ -6,7 +6,13 @@ The required secrets must be present before you install the server. Starting with Sophora 5 the archive repository is no longer available. To disable all archive related storage options, set `sophora.server.persistence.archiveType` to `none`. -In later chart versions this will be the default. +In later chart versions this will be the default. + +## Postgres connection + +Starting with Sophora 5 the installation requires postgres. +You can provide the credentials via a secret: `sophora.server.persistence.postgres.secret`. +For all other configuration options use `sophora.server.properties`. ## Tips for productive installations diff --git a/charts/sophora-server/templates/sophora-init-configmap.yaml b/charts/sophora-server/templates/sophora-init-configmap.yaml index 23fcd88..83a6492 100644 --- a/charts/sophora-server/templates/sophora-init-configmap.yaml +++ b/charts/sophora-server/templates/sophora-init-configmap.yaml @@ -26,6 +26,13 @@ data: sophora.remote.api.external.protocol=https {{- end }} + {{- if .Values.sophora.server.persistence.postgres.secret.name }} + # postgres authentication + sophora.persistence.postgres.username=${SOPHORA_PERSISTENCE_POSTGRES_USERNAME} + sophora.persistence.postgres.password=${SOPHORA_PERSISTENCE_POSTGRES_PASSWORD} + {{- end }} + + # custom config {{- toString (required "A valid sophora.properties configuration needs to be provided." .Values.sophora.server.properties) | nindent 4 }} diff --git a/charts/sophora-server/templates/statefulset.yaml b/charts/sophora-server/templates/statefulset.yaml index 3fabae1..3ec517c 100644 --- a/charts/sophora-server/templates/statefulset.yaml +++ b/charts/sophora-server/templates/statefulset.yaml @@ -73,6 +73,20 @@ spec: - name: EXTERNAL_HOSTS value: {{ range $i, $ingress := .Values.clusterReplication.ingresses }}{{ if $ingress.hosts }}{{ (index $ingress.hosts 0).host }} {{ end }}{{ end }} {{- end }} + {{- if .Values.sophora.server.persistence.postgres.secret.name }} + - name: SOPHORA_PERSISTENCE_POSTGRES_USERNAME + valueFrom: + secretKeyRef: + key: {{ .Values.sophora.server.persistence.postgres.secret.usernameKey }} + name: {{ .Values.sophora.server.persistence.postgres.secret.name }} + optional: false + - name: SOPHORA_PERSISTENCE_POSTGRES_PASSWORD + valueFrom: + secretKeyRef: + key: {{ .Values.sophora.server.persistence.postgres.secret.passwordKey }} + name: {{ .Values.sophora.server.persistence.postgres.secret.name }} + optional: false + {{- end }} {{ if .Values.configInitializer.env -}} {{- toYaml .Values.configInitializer.env | nindent 12 }} {{- end }} diff --git a/charts/sophora-server/test-values.yaml b/charts/sophora-server/test-values.yaml index 642151c..f886b67 100644 --- a/charts/sophora-server/test-values.yaml +++ b/charts/sophora-server/test-values.yaml @@ -45,17 +45,16 @@ sophora: storage: 200Gi persistence: repositoryType: mysql - archiveType: mysql + archiveType: none mysql: repositories: - secretName: repository-secret01 hostnameKey: new-hostname - - secretName: repository-secret02 - - secretName: repository-secret03 - archives: - - secretName: archive-secret01 - - secretName: archive-secret02 - - secretName: archive-secret03 + postgres: + secret: + name: postgres-auth + usernameKey: user1 + passwordKey: pass1 binaryStore: s3: secret: diff --git a/charts/sophora-server/values.yaml b/charts/sophora-server/values.yaml index 520c6a0..09108f7 100644 --- a/charts/sophora-server/values.yaml +++ b/charts/sophora-server/values.yaml @@ -191,6 +191,14 @@ sophora: ## usernameKey: ## passwordKey: archives: [] + + ## @param sophora.server.persistence.postgres postgres authentication via secret. Required for Sophora Server >5.0.0. + postgres: + secret: + name: + usernameKey: username + passwordKey: password + binaryStore: s3: secret: @@ -199,10 +207,10 @@ sophora: accessKeyIdKey: accessKeyId authentication: - secret: - name: - usernameKey: username - passwordKey: password + secret: + name: + usernameKey: username + passwordKey: password # Additional environment variables can be defined here env: