NMS-19541: remove confd from minion, drop legacy kafka, add static co…#8529
NMS-19541: remove confd from minion, drop legacy kafka, add static co…#8529mershad-manesh wants to merge 13 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the Minion container and smoke-test stack to stop using confd-based runtime templating, instead relying on static /opt/minion/etc overlays plus environment-variable interpolation and a small entrypoint-managed feature-boot composition. It also removes legacy Kafka/confd artifacts and adjusts CI smoke execution to work with newer Docker engines.
Changes:
- Remove confd templates/scripts/config from the Minion image and replace with static
container-fs/etcconfigs +featuresBoot.dtemplates rendered by the entrypoint. - Update smoke tests to configure Minion via environment variables (IPC strategy, broker URL, Jaeger, Dominion SCV, etc.).
- Bump Testcontainers and pin Docker API version in CircleCI smoke script for compatibility.
Reviewed changes
Copilot reviewed 81 out of 81 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| smoke-test/src/main/java/org/opennms/smoketest/containers/MinionContainer.java | Switch smoke-test Minion configuration from file-based confd YAML to env-var driven config/feature selection. |
| smoke-test/pom.xml | Bump Testcontainers version. |
| opennms-container/minion/Dockerfile | Remove confd layer; add static etc overlay and install gettext for envsubst. |
| opennms-container/minion/container-fs/etc/org.ops4j.pax.web.cfg | Add env-interpolated Pax Web/Jetty bind/port config. |
| opennms-container/minion/container-fs/etc/org.opennms.netmgt.trapd.cfg | Add env-interpolated trapd bind/port config. |
| opennms-container/minion/container-fs/etc/org.opennms.netmgt.syslog.cfg | Add env-interpolated syslog bind/port config. |
| opennms-container/minion/container-fs/etc/org.opennms.minion.controller.cfg | Add env-interpolated minion location/id/broker URL config. |
| opennms-container/minion/container-fs/etc/org.opennms.features.telemetry.listeners-udp-50002-nxos.cfg | Add static telemetry listener config (NXOS). |
| opennms-container/minion/container-fs/etc/org.opennms.features.telemetry.listeners-udp-50001-jti.cfg | Add static telemetry listener config (JTI). |
| opennms-container/minion/container-fs/etc/org.opennms.features.telemetry.listeners-single-port-flows.cfg | Add static single-port flows listener config. |
| opennms-container/minion/container-fs/etc/org.opennms.features.minion.dominion.grpc.cfg | Add env-interpolated Dominion gRPC config. |
| opennms-container/minion/container-fs/etc/org.opennms.core.ipc.kafka.cfg | Add env-interpolated Kafka IPC bootstrap config. |
| opennms-container/minion/container-fs/etc/org.opennms.core.ipc.grpc.client.cfg | Add env-interpolated gRPC IPC client config. |
| opennms-container/minion/container-fs/etc/org.apache.karaf.shell.cfg | Add env-interpolated Karaf SSH bind/port config. |
| opennms-container/minion/container-fs/etc/org.apache.karaf.management.cfg | Replace confd template with env-interpolated JMX/RMI management config. |
| opennms-container/minion/container-fs/etc/featuresBoot.d/templates/kafka-ipc.boot | Add feature-boot template for Kafka IPC. |
| opennms-container/minion/container-fs/etc/featuresBoot.d/templates/jaeger.boot | Add feature-boot template for Jaeger tracing. |
| opennms-container/minion/container-fs/etc/featuresBoot.d/templates/grpc.boot | Add feature-boot template for gRPC IPC. |
| opennms-container/minion/container-fs/etc/featuresBoot.d/templates/dominion-scv.boot | Add feature-boot template for Dominion SCV. |
| opennms-container/minion/container-fs/etc/featuresBoot.d/templates/disable-jms.boot | Add feature-boot template to disable JMS features when using Kafka/gRPC. |
| opennms-container/minion/container-fs/etc/custom.system.properties | Add static system properties (incl. env-based instance id). |
| opennms-container/minion/container-fs/entrypoint.sh | Remove confd execution path; add feature-boot rendering/validation and startup diagnostics. |
| opennms-container/minion/container-fs/confd/templates/prom-jmx-exporter.yaml.tmpl | Remove confd template (no longer used). |
| opennms-container/minion/container-fs/confd/templates/org.ops4j.pax.web.cfg.tmpl | Remove confd template (no longer used). |
| opennms-container/minion/container-fs/confd/templates/org.opennms.netmgt.trapd.cfg.tmpl | Remove confd template (no longer used). |
| opennms-container/minion/container-fs/confd/templates/org.opennms.netmgt.syslog.cfg.tmpl | Remove confd template (no longer used). |
| opennms-container/minion/container-fs/confd/templates/org.opennms.minion.server-certificates.tmpl | Remove confd template (no longer used). |
| opennms-container/minion/container-fs/confd/templates/org.opennms.minion.process-env.tmpl | Remove confd template (no longer used). |
| opennms-container/minion/container-fs/confd/templates/org.opennms.minion.controller.cfg.tmpl | Remove confd template (no longer used). |
| opennms-container/minion/container-fs/confd/templates/org.opennms.features.minion.dominion.grpc.cfg.tmpl | Remove confd template (no longer used). |
| opennms-container/minion/container-fs/confd/templates/org.opennms.core.ipc.twin.kafka.cfg.tmpl | Remove confd template (no longer used). |
| opennms-container/minion/container-fs/confd/templates/org.opennms.core.ipc.sink.offheap.cfg.tmpl | Remove confd template (no longer used). |
| opennms-container/minion/container-fs/confd/templates/org.opennms.core.ipc.sink.kafka.cfg.tmpl | Remove confd template (no longer used). |
| opennms-container/minion/container-fs/confd/templates/org.opennms.core.ipc.rpc.kafka.cfg.tmpl | Remove confd template (no longer used). |
| opennms-container/minion/container-fs/confd/templates/org.opennms.core.ipc.kafka.cfg.tmpl | Remove confd template (no longer used). |
| opennms-container/minion/container-fs/confd/templates/org.opennms.core.ipc.grpc.client.cfg.tmpl | Remove confd template (no longer used). |
| opennms-container/minion/container-fs/confd/templates/org.apache.karaf.shell.cfg.tmpl | Remove confd template (no longer used). |
| opennms-container/minion/container-fs/confd/templates/kafka-twin.boot.tmpl | Remove confd template (no longer used). |
| opennms-container/minion/container-fs/confd/templates/kafka-sink.boot.tmpl | Remove confd template (no longer used). |
| opennms-container/minion/container-fs/confd/templates/kafka-rpc.boot.tmpl | Remove confd template (no longer used). |
| opennms-container/minion/container-fs/confd/templates/kafka-ipc.boot.tmpl | Remove confd template (no longer used). |
| opennms-container/minion/container-fs/confd/templates/jaeger.boot.tmpl | Remove confd template (no longer used). |
| opennms-container/minion/container-fs/confd/templates/instance-id.properties.tmpl | Remove confd template (no longer used). |
| opennms-container/minion/container-fs/confd/templates/grpc.boot.tmpl | Remove confd template (no longer used). |
| opennms-container/minion/container-fs/confd/templates/dominion-scv.boot.tmpl | Remove confd template (no longer used). |
| opennms-container/minion/container-fs/confd/templates/disable-jms.boot.tmpl | Remove confd template (no longer used). |
| opennms-container/minion/container-fs/confd/templates/custom.system.properties.tmpl | Remove confd template (no longer used). |
| opennms-container/minion/container-fs/confd/templates/confd-telemetry-feature.xml.tmpl | Remove confd template (no longer used). |
| opennms-container/minion/container-fs/confd/scripts/remove-if-empty | Remove confd helper script (no longer used). |
| opennms-container/minion/container-fs/confd/scripts/confd_lib.sh | Remove confd helper library (no longer used). |
| opennms-container/minion/container-fs/confd/directories | Remove confd directory list (no longer used). |
| opennms-container/minion/container-fs/confd/confd.toml | Remove confd config (no longer used). |
| opennms-container/minion/container-fs/confd/conf.d/prom-jmx-exporter.toml | Remove confd template mapping (no longer used). |
| opennms-container/minion/container-fs/confd/conf.d/org.ops4j.pax.web.cfg.toml | Remove confd template mapping (no longer used). |
| opennms-container/minion/container-fs/confd/conf.d/org.opennms.netmgt.trapd.cfg.toml | Remove confd template mapping (no longer used). |
| opennms-container/minion/container-fs/confd/conf.d/org.opennms.netmgt.syslog.cfg.toml | Remove confd template mapping (no longer used). |
| opennms-container/minion/container-fs/confd/conf.d/org.opennms.minion.server-certificates.toml | Remove confd template mapping (no longer used). |
| opennms-container/minion/container-fs/confd/conf.d/org.opennms.minion.process-env.toml | Remove confd template mapping (no longer used). |
| opennms-container/minion/container-fs/confd/conf.d/org.opennms.minion.controller.cfg.toml | Remove confd template mapping (no longer used). |
| opennms-container/minion/container-fs/confd/conf.d/org.opennms.features.minion.dominion.grpc.cfg.toml | Remove confd template mapping (no longer used). |
| opennms-container/minion/container-fs/confd/conf.d/org.opennms.core.ipc.twin.kafka.cfg.toml | Remove confd template mapping (no longer used). |
| opennms-container/minion/container-fs/confd/conf.d/org.opennms.core.ipc.sink.offheap.cfg.toml | Remove confd template mapping (no longer used). |
| opennms-container/minion/container-fs/confd/conf.d/org.opennms.core.ipc.sink.kafka.cfg.toml | Remove confd template mapping (no longer used). |
| opennms-container/minion/container-fs/confd/conf.d/org.opennms.core.ipc.rpc.kafka.cfg.toml | Remove confd template mapping (no longer used). |
| opennms-container/minion/container-fs/confd/conf.d/org.opennms.core.ipc.kafka.cfg.toml | Remove confd template mapping (no longer used). |
| opennms-container/minion/container-fs/confd/conf.d/org.opennms.core.ipc.grpc.client.cfg.toml | Remove confd template mapping (no longer used). |
| opennms-container/minion/container-fs/confd/conf.d/org.apache.karaf.shell.cfg.toml | Remove confd template mapping (no longer used). |
| opennms-container/minion/container-fs/confd/conf.d/org.apache.karaf.management.cfg.toml | Remove confd template mapping (no longer used). |
| opennms-container/minion/container-fs/confd/conf.d/kafka-twin.boot.toml | Remove confd template mapping (no longer used). |
| opennms-container/minion/container-fs/confd/conf.d/kafka-sink.boot.toml | Remove confd template mapping (no longer used). |
| opennms-container/minion/container-fs/confd/conf.d/kafka-rpc.boot.toml | Remove confd template mapping (no longer used). |
| opennms-container/minion/container-fs/confd/conf.d/kafka-ipc.boot.toml | Remove confd template mapping (no longer used). |
| opennms-container/minion/container-fs/confd/conf.d/jaeger.boot.toml | Remove confd template mapping (no longer used). |
| opennms-container/minion/container-fs/confd/conf.d/instance-id.properties.toml | Remove confd template mapping (no longer used). |
| opennms-container/minion/container-fs/confd/conf.d/grpc.boot.toml | Remove confd template mapping (no longer used). |
| opennms-container/minion/container-fs/confd/conf.d/dominion-scv.boot.toml | Remove confd template mapping (no longer used). |
| opennms-container/minion/container-fs/confd/conf.d/disable-jms.boot.toml | Remove confd template mapping (no longer used). |
| opennms-container/minion/container-fs/confd/conf.d/custom.system.properties.toml | Remove confd template mapping (no longer used). |
| opennms-container/minion/container-fs/confd/conf.d/confd-telemetry-feature.xml.toml | Remove confd template mapping (no longer used). |
| .circleci/scripts/smoke.sh | Pin Docker API version for docker-java/Testcontainers compatibility on newer engines. |
| .circleci/epoch | Force a full build in CI. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -203,30 +221,143 @@ applyOpennmsPropertiesD() { | |||
| done | |||
| if (IpcStrategy.KAFKA.equals(model.getIpcStrategy())) { | ||
| String kafkaIpc = "{\n" + | ||
| "\t\"ipc\": {\n" + | ||
| "\t\t\"kafka\": {\n" + | ||
| "\t\t\t\"bootstrap.servers\": \""+ OpenNMSContainer.KAFKA_ALIAS +":9092\",\n" + | ||
| "\t\t\t\"compression.type\": \""+ model.getKafkaCompressionStrategy().getCodec() +"\"\n" + | ||
| "\t\t}\n" + | ||
| "\t}\n" + | ||
| "}"; | ||
| OverlayUtils.writeYaml(minionConfigYaml, jsonMapper.readValue(kafkaIpc, Map.class)); | ||
| withEnv("MINION_IPC", "kafka"); | ||
| withEnv("KAFKA_IPC_BOOTSTRAP_SERVERS", OpenNMSContainer.KAFKA_ALIAS + ":9092"); | ||
| withEnv("KAFKA_RPC_BOOTSTRAP_SERVERS", OpenNMSContainer.KAFKA_ALIAS + ":9092"); | ||
| withEnv("KAFKA_SINK_BOOTSTRAP_SERVERS", OpenNMSContainer.KAFKA_ALIAS + ":9092"); | ||
| withEnv("KAFKA_TWIN_BOOTSTRAP_SERVERS", OpenNMSContainer.KAFKA_ALIAS + ":9092"); | ||
| if (model.getKafkaCompressionStrategy() != null) { | ||
| withEnv("KAFKA_IPC_COMPRESSION_TYPE", model.getKafkaCompressionStrategy().getCodec()); | ||
| withEnv("KAFKA_SINK_COMPRESSION_TYPE", model.getKafkaCompressionStrategy().getCodec()); | ||
| withEnv("KAFKA_TWIN_COMPRESSION_TYPE", model.getKafkaCompressionStrategy().getCodec()); | ||
| } |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 82 out of 82 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (2)
opennms-container/minion/container-fs/entrypoint.sh:112
updateConfiguses regex-basedgrep -E/sedwith an unescaped key. Keys likebootstrap.serversinclude.which is a regex wildcard, so the script can match/replace the wrong property lines. Escape regex metacharacters (or switch to fixed-string matching) before runninggrep/sed.
opennms-container/minion/container-fs/entrypoint.sh:168parseEnvironmentiterates withfor VAR in $(env)and then splits values usingcut -d= -f2. This breaks for env values containing spaces (common) and/or additional=(eg Kafka SASL/Jaas configs), causing incorrect config updates. Consider iterating over variable names (egcompgen -e) and reading values via indirect expansion, or use a NUL-delimitedenv -0loop to preserve the full value.
| if (profile.isLegacy()) { | ||
| for (final Map.Entry<String, String> entry : profile.getLegacyConfiguration().entrySet()) { | ||
| addEnv(entry.getKey(), entry.getValue()); | ||
| } | ||
| } else { | ||
| addFileSystemBind(writeMinionConfig(profile).toString(), | ||
| "/opt/minion/minion-config.yaml", BindMode.READ_ONLY, SelinuxContext.SINGLE); | ||
| } |
| # Error codes | ||
| E_ILLEGAL_ARGS=126 | ||
| E_INIT_CONFIG=127 | ||
|
|
| # Error codes | ||
| E_ILLEGAL_ARGS=126 | ||
| E_INIT_CONFIG=127 | ||
|
|
christianpape
left a comment
There was a problem hiding this comment.
Awesome work. We're finally getting rid of confd.
| jms) | ||
| echo "[Features] IPC strategy set to JMS." | ||
| ;; |
There was a problem hiding this comment.
| jms) | |
| echo "[Features] IPC strategy set to JMS." | |
| ;; | |
| jms) | |
| echo "[Features] IPC strategy set to JMS." | |
| ;; |
| # All the values specified here will override the default values given | ||
| # in config.properties. | ||
| # | ||
|
|
||
| karaf.systemBundlesStartLevel=50 | ||
|
|
||
| # | ||
| # You can place any customized configuration here. | ||
| # | ||
| org.osgi.framework.system.packages.extra=sun.nio.ch, \ | ||
| sun.misc, \ | ||
| sun.net.dns, \ | ||
| sun.reflect, \ | ||
| sun.security.ssl, \ | ||
| sun.security.x509 |
There was a problem hiding this comment.
I don't think we customize these, we can omit these and rename this to instance-id.properties.
| @@ -0,0 +1 @@ | |||
| bootstrap.servers=${env:KAFKA_IPC_BOOTSTRAP_SERVERS:-kafka:29092} | |||
There was a problem hiding this comment.
One thing we need to add in the docs, if the user wishes to overwrite, they need overwrite the whole file, not just the extra ones as there is no merging mechanism here.
This reverts commit cc15e91.
| IMPORTANT: If you need a more sophisticated configuration with JMX rules, you need to inject your own `config.yaml` file. | ||
|
|
||
| For configuring container deployments with Confd refer to xref:reference:configuration/core-docker.adoc#core-oci-confd[Core Confd], xref:reference:configuration/minion-confd/minion-confd.adoc#minion-confd[Minion Confd], and xref:reference:configuration/sentinel-features.adoc#sentinel-oci-confd[Sentinel Confd]. | ||
| For configuring container deployments, refer to xref:reference:configuration/core-docker.adoc#core-oci-confd[Core], xref:reference:configuration/minion-docker.adoc#minion-docker[Minion], and xref:reference:configuration/sentinel-features.adoc#sentinel-oci-confd[Sentinel]. |
There was a problem hiding this comment.
The anchors are still named like *-confd. Is this correct?
| if grep -E -q "^#?\s*$key\s*=" "$file"; then | ||
| sed -r -i "s@^#?\s*$key\s*=.*@$key=$value@g" "$file" #note that no config values may contain an '@' char | ||
| else | ||
| echo "$key=$value" >> "$file" | ||
| fi |
All Contributors
External References