Skip to content

Commit

Permalink
Merge pull request #129 from 3scale/add-postgresql-compatibility
Browse files Browse the repository at this point in the history
Add system's PostgreSQL compatibility
  • Loading branch information
miguelsorianod authored May 30, 2019
2 parents 24c87cf + 5340351 commit e73506e
Show file tree
Hide file tree
Showing 38 changed files with 9,817 additions and 410 deletions.
5 changes: 5 additions & 0 deletions deploy/crds/apps_v1alpha1_apimanager_crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ spec:
image:
type: string
type: object
postgresql:
properties:
image:
type: string
type: object
type: object
fileStorage:
properties:
Expand Down
2 changes: 1 addition & 1 deletion pkg/3scale/amp/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.DEFAULT_GOAL := help
SHELL := bash -eo pipefail

templates = amp.yml amp-s3.yml amp-eval.yml amp-eval-s3.yml amp-ha.yml
templates = amp.yml amp-s3.yml amp-eval.yml amp-eval-s3.yml amp-ha.yml amp-postgresql.yml

targets = $(foreach template,$(templates),./auto-generated-templates/amp/$(template) ./auto-generated-templates/productized_templates/amp/$(template))

Expand Down
67 changes: 34 additions & 33 deletions pkg/3scale/amp/auto-generated-templates/amp/amp-eval-s3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ objects:
openshift.io/display-name: Zync ${AMP_RELEASE} PostgreSQL
from:
kind: DockerImage
name: ${POSTGRESQL_IMAGE}
name: ${ZYNC_DATABASE_IMAGE}
generation: null
importPolicy:
insecure: ${{IMAGESTREAM_TAG_IMPORT_INSECURE}}
Expand Down Expand Up @@ -345,6 +345,13 @@ objects:
type: ""
status:
dockerImageRepository: ""
- apiVersion: v1
imagePullSecrets:
- name: threescale-registry-auth
kind: ServiceAccount
metadata:
creationTimestamp: null
name: amp
- apiVersion: image.openshift.io/v1
kind: ImageStream
metadata:
Expand Down Expand Up @@ -373,7 +380,7 @@ objects:
openshift.io/display-name: System ${AMP_RELEASE} MySQL
from:
kind: DockerImage
name: ${MYSQL_IMAGE}
name: ${SYSTEM_DATABASE_IMAGE}
generation: null
importPolicy:
insecure: ${{IMAGESTREAM_TAG_IMPORT_INSECURE}}
Expand All @@ -382,13 +389,6 @@ objects:
type: ""
status:
dockerImageRepository: ""
- apiVersion: v1
imagePullSecrets:
- name: threescale-registry-auth
kind: ServiceAccount
metadata:
creationTimestamp: null
name: amp
- apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
metadata:
Expand Down Expand Up @@ -1217,9 +1217,9 @@ objects:
key: DB_PASSWORD
name: system-database
- name: MYSQL_DATABASE
value: ${MYSQL_DATABASE}
value: ${SYSTEM_DATABASE}
- name: MYSQL_ROOT_PASSWORD
value: ${MYSQL_ROOT_PASSWORD}
value: ${SYSTEM_DATABASE_ROOT_PASSWORD}
- name: MYSQL_LOWER_CASE_TABLE_NAMES
value: "1"
- name: MYSQL_DEFAULTS_FILE
Expand Down Expand Up @@ -1361,9 +1361,9 @@ objects:
threescale_component: system
name: system-database
stringData:
DB_PASSWORD: ${MYSQL_PASSWORD}
DB_USER: ${MYSQL_USER}
URL: mysql2://root:${MYSQL_ROOT_PASSWORD}@system-mysql/${MYSQL_DATABASE}
DB_PASSWORD: ${SYSTEM_DATABASE_PASSWORD}
DB_USER: ${SYSTEM_DATABASE_USER}
URL: mysql2://root:${SYSTEM_DATABASE_ROOT_PASSWORD}@system-mysql/${SYSTEM_DATABASE}
type: Opaque
- apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
Expand Down Expand Up @@ -4083,14 +4083,10 @@ parameters:
- name: AMP_SYSTEM_IMAGE
required: true
value: quay.io/3scale/porta:nightly
- description: Postgresql image to use
name: POSTGRESQL_IMAGE
- description: Zync's PostgreSQL image to use
name: ZYNC_DATABASE_IMAGE
required: true
value: registry.access.redhat.com/rhscl/postgresql-10-rhel7
- description: Mysql image to use
name: MYSQL_IMAGE
required: true
value: registry.access.redhat.com/rhscl/mysql-57-rhel7:5.7
- description: Memcached image to use
name: MEMCACHED_IMAGE
required: true
Expand All @@ -4100,31 +4096,36 @@ parameters:
name: IMAGESTREAM_TAG_IMPORT_INSECURE
required: true
value: "false"
- description: System MySQL image to use
name: SYSTEM_DATABASE_IMAGE
required: true
value: registry.access.redhat.com/rhscl/mysql-57-rhel7:5.7
- description: Redis image to use
name: REDIS_IMAGE
required: true
value: registry.access.redhat.com/rhscl/redis-32-rhel7:3.2
- description: Username for MySQL user that will be used for accessing the database.
displayName: MySQL User
name: MYSQL_USER
- description: Username for System's MySQL user that will be used for accessing the
database.
displayName: System MySQL User
name: SYSTEM_DATABASE_USER
required: true
value: mysql
- description: Password for the MySQL user.
displayName: MySQL Password
- description: Password for the System's MySQL user.
displayName: System MySQL Password
from: '[a-z0-9]{8}'
generate: expression
name: MYSQL_PASSWORD
name: SYSTEM_DATABASE_PASSWORD
required: true
- description: Name of the MySQL database accessed.
displayName: MySQL Database Name
name: MYSQL_DATABASE
- description: Name of the System's MySQL database accessed.
displayName: System MySQL Database Name
name: SYSTEM_DATABASE
required: true
value: system
- description: Password for Root user.
displayName: MySQL Root password.
displayName: System MySQL Root password.
from: '[a-z0-9]{8}'
generate: expression
name: MYSQL_ROOT_PASSWORD
name: SYSTEM_DATABASE_ROOT_PASSWORD
required: true
- description: Internal 3scale API username for internal 3scale api auth.
name: SYSTEM_BACKEND_USERNAME
Expand Down Expand Up @@ -4176,8 +4177,8 @@ parameters:
name: RECAPTCHA_PUBLIC_KEY
- description: reCAPTCHA secret key (used in spam protection)
name: RECAPTCHA_PRIVATE_KEY
- description: Password for the PostgreSQL connection user.
displayName: PostgreSQL Connection Password
- description: Password for the Zync Database PostgreSQL connection user.
displayName: Zync Database PostgreSQL Connection Password
from: '[a-zA-Z0-9]{16}'
generate: expression
name: ZYNC_DATABASE_PASSWORD
Expand Down
67 changes: 34 additions & 33 deletions pkg/3scale/amp/auto-generated-templates/amp/amp-eval.yml
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ objects:
openshift.io/display-name: Zync ${AMP_RELEASE} PostgreSQL
from:
kind: DockerImage
name: ${POSTGRESQL_IMAGE}
name: ${ZYNC_DATABASE_IMAGE}
generation: null
importPolicy:
insecure: ${{IMAGESTREAM_TAG_IMPORT_INSECURE}}
Expand Down Expand Up @@ -344,6 +344,13 @@ objects:
type: ""
status:
dockerImageRepository: ""
- apiVersion: v1
imagePullSecrets:
- name: threescale-registry-auth
kind: ServiceAccount
metadata:
creationTimestamp: null
name: amp
- apiVersion: image.openshift.io/v1
kind: ImageStream
metadata:
Expand Down Expand Up @@ -372,7 +379,7 @@ objects:
openshift.io/display-name: System ${AMP_RELEASE} MySQL
from:
kind: DockerImage
name: ${MYSQL_IMAGE}
name: ${SYSTEM_DATABASE_IMAGE}
generation: null
importPolicy:
insecure: ${{IMAGESTREAM_TAG_IMPORT_INSECURE}}
Expand All @@ -381,13 +388,6 @@ objects:
type: ""
status:
dockerImageRepository: ""
- apiVersion: v1
imagePullSecrets:
- name: threescale-registry-auth
kind: ServiceAccount
metadata:
creationTimestamp: null
name: amp
- apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
metadata:
Expand Down Expand Up @@ -1216,9 +1216,9 @@ objects:
key: DB_PASSWORD
name: system-database
- name: MYSQL_DATABASE
value: ${MYSQL_DATABASE}
value: ${SYSTEM_DATABASE}
- name: MYSQL_ROOT_PASSWORD
value: ${MYSQL_ROOT_PASSWORD}
value: ${SYSTEM_DATABASE_ROOT_PASSWORD}
- name: MYSQL_LOWER_CASE_TABLE_NAMES
value: "1"
- name: MYSQL_DEFAULTS_FILE
Expand Down Expand Up @@ -1360,9 +1360,9 @@ objects:
threescale_component: system
name: system-database
stringData:
DB_PASSWORD: ${MYSQL_PASSWORD}
DB_USER: ${MYSQL_USER}
URL: mysql2://root:${MYSQL_ROOT_PASSWORD}@system-mysql/${MYSQL_DATABASE}
DB_PASSWORD: ${SYSTEM_DATABASE_PASSWORD}
DB_USER: ${SYSTEM_DATABASE_USER}
URL: mysql2://root:${SYSTEM_DATABASE_ROOT_PASSWORD}@system-mysql/${SYSTEM_DATABASE}
type: Opaque
- apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
Expand Down Expand Up @@ -3983,14 +3983,10 @@ parameters:
- name: AMP_SYSTEM_IMAGE
required: true
value: quay.io/3scale/porta:nightly
- description: Postgresql image to use
name: POSTGRESQL_IMAGE
- description: Zync's PostgreSQL image to use
name: ZYNC_DATABASE_IMAGE
required: true
value: registry.access.redhat.com/rhscl/postgresql-10-rhel7
- description: Mysql image to use
name: MYSQL_IMAGE
required: true
value: registry.access.redhat.com/rhscl/mysql-57-rhel7:5.7
- description: Memcached image to use
name: MEMCACHED_IMAGE
required: true
Expand All @@ -4000,31 +3996,36 @@ parameters:
name: IMAGESTREAM_TAG_IMPORT_INSECURE
required: true
value: "false"
- description: System MySQL image to use
name: SYSTEM_DATABASE_IMAGE
required: true
value: registry.access.redhat.com/rhscl/mysql-57-rhel7:5.7
- description: Redis image to use
name: REDIS_IMAGE
required: true
value: registry.access.redhat.com/rhscl/redis-32-rhel7:3.2
- description: Username for MySQL user that will be used for accessing the database.
displayName: MySQL User
name: MYSQL_USER
- description: Username for System's MySQL user that will be used for accessing the
database.
displayName: System MySQL User
name: SYSTEM_DATABASE_USER
required: true
value: mysql
- description: Password for the MySQL user.
displayName: MySQL Password
- description: Password for the System's MySQL user.
displayName: System MySQL Password
from: '[a-z0-9]{8}'
generate: expression
name: MYSQL_PASSWORD
name: SYSTEM_DATABASE_PASSWORD
required: true
- description: Name of the MySQL database accessed.
displayName: MySQL Database Name
name: MYSQL_DATABASE
- description: Name of the System's MySQL database accessed.
displayName: System MySQL Database Name
name: SYSTEM_DATABASE
required: true
value: system
- description: Password for Root user.
displayName: MySQL Root password.
displayName: System MySQL Root password.
from: '[a-z0-9]{8}'
generate: expression
name: MYSQL_ROOT_PASSWORD
name: SYSTEM_DATABASE_ROOT_PASSWORD
required: true
- description: Internal 3scale API username for internal 3scale api auth.
name: SYSTEM_BACKEND_USERNAME
Expand Down Expand Up @@ -4076,8 +4077,8 @@ parameters:
name: RECAPTCHA_PUBLIC_KEY
- description: reCAPTCHA secret key (used in spam protection)
name: RECAPTCHA_PRIVATE_KEY
- description: Password for the PostgreSQL connection user.
displayName: PostgreSQL Connection Password
- description: Password for the Zync Database PostgreSQL connection user.
displayName: Zync Database PostgreSQL Connection Password
from: '[a-zA-Z0-9]{16}'
generate: expression
name: ZYNC_DATABASE_PASSWORD
Expand Down
10 changes: 5 additions & 5 deletions pkg/3scale/amp/auto-generated-templates/amp/amp-ha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ objects:
openshift.io/display-name: Zync ${AMP_RELEASE} PostgreSQL
from:
kind: DockerImage
name: ${POSTGRESQL_IMAGE}
name: ${ZYNC_DATABASE_IMAGE}
generation: null
importPolicy:
insecure: ${{IMAGESTREAM_TAG_IMPORT_INSECURE}}
Expand Down Expand Up @@ -3483,8 +3483,8 @@ parameters:
- name: AMP_SYSTEM_IMAGE
required: true
value: quay.io/3scale/porta:nightly
- description: Postgresql image to use
name: POSTGRESQL_IMAGE
- description: Zync's PostgreSQL image to use
name: ZYNC_DATABASE_IMAGE
required: true
value: registry.access.redhat.com/rhscl/postgresql-10-rhel7
- description: Memcached image to use
Expand Down Expand Up @@ -3546,8 +3546,8 @@ parameters:
name: RECAPTCHA_PUBLIC_KEY
- description: reCAPTCHA secret key (used in spam protection)
name: RECAPTCHA_PRIVATE_KEY
- description: Password for the PostgreSQL connection user.
displayName: PostgreSQL Connection Password
- description: Password for the Zync Database PostgreSQL connection user.
displayName: Zync Database PostgreSQL Connection Password
from: '[a-zA-Z0-9]{16}'
generate: expression
name: ZYNC_DATABASE_PASSWORD
Expand Down
Loading

0 comments on commit e73506e

Please sign in to comment.