From 7ef9065e9c713c145242dac4148f451c4a29c801 Mon Sep 17 00:00:00 2001 From: laurent grateau Date: Wed, 11 Oct 2017 15:05:53 +0200 Subject: [PATCH] Set default db to postgres. --- Bluemix/odm-standard-bx-lite.yaml | 4 ++-- Bluemix/odm-standard-bx-standard.yaml | 4 ++-- MiniKube/odm-standard-minikube.yml | 8 ++++---- gcloud/odm-standard-gcloud.yaml | 4 ++-- helm/stable/odmcharts/README.md | 3 +++ .../odmcharts/templates/dbserver-deployment.yaml | 12 ++++++++++-- .../stable/odmcharts/templates/dbserver-service.yaml | 2 +- helm/stable/odmcharts/values.yaml | 4 ++++ 8 files changed, 28 insertions(+), 13 deletions(-) diff --git a/Bluemix/odm-standard-bx-lite.yaml b/Bluemix/odm-standard-bx-lite.yaml index 1c90a061..fac8a2b9 100644 --- a/Bluemix/odm-standard-bx-lite.yaml +++ b/Bluemix/odm-standard-bx-lite.yaml @@ -16,7 +16,7 @@ spec: - name: SAMPLE value: "true" ports: - - containerPort: 1527 + - containerPort: 5432 --- apiVersion: v1 kind: Service @@ -28,7 +28,7 @@ spec: type: NodePort ports: - protocol: TCP - port: 1527 + port: 5432 --- apiVersion: extensions/v1beta1 # for versions before 1.6.0 use extensions/v1beta1 kind: Deployment diff --git a/Bluemix/odm-standard-bx-standard.yaml b/Bluemix/odm-standard-bx-standard.yaml index 8c2f28a2..a3664699 100644 --- a/Bluemix/odm-standard-bx-standard.yaml +++ b/Bluemix/odm-standard-bx-standard.yaml @@ -16,7 +16,7 @@ spec: - name: SAMPLE value: "true" ports: - - containerPort: 1527 + - containerPort: 5432 --- apiVersion: v1 kind: Service @@ -28,7 +28,7 @@ spec: type: LoadBalancer ports: - protocol: TCP - port: 1527 + port: 5432 --- apiVersion: extensions/v1beta1 # for versions before 1.6.0 use extensions/v1beta1 kind: Deployment diff --git a/MiniKube/odm-standard-minikube.yml b/MiniKube/odm-standard-minikube.yml index fabd231a..2763105e 100644 --- a/MiniKube/odm-standard-minikube.yml +++ b/MiniKube/odm-standard-minikube.yml @@ -48,11 +48,11 @@ spec: - name: SAMPLE value: "true" ports: - - containerPort: 1527 + - containerPort: 5432 volumeMounts: - name: odm-volume # mount path within the container - mountPath: /dbs + mountPath: /pgdata --- apiVersion: v1 kind: Service @@ -64,7 +64,7 @@ spec: type: NodePort ports: - protocol: TCP - port: 1527 + port: 5432 --- apiVersion: extensions/v1beta1 # for versions before 1.6.0 use extensions/v1beta1 kind: Deployment @@ -98,7 +98,7 @@ spec: port: 9080 - name: notification protocol: TCP - port: 1883 + port: 1883 --- apiVersion: extensions/v1beta1 # for versions before 1.6.0 use extensions/v1beta1 kind: Deployment diff --git a/gcloud/odm-standard-gcloud.yaml b/gcloud/odm-standard-gcloud.yaml index 9334c23a..c8b343ad 100644 --- a/gcloud/odm-standard-gcloud.yaml +++ b/gcloud/odm-standard-gcloud.yaml @@ -16,7 +16,7 @@ spec: - name: SAMPLE value: "true" ports: - - containerPort: 1527 + - containerPort: 5432 --- apiVersion: v1 kind: Service @@ -28,7 +28,7 @@ spec: type: LoadBalancer ports: - protocol: TCP - port: 1527 + port: 5432 --- apiVersion: extensions/v1beta1 # for versions before 1.6.0 use extensions/v1beta1 kind: Deployment diff --git a/helm/stable/odmcharts/README.md b/helm/stable/odmcharts/README.md index 07b07fb1..776de856 100644 --- a/helm/stable/odmcharts/README.md +++ b/helm/stable/odmcharts/README.md @@ -52,6 +52,9 @@ The following tables lists the configurable parameters of the Drupal chart and t | `image.pullPolicy` | Image pull policy | `IfNotPresent` | | `service.type` | Kubernetes Service type | `NodePort` | | `persistence.enabled` | Enable persistence using PVC | `false` | +| `persistence.postgresql.user` | This parameter is used in conjunction with 'persistence.postgresql.password' to set a user and its password. This parameter will create the specified user with superuser power and a database with the same name. | `odm` | +| `persistence.postgresql.password` | This parameter sets the superuser password for PostgreSQL. The default superuser is defined by the 'persistence.postgresql.user' environment variable. | `odm` | +| `persistence.postgresql.databasename` | This parameter can be used to define a different name for the default database that is created when the image is first started. | `odmdb` | | `decisionServerRuntime.replicaCount`| Number of the desired runtime | `2` | | `decisionCenter.replicaCount` | Number of the desired Decision Center | `1` | | `decisionRunner.replicaCount` | Number of the desired Decision Runner | `1` | diff --git a/helm/stable/odmcharts/templates/dbserver-deployment.yaml b/helm/stable/odmcharts/templates/dbserver-deployment.yaml index 51d06ff0..c9420f28 100755 --- a/helm/stable/odmcharts/templates/dbserver-deployment.yaml +++ b/helm/stable/odmcharts/templates/dbserver-deployment.yaml @@ -36,14 +36,22 @@ spec: image: {{ .Values.image.repository }}/dbserver:{{ .Values.image.tag }} imagePullPolicy: {{ .Values.image.pullPolicy }} env: + - name: POSTGRES_USER + value: "{{ .Values.persistence.postgresql.user }}" + - name: POSTGRES_PASSWORD + value: "{{ .Values.persistence.postgresql.password }}" + - name: POSTGRES_DB + value: "{{ .Values.persistence.postgresql.databasename }}" + - name: PGDATA + value: "/pgdata" - name: SAMPLE value: "{{ .Values.persistence.populateDataSample }}" ports: - - containerPort: 1527 + - containerPort: 5432 {{- if .Values.persistence.enabled }} volumeMounts: - name: {{ template "fullname" . }}-volume - mountPath: /dbs + mountPath: /pgdata {{- end }} {{- if (not (empty .Values.image.pullSecrets )) }} imagePullSecrets: diff --git a/helm/stable/odmcharts/templates/dbserver-service.yaml b/helm/stable/odmcharts/templates/dbserver-service.yaml index 79f29bcb..be27f605 100755 --- a/helm/stable/odmcharts/templates/dbserver-service.yaml +++ b/helm/stable/odmcharts/templates/dbserver-service.yaml @@ -24,4 +24,4 @@ spec: type: {{ .Values.service.type }} ports: - protocol: TCP - port: 1527 + port: 5432 diff --git a/helm/stable/odmcharts/values.yaml b/helm/stable/odmcharts/values.yaml index 2d5a3609..3abc240c 100755 --- a/helm/stable/odmcharts/values.yaml +++ b/helm/stable/odmcharts/values.yaml @@ -15,6 +15,10 @@ image: persistence: enabled: true populateDataSample: false + postgresql: + user: odm + password: odm + databasename: odmdb service: