Skip to content

Commit

Permalink
Update config service to use the embedded /etc/geoserver config by de…
Browse files Browse the repository at this point in the history
…fault
  • Loading branch information
groldan committed Oct 21, 2024
1 parent c383efd commit a9021f6
Show file tree
Hide file tree
Showing 11 changed files with 80 additions and 148 deletions.
1 change: 0 additions & 1 deletion compose/.env
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ DISCOVERY_SERVER_DEFAULT_PROFILES=${LOGGING_PROFILE}
# For more information, see https://cloud.spring.io/spring-cloud-config/multi/multi__spring_cloud_config_server.html#_git_backend
CONFIG_SERVER_DEFAULT_PROFILES=${LOGGING_PROFILE},native,standalone


JAVA_OPTS_DEFAULT=-XX:MaxRAMPercentage=80 -XshowSettings:system -Dlogging.config=file:/etc/geoserver/logback-spring.xml

JAVA_OPTS_DISCOVERY=$JAVA_OPTS_DEFAULT
Expand Down
4 changes: 2 additions & 2 deletions compose/acceptance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ services:
resources:
limits:
cpus: "1.0"
memory: 512M
memory: 256M
config:
deploy:
resources:
limits:
cpus: "1.0"
memory: 512M
memory: 256M
wms:
deploy:
resources:
Expand Down
16 changes: 5 additions & 11 deletions compose/compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ services:
rabbitmq:
condition: service_healthy
required: true
ports:
- 9000:8080
- 9001:8081
deploy:
resources:
limits:
Expand All @@ -70,21 +67,18 @@ services:
environment:
JAVA_OPTS: "${JAVA_OPTS_CONFIG}"
SPRING_PROFILES_ACTIVE: "${CONFIG_SERVER_DEFAULT_PROFILES}"
# 'git' profile config
CONFIG_GIT_URI: https://github.com/geoserver/geoserver-cloud-config
CONFIG_GIT_BASEDIR: /tmp/git_config
# 'native' profile config
CONFIG_NATIVE_PATH: /tmp/config
restart: unless-stopped
volumes:
- config:/tmp/config
# override with the local copy to test config changes during development
- config:/etc/geoserver
ports:
# not needed in production, exposed for local development
- 8888:8080
deploy:
resources:
limits:
cpus: '2.0'
memory: 512M
memory: 256M

# Eureka service discovery. This is a Discovery First Bootstrap configuration.
# The discovery service is the only fixed entry point.
Expand All @@ -104,7 +98,7 @@ services:
resources:
limits:
cpus: '2.0'
memory: 512M
memory: 256M

# Application facade, provides a single entry point routing to all
# microservices (e.g. http://localhost:9090/geoserver/wms, http://localhost:9090/geoserver/wfs, etc)
Expand Down
6 changes: 0 additions & 6 deletions compose/standalone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,14 @@
services:
discovery:
restart: no
environment:
SPRING_PROFILES_ACTIVE: "standalone"
entrypoint: echo "discovery-service disabled."

config:
restart: no
environment:
SPRING_PROFILES_ACTIVE: "standalone"
entrypoint: echo "config-service disabled."

admin:
restart: no
environment:
SPRING_PROFILES_ACTIVE: "standalone"
entrypoint: echo "admin-service disabled for standalone mode, requires discovery-service."

gateway:
Expand Down
6 changes: 3 additions & 3 deletions docs/configuration/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ geotools:
nonProxyHosts: ${https.nonProxyHosts:${geotools.httpclient.proxy.http.nonProxyHosts}}
```

### Configure HTTP proxy with environment variables in docker-compose.yml
### Configure HTTP proxy with environment variables in compose.yml

As mentioned above, regular JVM proxy configuration works with Java System properties
but not with Operating System environment variables.

The above `geotools.httpclient.proxy` config properties though allow to do so
easily as in the following `docker-compose.yml` snippet:
easily as in the following `compose.yml` snippet:

```yaml
version: "3.8"
Expand Down Expand Up @@ -142,4 +142,4 @@ To use GeoServer ACL with GeoServer Cloud, you need to do the following steps:

## Use OAuth authentication

