Skip to content

Commit

Permalink
[3.2.0][Pattern-1] Add MySQL JDBC driver to APIM and Dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
chirangaalwis committed Aug 11, 2020
1 parent 019f0bb commit 8a1a06f
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ data:
ssoEnabled: true
properties:
adminScope: apim_analytics:admin_carbon.super
allScopes: apim_analytics:admin openid apim:api_view apim:subscribe apim_analytics:monitoring_dashboard:own apim_analytics:monitoring_dashboard:edit apim_analytics:monitoring_dashboard:view apim_analytics:manager_dashboard:own apim_analytics:manager_dashboard:edit apim_analytics:manager_dashboard:view apim_analytics:publisher_dashboard:own apim_analytics:publisher_dashboard:edit apim_analytics:publisher_dashboard:view apim_analytics:subscriber_dashboard:own apim_analytics:subscriber_dashboard:edit apim_analytics:subscriber_dashboard:view
allScopes: apim_analytics:admin openid apim:api_view apim:subscribe apim_analytics:monitoring_dashboard:own apim_analytics:monitoring_dashboard:edit apim_analytics:monitoring_dashboard:view apim_analytics:business_analytics:own apim_analytics:business_analytics:edit apim_analytics:business_analytics:view apim_analytics:api_analytics:own apim_analytics:api_analytics:edit apim_analytics:api_analytics:view apim_analytics:application_analytics:own apim_analytics:application_analytics:edit apim_analytics:application_analytics:view
adminUsername: admin
adminPassword: admin
kmDcrUrl: https://{{ template "am-pattern-1.resource.prefix" . }}-am-service:9443/client-registration/v0.17/register
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,20 @@ spec:
{{ if .Values.wso2.deployment.dependencies.mysql }}
initContainers:
- name: init-mysql-db
image: busybox:1.31
image: busybox:1.32
command: ['sh', '-c', 'echo -e "Checking for the availability of MySQL Server deployment"; while ! nc -z "wso2am-mysql-db-service" 3306; do sleep 1; printf "-"; done; echo -e " >> MySQL Server has started";']
- name: init-mysql-connector-download
image: busybox:1.32
command:
- /bin/sh
- "-c"
- |
set -e
connector_version=8.0.17
wget https://repo1.maven.org/maven2/mysql/mysql-connector-java/${connector_version}/mysql-connector-java-${connector_version}.jar -P /mysql-connector-jar/
volumeMounts:
- name: mysql-connector-jar
mountPath: /mysql-connector-jar
{{ end }}
containers:
- name: wso2am-analytics-dashboard
Expand Down Expand Up @@ -98,6 +110,10 @@ spec:
- name: {{ template "am-pattern-1.resource.prefix" . }}-am-analytics-dashboard-conf
mountPath: /home/wso2carbon/wso2-config-volume/conf/dashboard/deployment.yaml
subPath: deployment.yaml
{{ if .Values.wso2.deployment.dependencies.mysql }}
- name: mysql-connector-jar
mountPath: /home/wso2carbon/wso2-artifact-volume/lib
{{ end }}
serviceAccountName: {{ .Values.kubernetes.serviceAccount }}
{{- if and (not (eq .Values.wso2.subscription.username "")) (not (eq .Values.wso2.subscription.password "")) }}
imagePullSecrets:
Expand All @@ -114,4 +130,7 @@ spec:
- name: {{ template "am-pattern-1.resource.prefix" . }}-am-analytics-dashboard-conf
configMap:
name: {{ template "am-pattern-1.resource.prefix" . }}-am-analytics-dashboard-conf

{{ if .Values.wso2.deployment.dependencies.mysql }}
- name: mysql-connector-jar
emptyDir: {}
{{ end }}
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ data:
definition:
type: RDBMS
configuration:
jdbcUrl: 'jdbc:mysql://wso2am-mysql-db-service:3306/WSO2AM_PERMISSIONS_DB?useSSL=false&allowPublicKeyRetrieval=true'
jdbcUrl: 'jdbc:mysql://wso2am-mysql-db-service:3306/WSO2AM_PERMISSIONS_DB?useSSL=false'
username: wso2carbon
password: wso2carbon
driverClassName: com.mysql.cj.jdbc.Driver
Expand Down Expand Up @@ -411,7 +411,7 @@ data:
definition:
type: RDBMS
configuration:
jdbcUrl: 'jdbc:mysql://wso2am-mysql-db-service:3306/WSO2AM_STATS_DB?useSSL=false&allowPublicKeyRetrieval=true'
jdbcUrl: 'jdbc:mysql://wso2am-mysql-db-service:3306/WSO2AM_STATS_DB?useSSL=false'
username: wso2carbon
password: wso2carbon
driverClassName: com.mysql.cj.jdbc.Driver
Expand All @@ -433,7 +433,7 @@ data:
driverClassName: com.mysql.cj.jdbc.Driver
idleTimeout: 60000
isAutoCommit: false
jdbcUrl: "jdbc:mysql://wso2am-mysql-db-service:3306/WSO2_CLUSTER_DB?useSSL=false&allowPublicKeyRetrieval=true"
jdbcUrl: "jdbc:mysql://wso2am-mysql-db-service:3306/WSO2_CLUSTER_DB?useSSL=false"
maxPoolSize: 50
password: wso2carbon
username: wso2carbon
Expand All @@ -451,7 +451,7 @@ data:
driverClassName: com.mysql.cj.jdbc.Driver
idleTimeout: 60000
isAutoCommit: false
jdbcUrl: "jdbc:mysql://wso2am-mysql-db-service:3306/WSO2_PERSISTENCE_DB?useSSL=false&allowPublicKeyRetrieval=true"
jdbcUrl: "jdbc:mysql://wso2am-mysql-db-service:3306/WSO2_PERSISTENCE_DB?useSSL=false"
maxPoolSize: 50
password: wso2carbon
username: wso2carbon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ metadata:
namespace: {{ .Release.Namespace }}
spec:
replicas: 2
updateStrategy:
type: RollingUpdate
selector:
matchLabels:
deployment: {{ template "am-pattern-1.resource.prefix" . }}-am-analytics-worker
Expand Down Expand Up @@ -119,8 +117,10 @@ spec:
- name: {{ template "am-pattern-1.resource.prefix" . }}-am-analytics-worker-conf
mountPath: /home/wso2carbon/wso2-config-volume/conf/worker/deployment.yaml
subPath: deployment.yaml
{{ if .Values.wso2.deployment.dependencies.mysql }}
- name: mysql-connector-jar
mountPath: /home/wso2carbon/wso2-artifact-volume/lib
{{ end }}
serviceAccountName: {{ .Values.kubernetes.serviceAccount }}
{{- if .Values.wso2.deployment.am.imagePullSecrets }}
imagePullSecrets:
Expand All @@ -133,5 +133,7 @@ spec:
- name: {{ template "am-pattern-1.resource.prefix" . }}-am-analytics-worker-conf
configMap:
name: {{ template "am-pattern-1.resource.prefix" . }}-am-analytics-worker-conf
{{ if .Values.wso2.deployment.dependencies.mysql }}
- name: mysql-connector-jar
emptyDir: {}
{{ end }}
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,23 @@ spec:
initContainers:
{{ if .Values.wso2.deployment.dependencies.mysql }}
- name: init-mysql-db
image: busybox:1.31
image: busybox:1.32
command: ['sh', '-c', 'echo -e "Checking for the availability of MySQL Server deployment"; while ! nc -z "wso2am-mysql-db-service" 3306; do sleep 1; printf "-"; done; echo -e " >> MySQL Server has started";']
- name: init-mysql-connector-download
image: busybox:1.32
command:
- /bin/sh
- "-c"
- |
set -e
connector_version=8.0.17
wget https://repo1.maven.org/maven2/mysql/mysql-connector-java/${connector_version}/mysql-connector-java-${connector_version}.jar -P /mysql-connector-jar/
volumeMounts:
- name: mysql-connector-jar
mountPath: /mysql-connector-jar
{{ end }}
- name: init-am-analytics-worker
image: busybox:1.31
image: busybox:1.32
command: ['sh', '-c', 'echo -e "Checking for the availability of WSO2 API Manager Analytics Worker deployment"; while ! nc -z {{ template "am-pattern-1.resource.prefix" . }}-am-analytics-worker-service 7712; do sleep 1; printf "-"; done; echo -e " >> WSO2 API Manager Analytics Worker has started";']
containers:
- name: wso2am
Expand Down Expand Up @@ -119,6 +131,10 @@ spec:
mountPath: /home/wso2carbon/docker-entrypoint.sh
subPath: docker-entrypoint.sh
{{ end }}
{{ if .Values.wso2.deployment.dependencies.mysql }}
- name: mysql-connector-jar
mountPath: /home/wso2carbon/wso2-artifact-volume/repository/components/dropins
{{ end }}
serviceAccountName: {{ .Values.kubernetes.serviceAccount }}
{{- if .Values.wso2.deployment.am.imagePullSecrets }}
imagePullSecrets:
Expand Down Expand Up @@ -149,3 +165,7 @@ spec:
name: {{ template "am-pattern-1.resource.prefix" . }}-am-conf-entrypoint
defaultMode: 0407
{{ end }}
{{ if .Values.wso2.deployment.dependencies.mysql }}
- name: mysql-connector-jar
emptyDir: {}
{{ end }}
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@ spec:
- name: jms-tcp
protocol: TCP
port: 5672
- name: servlet-https
protocol: TCP
port: 9443
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,27 @@ spec:
initContainers:
{{ if .Values.wso2.deployment.dependencies.mysql }}
- name: init-mysql-db
image: busybox:1.31
image: busybox:1.32
command: ['sh', '-c', 'echo -e "Checking for the availability of MySQL Server deployment"; while ! nc -z "wso2am-mysql-db-service" 3306; do sleep 1; printf "-"; done; echo -e " >> MySQL Server has started";']
- name: init-mysql-connector-download
image: busybox:1.32
command:
- /bin/sh
- "-c"
- |
set -e
connector_version=8.0.17
wget https://repo1.maven.org/maven2/mysql/mysql-connector-java/${connector_version}/mysql-connector-java-${connector_version}.jar -P /mysql-connector-jar/
volumeMounts:
- name: mysql-connector-jar
mountPath: /mysql-connector-jar
{{ end }}
- name: init-am-analytics-worker
image: busybox:1.31
image: busybox:1.32
command: ['sh', '-c', 'echo -e "Checking for the availability of WSO2 API Manager Analytics Worker deployment"; while ! nc -z {{ template "am-pattern-1.resource.prefix" . }}-am-analytics-worker-service 7712; do sleep 1; printf "-"; done; echo -e " >> WSO2 API Manager Analytics Worker has started";']
- name: init-am-instance-one
image: busybox:1.32
command: ['sh', '-c', 'echo -e "Checking for the availability of WSO2 API Manager instance one deployment"; while ! nc -z {{ template "am-pattern-1.resource.prefix" . }}-am-1-service 9443; do sleep 1; printf "-"; done; echo -e " >> WSO2 API Manager instance one has started";']
containers:
- name: wso2am
{{- if .Values.wso2.deployment.am.dockerRegistry }}
Expand Down Expand Up @@ -119,6 +134,10 @@ spec:
mountPath: /home/wso2carbon/docker-entrypoint.sh
subPath: docker-entrypoint.sh
{{ end }}
{{ if .Values.wso2.deployment.dependencies.mysql }}
- name: mysql-connector-jar
mountPath: /home/wso2carbon/wso2-artifact-volume/repository/components/dropins
{{ end }}
serviceAccountName: {{ .Values.kubernetes.serviceAccount }}
{{- if .Values.wso2.deployment.am.imagePullSecrets }}
imagePullSecrets:
Expand Down Expand Up @@ -149,3 +168,7 @@ spec:
name: {{ template "am-pattern-1.resource.prefix" . }}-am-conf-entrypoint
defaultMode: 0407
{{ end }}
{{ if .Values.wso2.deployment.dependencies.mysql }}
- name: mysql-connector-jar
emptyDir: {}
{{ end }}

0 comments on commit 8a1a06f

Please sign in to comment.