Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Problem adapting CLI script to YAML configuration

29 views
Skip to first unread message

Ivan L

unread,
May 14, 2025, 10:15:04 AMMay 14
to WildFly
Hello everyone.

I am having a problem adapting this piece of my CLI script to YAML configuration:

/subsystem=jgroups/stack=tcp/protocol=kubernetes.KUBE_PING/:add(add-index=0,properties={"namespace" => expression "${env.KUBERNETES_NAMESPACE}","labels" => expression "app=myapp,environment=${env.ENVIRONMENT}"})
/subsystem=jgroups/stack=tcp/protocol=MPING:remove()

It seems that "protocol" is not a regular list in Wildfly terms and !list-add cannot be used to add a protocol. Is it a limitation of YAML configuration or can it still be done?

Thanks for your attention.

Emmanuel Hugonnet

unread,
May 15, 2025, 6:57:49 AMMay 15
to Ivan L, WildFly
Hello,
Someone form the clustering team may want to validate that but this is my thinking:
protocol is a resource not an attribute thus there is no notion of list.
So to define your stack I'm afraid you would have to remove the stack and recreate it (as the order has a meaning iirc).

Some yaml like this works:
subsystem:
jgroups:
stack:
tcpping:
transport:
TCP:
socket-binding: jgroups-tcp
protocol:
TCPPING:
socket-bindings:
- jgroups-site2-eap1
- jgroups-site1-eap1
- jgroups-site2-eap2
- jgroups-site1-eap2
properties:
initial_hosts: "10.0.4.20[7600],10.0.3.23[7600],10.0.4.30[7600],10.0.3.27[7600]"
port_range: 0
MERGE3:
FD_SOCK:
FD_ALL:
VERIFY_SUSPECT:
pbcast.NAKACK2:
UNICAST3:
pbcast.STABLE:
pbcast.GMS:
MFC:
FRAG3:

You can't add the index.
Maybe
wildfly-configuration:
subsystem:
jgroups:
stack:
tcpping:
protocol:
MPING: !remove
kubernetes.KUBE_PING:
add-index: 0
properties:
namespace: "expression '${env.KUBERNETES_NAMESPACE}'"
labels: "expression 'app=myapp,environment=${env.ENVIRONMENT}'"

can work but I'm not sure in if add-index is an attribute of just a parameter so you might get your KUBE_PING at the end of the stack

Emmanuel
> --
> You received this message because you are subscribed to the Google Groups "WildFly" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to wildfly+u...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/wildfly/baae7e42-931d-4264-b7a4-c2af38a470ddn%40googlegroups.com
> <https://groups.google.com/d/msgid/wildfly/baae7e42-931d-4264-b7a4-c2af38a470ddn%40googlegroups.com?utm_medium=email&utm_source=footer>.

Ivan L

unread,
May 15, 2025, 7:31:51 AMMay 15
to WildFly
Hello, Emmanuel,

your suggestion worked. I put add-index:0 at the same level as the "properties" (indentation is unclear here) under kubernetes.KUBE_PING. add-index is a request parameter of the add operation of the protocol node. Thank you very much.

Would you please answer a few additional questions about YAML configuration?

Another difficult aspect of YAML configuration is the fact that it seems impossible to easily see if the configuration was applied as was intended by the YAML author. I have to run Wildfly and check if its current configuration has all necessary changes. Do I understand this correctly or is there a way to actually save the configuration with applied changes? Is there some guarantee that the YAML will be applied the same way to a new version of Wildfly? With CLI script, I can apply it to the new original standalone.xml and compare it with my old one kept in revision control and see any problems immediately.

Emmanuel Hugonnet

unread,
May 15, 2025, 7:43:37 AMMay 15
to Ivan L, WildFly
So you can export the runtime configuration of your server (aka the final one):
attachment display --operation=:read-config-as-xml-file
or
attachment save --operation=:read-config-as-xml-file --file=/home/wildfly/tmp/standalone-runtime.xml

As for compatibility: currently there is no such guarantee BUT the model isn't changing much (as in replacing attributes or resources) and
usually this is taken care of when we do at the model level.
Cheers,
Emmanuel

Ivan L

unread,
May 15, 2025, 12:47:23 PMMay 15
to WildFly
This is great! Thanks very much, Emmanuel. I need to study more about management CLI.
Reply all
Reply to author
Forward
0 new messages