diff --git a/run.sh b/run.sh index 3be7042bed..85eb226d9a 100755 --- a/run.sh +++ b/run.sh @@ -116,6 +116,9 @@ fi # run as root (uid 0) within the container - with rootless podman this means # that the process will actually run with your own uid on the host machine, # rather than the uid being remapped to something else +# +# limits set to match operator defaults: +# https://github.com/cryostatio/cryostat-operator/blob/2d386930dc96f0dcaf937987ec35874006c53b61/internal/controllers/common/resource_definitions/resource_definitions.go#L66 podman run \ --pod cryostat-pod \ --name cryostat \ @@ -125,7 +128,8 @@ podman run \ --label io.cryostat.jmxHost="localhost" \ --label io.cryostat.jmxPort="0" \ --label io.cryostat.jmxUrl="service:jmx:rmi:///jndi/rmi://localhost:0/jmxrmi" \ - --memory 768M \ + --cpus 0.1 \ + --memory 384M \ --mount type=bind,source="$(dirname "$0")/archive",destination=/opt/cryostat.d/recordings.d,relabel=shared \ --mount type=bind,source="$(dirname "$0")/certs",destination=/certs,relabel=shared \ --mount type=bind,source="$(dirname "$0")/clientlib",destination=/clientlib,relabel=shared \ diff --git a/smoketest.sh b/smoketest.sh index 51e6275c7e..b765bd7887 100755 --- a/smoketest.sh +++ b/smoketest.sh @@ -253,10 +253,15 @@ runJfrDatasource() { tag="$(getPomProperty cryostat.itest.jfr-datasource.version)" DATASOURCE_IMAGE="${stream}:${tag}" fi + # limits set to match operator defaults: + # https://github.com/cryostatio/cryostat-operator/blob/2d386930dc96f0dcaf937987ec35874006c53b61/internal/controllers/common/resource_definitions/resource_definitions.go#L66 + local RJMX_PORT=11223 podman run \ --name jfr-datasource \ --pull "${PULL_IMAGES}" \ --pod cryostat-pod \ + --cpus 0.1 \ + --memory 512m \ --rm -d "${DATASOURCE_IMAGE}" } @@ -267,6 +272,8 @@ runGrafana() { tag="$(getPomProperty cryostat.itest.grafana.version)" GRAFANA_IMAGE="${stream}:${tag}" fi + # limits set to match operator defaults: + # https://github.com/cryostatio/cryostat-operator/blob/2d386930dc96f0dcaf937987ec35874006c53b61/internal/controllers/common/resource_definitions/resource_definitions.go#L66 local host; local port; host="$(getPomProperty cryostat.itest.webHost)" port="$(getPomProperty cryostat.itest.jfr-datasource.port)" @@ -274,6 +281,8 @@ runGrafana() { --name grafana \ --pull "${PULL_IMAGES}" \ --pod cryostat-pod \ + --cpus 0.1 \ + --memory 256M \ --env GF_INSTALL_PLUGINS=grafana-simple-json-datasource \ --env GF_AUTH_ANONYMOUS_ENABLED=true \ --env JFR_DATASOURCE_URL="http://${host}:${port}" \ @@ -287,6 +296,8 @@ runReportGenerator() { tag="$(getPomProperty cryostat.itest.reports.version)" REPORTS_IMAGE="${stream}:${tag}" fi + # limits set to match operator defaults: + # https://github.com/cryostatio/cryostat-operator/blob/2d386930dc96f0dcaf937987ec35874006c53b61/internal/controllers/common/resource_definitions/resource_definitions.go#L66 local RJMX_PORT=10000 local port; port="$(getPomProperty cryostat.itest.reports.port)" @@ -297,10 +308,10 @@ runReportGenerator() { --label io.cryostat.discovery="true" \ --label io.cryostat.jmxHost="localhost" \ --label io.cryostat.jmxPort="${RJMX_PORT}" \ - --cpus 1 \ - --memory 512M \ + --cpus 0.128 \ + --memory 256M \ --restart on-failure \ - --env JAVA_OPTS="-XX:ActiveProcessorCount=1 -Dcom.sun.management.jmxremote.autodiscovery=true -Dcom.sun.management.jmxremote.port=${RJMX_PORT} -Dcom.sun.management.jmxremote.rmi.port=${RJMX_PORT} -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false" \ + --env JAVA_OPTS="-Dcom.sun.management.jmxremote.autodiscovery=true -Dcom.sun.management.jmxremote.port=${RJMX_PORT} -Dcom.sun.management.jmxremote.rmi.port=${RJMX_PORT} -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false" \ --env QUARKUS_HTTP_PORT="${port}" \ --rm -d "${REPORTS_IMAGE}" }