Thanks to visit codestin.com
Credit goes to github.com

Skip to content

tracker issues_75004: Custom container service does not handle args c…#67606

Open
yaelazulay-redhat wants to merge 1 commit intoceph:mainfrom
yaelazulay-redhat:issues_75004_custom_container_service_with_args_does_not_handled_correctly
Open

tracker issues_75004: Custom container service does not handle args c…#67606
yaelazulay-redhat wants to merge 1 commit intoceph:mainfrom
yaelazulay-redhat:issues_75004_custom_container_service_with_args_does_not_handled_correctly

Conversation

@yaelazulay-redhat
Copy link

@yaelazulay-redhat yaelazulay-redhat commented Mar 2, 2026

Fixes: https://tracker.ceph.com/issues/75004
Signed-off-by: Yael Azulay [email protected]

Issue: cephadm custom service fails to start with args.
Root cause: Container arguments were incorrectly placed before the image name in the podman run command within unit.run.
Reason:
When applying a custom service, for example:

service_type: container
service_id: keycloak
placement:
host_pattern: '*'
spec:
image: quay.io/keycloak/keycloak:latest
args:
- "start"
- "--http-enabled=true"
- "--hostname-strict=false"
- "--db=dev-mem"
envs:
- "KC_BOOTSTRAP_ADMIN_USERNAME=admin"
- "KC_BOOTSTRAP_ADMIN_PASSWORD=password123"

The args field was assigned to the Podman arguments instead of the daemon arguments.

Fix: Assign the args field to the daemon arguments instead of the Podman arguments. This reorders the command execution to place the arguments after the image name.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)

…orrectly

https://tracker.ceph.com/issues/75004
Issue: cephadm custom service fails to start with args.
Root cause: Container arguments were incorrectly placed before the image name in the podman run command within unit.run.
Reason:
When applying a custom service, for example:
service_type: container
service_id: keycloak
placement:
  host_pattern: '*'
spec:
  image: quay.io/keycloak/keycloak:latest
  args:
    - "start"
    - "--http-enabled=true"
    - "--hostname-strict=false"
    - "--db=dev-mem"
  envs:
    - "KC_BOOTSTRAP_ADMIN_USERNAME=admin"
    - "KC_BOOTSTRAP_ADMIN_PASSWORD=password123"

The args field was assigned to the Podman arguments instead of the daemon arguments.

Fix: Assign the args field to the daemon arguments instead of the Podman arguments. This reorders the command execution to place the arguments after the image name.

Signed-off-by: yaelazulay-redhat <[email protected]>
@ceph-jenkins
Copy link
Collaborator

Can one of the admins verify this patch?

14 similar comments
@ceph-jenkins
Copy link
Collaborator

Can one of the admins verify this patch?

@ceph-jenkins
Copy link
Collaborator

Can one of the admins verify this patch?

@ceph-jenkins
Copy link
Collaborator

Can one of the admins verify this patch?

@ceph-jenkins
Copy link
Collaborator

Can one of the admins verify this patch?

@ceph-jenkins
Copy link
Collaborator

Can one of the admins verify this patch?

@ceph-jenkins
Copy link
Collaborator

Can one of the admins verify this patch?

@ceph-jenkins
Copy link
Collaborator

Can one of the admins verify this patch?

@ceph-jenkins
Copy link
Collaborator

Can one of the admins verify this patch?

@ceph-jenkins
Copy link
Collaborator

Can one of the admins verify this patch?

@ceph-jenkins
Copy link
Collaborator

Can one of the admins verify this patch?

@ceph-jenkins
Copy link
Collaborator

Can one of the admins verify this patch?

@ceph-jenkins
Copy link
Collaborator

Can one of the admins verify this patch?

@ceph-jenkins
Copy link
Collaborator

Can one of the admins verify this patch?

@ceph-jenkins
Copy link
Collaborator

Can one of the admins verify this patch?

yaelazulay-redhat

This comment was marked as spam.

@rkachach rkachach requested review from a team and phlogistonjohn March 2, 2026 13:43
Copy link
Contributor

@phlogistonjohn phlogistonjohn left a comment

Choose a reason for hiding this comment

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

Your commit messages should comply with the ceph project standards:
https://github.com/ceph/ceph/blob/main/SubmittingPatches.rst#commit-title

Your Signed-off-by should contain your name (legal name typically) not your github username.

If you refer to a tracker link in the commit message, use a Fixes: trailer.

Example:

Fixes: https://tracker.ceph.com/issues/75004
Signed-off-by: Jon Doe <[email protected]>

Per:

# args are for the container runtime, not entrypoint

Putting the arguments for the entrypoint in the args paramater as in the example below is incorrect:

- Reproduce with following keycloak service definition:
service_type: container
service_id: keycloak
placement:
host_pattern: '*'
spec:
image: quay.io/keycloak/keycloak:latest
args:
- "start"
- "--http-enabled=true"
- "--hostname-strict=false"
- "--db=dev-mem"
envs:
- "KC_BOOTSTRAP_ADMIN_USERNAME=admin"
- "KC_BOOTSTRAP_ADMIN_PASSWORD=password123"

If I remember correctly you should use extra_entrypoint_args to specify arguments for the entrypoint. @adk3798 may want to double check my statement here though.

@yaelazulay-redhat
Copy link
Author

yaelazulay-redhat commented Mar 3, 2026

Hi @phlogistonjohn
Thanks, I have updated the comment
Fixes: https://tracker.ceph.com/issues/75004
Signed-off-by: Yael Azulay [email protected]

Also, note that I have corrected the keycloak json example I have used:
the env: was missing so I have added it.

More information:

Based on the keycloak json I tested, the incorrect podman run command appeared as follows:

/usr/bin/podman run --rm --ipc=host --stop-signal=SIGTERM --init --name ceph-33dd251a-1093-11f1-9389-52540032be7e-container-keycloak-ceph-node-0 start --http-enabled=true --hostname-strict=false --db=dev-mem -d --log-driver journald --conmon-pidfile /run/ceph-33dd251a-1093-11f1-9389-52540032be7e@container.keycloak.ceph-node-0.service-pid --cidfile /run/ceph-33dd251a-1093-11f1-9389-52540032be7e@container.keycloak.ceph-node-0.service-cid --cgroups=split -e CONTAINER_IMAGE=quay.io/keycloak/keycloak:latest -e NODE_NAME=ceph-node-0 -e KC_BOOTSTRAP_ADMIN_USERNAME=admin -e KC_BOOTSTRAP_ADMIN_PASSWORD=password123 -v /etc/hosts:/etc/hosts:ro quay.io/keycloak/keycloak:latest

With the fix applied, it looks like this:

/usr/bin/podman run --rm --ipc=host --stop-signal=SIGTERM --init --name ceph-f76ad23e-1615-11f1-9100-525400e2ab1b-container-keycloak-ceph-node-0 -d --log-driver journald --conmon-pidfile /run/ceph-f76ad23e-1615-11f1-9100-525400e2ab1b@container.keycloak.ceph-node-0.service-pid --cidfile /run/ceph-f76ad23e-1615-11f1-9100-525400e2ab1b@container.keycloak.ceph-node-0.service-cid --cgroups=split -e CONTAINER_IMAGE=quay.io/keycloak/keycloak:latest -e NODE_NAME=ceph-node-0 -e KC_BOOTSTRAP_ADMIN_USERNAME=admin -e KC_BOOTSTRAP_ADMIN_PASSWORD=password123 -v /etc/hosts:/etc/hosts:ro quay.io/keycloak/keycloak:latest start --http-enabled=true --hostname-strict=false --db=dev-mem

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.

3 participants