Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: code changes to make JDBC_URL ENv var #64

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ target/quarkus-app/*
.idea/*
.github/*
charts/*
.quarkus
.vscode/*
oracle-data
36 changes: 20 additions & 16 deletions charts/nr-oracle-service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,29 @@

The following table lists the configurable parameters and their default values.

| Parameter | Description | Default |
|-----------------------------------------|-------------|---------|
| `app.envs.DB_HOST` | | |
| `app.envs.DB_NAME` | | |
| `app.envs.DB_PASSWORD` | | |
| `app.envs.DB_PORT` | | |
| `app.envs.DB_SECRET` | | |
| `app.envs.DB_USER` | | |
| `app.envs.HTTP_PORT` | | 3000 |
| `app.envs.POOL_IDLE_TIMEOUT` | | 60000 |
| `app.envs.POOL_INITIAL_SIZE` | | 1 |
| `app.envs.POOL_LEAK_DETECTION_INTERVAL` | | 300000 |
| `app.envs.POOL_MAX_LIFETIME` | | 180000 |
| `app.envs.POOL_MAX_SIZE` | | 1 |
| `app.envs.POOL_MIN_SIZE` | | 1 |
| Parameter | Description | Default |
|-----------------------------------------|-------------------------------------------------|---------|
| `app.envs.DB_HOST` | | |
| `app.envs.DB_NAME` | | |
| `app.envs.DB_PASSWORD` | | |
| `app.envs.DB_PORT` | | |
| `app.envs.DB_SECRET` | | |
| `app.envs.DB_USER` | | |
| `app.envs.HTTP_PORT` | | 3000 |
| `app.envs.POOL_IDLE_TIMEOUT` | | 60000 |
| `app.envs.POOL_INITIAL_SIZE` | | 1 |
| `app.envs.POOL_LEAK_DETECTION_INTERVAL` | | 300000 |
| `app.envs.POOL_MAX_LIFETIME` | | 180000 |
| `app.envs.POOL_MAX_SIZE` | | 1 |
| `app.envs.POOL_MIN_SIZE` | | 1 |
| `app.envs.JDBC_URL` | Required if values.global.tcpsEnabled is false. | |

Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`.
Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example,
Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the
chart. For example,

```
$ helm install --name chart-name -f values.yaml .
```

> **Tip**: You can use the default [values.yaml](values.yaml)
6 changes: 6 additions & 0 deletions charts/nr-oracle-service/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ spec:
claimName: {{ include "component.name" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
{{- if .Values.global.tcpsEnabled }}
initContainers:
- name: {{ .Chart.Name }}-init
image: "image-registry.openshift-image-registry.svc:5000/{{.Release.Namespace}}/{{ include "component.name" . }}-init:{{ .Values.image.tag | default .Chart.AppVersion }}"
Expand All @@ -49,6 +50,7 @@ spec:
volumeMounts:
- name: {{ include "component.name" . }}
mountPath: /app/cert
{{- end }}
containers:
- name: {{ .Chart.Name }}
securityContext:
Expand Down Expand Up @@ -99,6 +101,10 @@ spec:
secretKeyRef:
key: apiKey
name: {{ include "component.name" . }}
{{- if not .Values.global.tcpsEnabled }}
- name: JDBC_URL
value: {{ required "A valid .Values.app.envs.JDBC_URL entry required!" .Values.app.envs.JDBC_URL | quote }}
{{- end }}
- name: DB_PORT
value: '1543'
- name: CERT_SECRET
Expand Down
3 changes: 3 additions & 0 deletions charts/nr-oracle-service/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,9 @@
"POOL_MIN_SIZE": {
"type": "string",
"default": "1"
},
"JDBC_URL": {
"type": "string"
}

},
Expand Down
4 changes: 3 additions & 1 deletion charts/nr-oracle-service/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
# Declare variables to be passed into your templates.

replicaCount: 1

global:
tcpsEnabled: true
image:
repository: ghcr.io/bcgov/nr-oracle-service/nr-oracle-service
repositoryInit: ghcr.io/bcgov/nr-oracle-service/nr-oracle-service-init
Expand Down Expand Up @@ -85,5 +86,6 @@ app:
POOL_MAX_SIZE: "1"
POOL_MIN_SIZE: "1"
ACCESS_LOG_ENABLED: "false"
JDBC_URL: ~
ports:
http: 3000
3 changes: 1 addition & 2 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
quarkus.datasource.db-kind=oracle
quarkus.datasource.username=${DB_USER}
quarkus.datasource.password=${DB_PASSWORD}
quarkus.datasource.jdbc.url=jdbc:oracle:thin:@tcps://${DB_HOST}:${DB_PORT}/${DB_NAME}?javax.net.ssl.trustStore=/app/cert/jssecacerts&javax.net.ssl.trustStorePassword=${CERT_SECRET}&javax.net.ssl.keyStore=/app/cert/jssecacerts&javax.net.ssl.keyStorePassword=${CERT_SECRET}&oracle.net.ssl_certificate_alias=${DB_HOST}&oracle.net.ssl_server_dn_match=false
quarkus.datasource.jdbc.url=${JDBC_URL: jdbc:oracle:thin:@tcps://${DB_HOST}:${DB_PORT}/${DB_NAME}?javax.net.ssl.trustStore=/app/cert/jssecacerts&javax.net.ssl.trustStorePassword=${CERT_SECRET}&javax.net.ssl.keyStore=/app/cert/jssecacerts&javax.net.ssl.keyStorePassword=${CERT_SECRET}&oracle.net.ssl_certificate_alias=${DB_HOST}&oracle.net.ssl_server_dn_match=false}
quarkus.datasource.jdbc.min-size=${POOL_MIN_SIZE:1}
quarkus.datasource.jdbc.max-size=${POOL_MAX_SIZE:1}
quarkus.datasource.jdbc.initial-size=${POOL_INITIAL_SIZE:1}
quarkus.datasource.jdbc.max-lifetime=${POOL_MAX_LIFETIME:180000}
quarkus.datasource.jdbc.idle-removal-interval=${POOL_IDLE_TIMEOUT:60000}
quarkus.datasource.jdbc.leak-detection-interval=${POOL_LEAK_DETECTION_INTERVAL:45000}
quarkus.http.port=${HTTP_PORT:3000}
%dev.quarkus.datasource.jdbc.url=jdbc:oracle:thin:@${DB_HOST}:1521/${DB_NAME}
api.key=${API_KEY}
quarkus.http.access-log.enabled=${ACCESS_LOG_ENABLED:false}
quarkus.native.additional-build-args=-march=compatibility
Expand Down
Loading