Skip to content

Commit

Permalink
feat: activate jdbcconfig to use db for gs cfg
Browse files Browse the repository at this point in the history
  • Loading branch information
buehner committed Jan 19, 2024
1 parent 557d194 commit 42ce22e
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 3 deletions.
4 changes: 2 additions & 2 deletions charts/geoserver-cloud/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ Then:
```sql
CREATE DATABASE ogscloud;
CREATE ROLE username WITH LOGIN PASSWORD 'password';
ALTER DATABASE ogscloud OWNER TO username ;
ALTER DATABASE ogscloud OWNER TO username;
ALTER USER username WITH SUPERUSER;
```

Connect to the database: `\c ogscloud`
Expand All @@ -89,7 +90,6 @@ Add helm repos (only needed once):

In the directory of this chart:

* `helm repo index .` (once)
* Update chart dependencies with `helm dependency update`.
* Execute `helm upgrade --namespace=geoserver --create-namespace --install geoserver .`

Expand Down
13 changes: 13 additions & 0 deletions charts/geoserver-cloud/templates/secrets_db.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
data:
database: {{ printf "ogscloud" | b64enc }}
hostname: {{ printf "172.17.0.1" | b64enc }}
username: {{ printf "username" | b64enc }}
password: {{ printf "password" | b64enc }}
port: {{ printf "5432" | b64enc }}
schema: {{ printf "config" | b64enc }}

kind: Secret
type: Opaque
metadata:
name: 'gs-cloud-jdbc-db'
27 changes: 26 additions & 1 deletion charts/geoserver-cloud/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,37 @@ env: &env-override
name: 'geoserver-rabbitmq'
key: 'rabbitmq-password'
SPRING_PROFILES_ACTIVE:
value: standalone,datadir,kube
value: standalone,jdbcconfig
# value: standalone,datadir,kube
GEOWEBCACHE_CACHE_DIR:
value: '/mnt/cache'
JAVA_OPTS:
value: '$(JAVA_OPTS_DEFAULT) -Dspring.config.additional-location=optional:file:/custom/geodata/jndi.yml'
order: 1
JDBCCONFIG_DATABASE:
type: secret
name: 'gs-cloud-jdbc-db'
key: 'database'
JDBCCONFIG_HOST:
type: secret
name: 'gs-cloud-jdbc-db'
key: 'hostname'
JDBCCONFIG_USERNAME:
type: secret
name: 'gs-cloud-jdbc-db'
key: 'username'
JDBCCONFIG_PASSWORD:
type: secret
name: 'gs-cloud-jdbc-db'
key: 'password'
JDBCCONFIG_PORT:
type: secret
name: 'gs-cloud-jdbc-db'
key: 'port'
JDBCCONFIG_SCHEMA:
type: secret
name: 'gs-cloud-jdbc-db'
key: 'schema'

additional-stuff: &additional-stuff
volumes:
Expand Down

0 comments on commit 42ce22e

Please sign in to comment.