amazon-web-servicesdevopsamazon-ecsrundeck

How to disable Rundeck cluster mode in AWS ECS Fargate


I'm hosting Rundeck in AWS ECS Fargate - docker image v5.2.0. It runs successfully but I see in the start-up logs a Warning message:

May 28, 2024 at 17:16 (UTC+1:00)    [2024-05-28T16:16:15,238] WARN rundeckapp.BootStrap - Running in cluster mode without rundeck.primaryServerId set. Please set rundeck.primaryServerId to the UUID of the primary server in the cluster  rundeck
May 28, 2024 at 17:16 (UTC+1:00)    [2024-05-28T16:16:15,237] WARN rundeckapp.BootStrap - Cluster mode enabled, this server's UUID: a14bc3e6-75e8-4fe4-a90d-a16dcc976bf6    rundeck
May 28, 2024 at 17:16 (UTC+1:00)    [2024-05-28T16:16:15,235] INFO rundeckapp.BootStrap - loaded configuration: /home/rundeck/etc/framework.properties  rundeck

(surprisingly that UUID always remains the same, even when I change the docker image or change the number of containers from 1 to 2)

I see that the property rundeck.clusterMode.enabled=true in rundeck-config.properties file but I can't find (or there isn't one) environment variable, unlike many other configuration options in Rundeck, to set the clusterMode to false.

I also tried to look at whether ECS Fargate supports something like a postStart hook, like in k8s, but apparently, that feature has been requested (https://github.com/aws/containers-roadmap/issues/952) but is not yet available.

How could I achieve this? Looking at it just from the ECS point of view, I need to modify a file in the ECS Fargate container after the ECS task runs successfully.

TIA!


Solution

  • That doesn't affect the single instance mode (it's considered a "single node cluster instance").

    But if you need to set that property to false, rebuild the image using the Remco template like this answer (based on this doc entry):

    In this case the rundeck-config-extra.properties will include this:

    rundeck.clusterMode.enabled={{ getv("/rundeck/clusterMode/enabled", "false") }}
    

    Build the image: docker compose build

    And then, deploy it: docker compose up

    So, the initialization must omit the cluster mode message:

    [2024-05-28T20:57:46,408] INFO  liquibase.lockservice - Successfully released change log lock
    [2024-05-28T20:57:46,560] INFO  rundeckapp.BootStrap - Starting Rundeck 5.3.0-20240520 (2024-05-20) ...
    [2024-05-28T20:57:46,560] INFO  rundeckapp.BootStrap - using rdeck.base config property: /home/rundeck
    [2024-05-28T20:57:46,568] INFO  rundeckapp.BootStrap - loaded configuration: /home/rundeck/etc/framework.properties
    [2024-05-28T20:57:46,673] INFO  rundeckapp.BootStrap - RSS feeds disabled
    [2024-05-28T20:57:46,673] INFO  rundeckapp.BootStrap - Using jaas authentication
    [2024-05-28T20:57:46,675] INFO  rundeckapp.BootStrap - Preauthentication is disabled
    [2024-05-28T20:57:46,702] INFO  rundeckapp.BootStrap - Rundeck is ACTIVE: executions can be run.
    [2024-05-28T20:57:46,728] WARN  rundeckapp.BootStrap - [Development Mode] Usage of H2 database is recommended only for development and testing
    [2024-05-28T20:57:46,755] INFO  rundeckapp.BootStrap - workflowConfigFix973: applying... 
    [2024-05-28T20:57:46,760] INFO  rundeckapp.BootStrap - workflowConfigFix973: No fix was needed. Storing fix application state.
    [2024-05-28T20:57:47,015] INFO  rundeckapp.BootStrap - Rundeck startup finished in 502ms
    [2024-05-28T20:57:47,019] INFO  rundeckapp.Application - Started Application in 20.393 seconds (JVM running for 21.949)