You can enable OAuth authentication by replacing the default `gateway` image by the geOrchestra gateway (for example `georchestra/gateway:23.1-RC1`).
You can enable OAuth authentication by replacing the default `gateway` image by the geOrchestra gateway (for example `georchestra/gateway:23.1-RC1`).
4 changes: 2 additions & 2 deletions docs/deploy/docker-compose/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ These instructions assume you have Docker Engine, Docker CLI, and the [Compose P
Here are three `docker compose` based deployment examples to try out:

* Our preferred option, the [pgconfig](stable/pgconfig/compose.yml) Catalog back-end, specifically developed for GeoServer Cloud with scalability in mind, storing all Catalog and GeoServer configuration in a PostgreSQL database.
* A shared [data-directory](stable/shared_datadir/docker-compose.yml) option, using a mounted volume to share a traditional GeoServer data directory across all services.
* And a **deprecated** [jdbcconfig](jdbcconfig/docker-compose.yml) option, using the GeoServer [jdbcconfig](https://docs.geoserver.org/main/en/user/community/jdbcconfig/index.html) and [jdbcstore](https://docs.geoserver.org/main/en/user/community/jdbcstore/index.html) community modules.
* A shared [data-directory](stable/datadir/compose.yml) option, using a mounted volume to share a traditional GeoServer data directory across all services.
* And a **deprecated** [jdbcconfig](jdbcconfig/compose.yml) option, using the GeoServer [jdbcconfig](https://docs.geoserver.org/main/en/user/community/jdbcconfig/index.html) and [jdbcstore](https://docs.geoserver.org/main/en/user/community/jdbcstore/index.html) community modules.

Open a terminal and enter the directory where you just downloaded that file, and run `docker compose pull` to fetch the docker images from [Dockerhub](https://hub.docker.com/u/geoservercloud/):

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ volumes:
#device: $PWD/datadir
rabbitmq_data: # volume for rabbitmq data, so it doesn't create an anonymous one on each container
geowebcache_data: # used by gwc and web-ui to locate the default gwc tile cache directory

networks:
gs-cloud-network:

services:
rabbitmq:
Expand All @@ -21,31 +18,23 @@ services:
restart: unless-stopped
volumes:
- rabbitmq_data:/var/lib/rabbitmq
networks:
- gs-cloud-network
deploy:
resources:
limits:
cpus: '2.0'
memory: 1G

# Eureka service discovery. This is a Discovery First Bootstrap configuration.
# The discovery service is the only fixed entry point.
# Browse to http://localhost:8761 to check all services are registered.
# Run docker compose -f docker-compose.yml -f docker-compose-discovery-ha.yml to run extra discovery service instances for HA
discovery:
image: geoservercloud/geoserver-cloud-discovery:1.8.12
user: 1000:1000 # set the userid:groupid the container runs as
ports:
- 8761:8761
networks:
- gs-cloud-network
restart: unless-stopped
deploy:
resources:
limits:
cpus: '2.0'
memory: 512M
memory: 256M

# Spring Cloud Config service, provides centralized configuration to all
# microservices. Being a Discovery First Bootstrap configuration, it'll
Expand All @@ -57,30 +46,20 @@ services:
- discovery
- rabbitmq
environment:
# Either 'git' or 'native'. Use the default sample git repository to download the services configuration from
# If 'git', BEWARE config server will look for a branch called "master", and github changed the default branch name to "main"
# For more information, see https://cloud.spring.io/spring-cloud-config/multi/multi__spring_cloud_config_server.html#_git_backend
SPRING_PROFILES_ACTIVE: git
# 'git' profile config
CONFIG_GIT_URI: https://github.com/geoserver/geoserver-cloud-config.git
# get the config for this release from the v1.8.12 tag
# default to `native` loading the config embedded in /etc/geoserver
# use `git` to fetch the config from a git reposiroty, and CONFIG_GIT_URI to change
# the default repository https://github.com/geoserver/geoserver-cloud-config.git
SPRING_PROFILES_ACTIVE: native
# If using the `git` profile, get the config from this tag
SPRING_CLOUD_CONFIG_SERVER_GIT_DEFAULT_LABEL: v1.8.12
# where to store the cloned repository, if unset, it'll use /tmp/config-repo-<randomid>
CONFIG_GIT_BASEDIR: /tmp/git_config
# 'native' profile config
CONFIG_NATIVE_PATH: /tmp/config
# avoid stack trace due to jgit not being able of creating a .config dir at $HOME
XDG_CONFIG_HOME: /tmp
networks:
- gs-cloud-network
# Uncoment to bind to a local filesystem directory if using the 'native' profile
#volumes:
# - ./config:/tmp/config
# - ./config:/etc/geoserver
deploy:
resources:
limits:
cpus: '2.0'
memory: 512M
memory: 256M

# Application facade, provides a single entry point routing to all
# microservices (e.g. http://localhost:9090/geoserver/cloud/wms, http://localhost:9090/geoserver/cloud/wfs, etc)
Expand All @@ -94,8 +73,6 @@ services:
GEOSERVER_BASE_PATH: /geoserver/cloud
ports:
- 9090:8080
networks:
- gs-cloud-network
deploy:
resources:
limits:
Expand All @@ -113,8 +90,6 @@ services:
GEOSERVER_DATA_DIR: /opt/app/data_directory
volumes:
- shared_data_directory:/opt/app/data_directory
networks:
- gs-cloud-network
deploy:
resources:
limits:
Expand All @@ -134,8 +109,6 @@ services:
volumes:
- shared_data_directory:/opt/app/data_directory
- geowebcache_data:/data/geowebcache
networks:
- gs-cloud-network
deploy:
resources:
limits:
Expand All @@ -153,8 +126,6 @@ services:
GEOSERVER_DATA_DIR: /opt/app/data_directory
volumes:
- shared_data_directory:/opt/app/data_directory
networks:
- gs-cloud-network
deploy:
resources:
limits:
Expand All @@ -172,8 +143,6 @@ services:
GEOSERVER_DATA_DIR: /opt/app/data_directory
volumes:
- shared_data_directory:/opt/app/data_directory
networks:
- gs-cloud-network
deploy:
mode: replicated
replicas: 1
Expand All @@ -195,8 +164,6 @@ services:
volumes:
- shared_data_directory:/opt/app/data_directory
- geowebcache_data:/data/geowebcache
networks:
- gs-cloud-network
deploy:
resources:
limits:
Expand All @@ -211,8 +178,6 @@ services:
SPRING_PROFILES_ACTIVE: "datadir"
GEOSERVER_DATA_DIR: /opt/app/data_directory
GEOWEBCACHE_CACHE_DIR: /data/geowebcache
networks:
- gs-cloud-network
volumes:
- shared_data_directory:/opt/app/data_directory
- geowebcache_data:/data/geowebcache
Expand Down
Loading

0 comments on commit a9021f6

Please sign in to comment.