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(jdp): add env vars to enable/configure JDP (backport #804) #814

Merged
merged 7 commits into from
Feb 9, 2022
Merged
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
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ client assets will still be included into the built image.
### Integration tests and analysis tools
* `mvn verify`

### Skipping tests
### Skipping tests
* `-DskipUTs=true` to skip unit tests
* `-DskipITs=true` to skip integration tests
* `-DskipTests=true` to skip all tests
Expand Down Expand Up @@ -100,6 +100,9 @@ Cryostat can be configured via the following environment variables
* `CRYOSTAT_AUTH_MANAGER`: the authentication/authorization manager used for validating user accesses. See the `USER AUTHENTICATION / AUTHORIZATION` section for more details. Set to the fully-qualified class name of the auth manager implementation to use, ex. `io.cryostat.net.BasicAuthManager`.
* `CRYOSTAT_PLATFORM`: the platform client used for performing platform-specific actions, such as listing available target JVMs. If `CRYOSTAT_AUTH_MANAGER` is not specified then a default auth manager will also be selected corresponding to the platform, whether that platform is specified by the user or automatically detected. Set to the fully-qualified name of the platform detection strategy implementation to use, ex. `io.cryostat.platform.internal.KubeEnvPlatformStrategy`.
* `CRYOSTAT_CONFIG_PATH`: the filesystem path for the configuration directory (default `/opt/cryostat.d/conf.d`)
* `CRYOSTAT_ENABLE_JDP_BROADCAST`: enable the Cryostat JVM to broadcast itself via JDP (Java Discovery Protocol). Defaults to `true`.
* `CRYOSTAT_JDP_ADDRESS`: the JDP multicast address to send discovery packets. Defaults to `224.0.23.178`.
* `CRYOSTAT_JDP_PORT`: the JDP multicast port to send discovery packets. Defaults to `7095`.

#### Configuration for Automated Analysis Reports

Expand Down
2 changes: 2 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,8 @@
<argument>--env</argument>
<argument>CRYOSTAT_TARGET_CACHE_TTL=5</argument>
<argument>--env</argument>
<argument>CRYOSTAT_ENABLE_JDP_BROADCAST=true</argument>
<argument>--env</argument>
<argument>CRYOSTAT_DISABLE_JMX_AUTH=true</argument>
<argument>--env</argument>
<argument>CRYOSTAT_DISABLE_SSL=true</argument>
Expand Down
1 change: 1 addition & 0 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ podman run \
--mount type=bind,source="$(dirname $0)/truststore",destination=/truststore,relabel=shared,bind-propagation=shared \
--mount type=bind,source="$(dirname $0)/certs",destination=/certs,relabel=shared,bind-propagation=shared \
--mount type=bind,source="$(dirname $0)/clientlib",destination=/clientlib,relabel=shared,bind-propagation=shared \
-e CRYOSTAT_ENABLE_JDP_BROADCAST=true \
-e CRYOSTAT_PLATFORM=$CRYOSTAT_PLATFORM \
-e CRYOSTAT_DISABLE_SSL=$CRYOSTAT_DISABLE_SSL \
-e CRYOSTAT_DISABLE_JMX_AUTH=$CRYOSTAT_DISABLE_JMX_AUTH \
Expand Down
15 changes: 14 additions & 1 deletion src/main/extras/app/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,26 @@ fi

FLAGS=(
"-XX:+CrashOnOutOfMemoryError"
"-Dcom.sun.management.jmxremote.autodiscovery=true"
"-Dcom.sun.management.jmxremote.port=$CRYOSTAT_RJMX_PORT"
"-Dcom.sun.management.jmxremote.rmi.port=$CRYOSTAT_RMI_PORT"
"-Djavax.net.ssl.trustStore=$SSL_TRUSTSTORE"
"-Djavax.net.ssl.trustStorePassword=$SSL_TRUSTSTORE_PASS"
)

if [ -z "$CRYOSTAT_ENABLE_JDP_BROADCAST" ]; then
FLAGS+=("-Dcom.sun.management.jmxremote.autodiscovery=true")
else
FLAGS+=("-Dcom.sun.management.jmxremote.autodiscovery=$CRYOSTAT_ENABLE_JDP_BROADCAST")
fi

if [ -n "$CRYOSTAT_JDP_ADDRESS" ]; then
FLAGS+=("-Dcom.sun.management.jmxremote.jdp.address=$CRYOSTAT_JDP_ADDRESS")
fi

if [ -n "$CRYOSTAT_JDP_PORT" ]; then
FLAGS+=("-Dcom.sun.management.jmxremote.jdp.port=$CRYOSTAT_JDP_PORT")
fi

importTrustStores

if [ "$CRYOSTAT_DISABLE_JMX_AUTH" = "true" ]; then
Expand Down