Skip to content

NMS-19541: remove confd from minion, drop legacy kafka, add static co…#8529

Open
mershad-manesh wants to merge 13 commits into
features/NMS-19406from
mem/NMS-19541-2.x
Open

NMS-19541: remove confd from minion, drop legacy kafka, add static co…#8529
mershad-manesh wants to merge 13 commits into
features/NMS-19406from
mem/NMS-19541-2.x

Conversation

@mershad-manesh
Copy link
Copy Markdown
Contributor

@mershad-manesh mershad-manesh commented May 20, 2026

All Contributors

External References

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/etc configs + featuresBoot.d templates 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.

Comment on lines 216 to 221
@@ -203,30 +221,143 @@ applyOpennmsPropertiesD() {
done
Comment on lines 154 to +164
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());
}
Comment thread opennms-container/minion/container-fs/entrypoint.sh
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  • updateConfig uses regex-based grep -E/sed with an unescaped key. Keys like bootstrap.servers include . 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 running grep/sed.
    opennms-container/minion/container-fs/entrypoint.sh:168
  • parseEnvironment iterates with for VAR in $(env) and then splits values using cut -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 (eg compgen -e) and reading values via indirect expansion, or use a NUL-delimited env -0 loop to preserve the full value.

Comment on lines 141 to 145
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);
}
Comment on lines 51 to 54
# Error codes
E_ILLEGAL_ARGS=126
E_INIT_CONFIG=127

Comment on lines 52 to 55
# Error codes
E_ILLEGAL_ARGS=126
E_INIT_CONFIG=127

Copy link
Copy Markdown
Contributor

@christianpape christianpape left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work. We're finally getting rid of confd.

Comment on lines +138 to +140
jms)
echo "[Features] IPC strategy set to JMS."
;;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
jms)
echo "[Features] IPC strategy set to JMS."
;;
jms)
echo "[Features] IPC strategy set to JMS."
;;

@github-actions github-actions Bot added the docs label May 26, 2026
Comment thread opennms-container/core/container-fs/entrypoint.sh Outdated
Comment on lines +26 to +40
# 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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we customize these, we can omit these and rename this to instance-id.properties.

Comment thread opennms-container/minion/container-fs/etc/org.opennms.netmgt.trapd.cfg Outdated
Comment thread opennms-container/minion/container-fs/etc/org.opennms.netmgt.syslog.cfg Outdated
@@ -0,0 +1 @@
bootstrap.servers=${env:KAFKA_IPC_BOOTSTRAP_SERVERS:-kafka:29092}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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].
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The anchors are still named like *-confd. Is this correct?

Comment thread docs/modules/reference/pages/configuration/minion-docker.adoc Outdated
Comment thread docs/modules/reference/nav.adoc Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 89 out of 89 changed files in this pull request and generated 3 comments.

Comment on lines +109 to 113
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
Comment thread opennms-container/minion/container-fs/entrypoint.sh
Comment thread docs/modules/reference/pages/configuration/minion-docker.adoc Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants