Skip to content

Conversation

@mrodm
Copy link
Contributor

@mrodm mrodm commented Apr 22, 2024

Use the same definitions for volumes as in the Elastic Agent defined in the stack:

volumes:
- "../certs/ca-cert.pem:/etc/ssl/certs/elastic-package.pem"
- type: bind
source: ../../../tmp/service_logs/
target: /tmp/service_logs/
# Mount service_logs under /run too as a testing workaround for the journald input (see elastic-package#1235).
- type: bind
source: ../../../tmp/service_logs/
target: /run/service_logs/

@mrodm mrodm self-assigned this Apr 22, 2024
@mrodm
Copy link
Contributor Author

mrodm commented Apr 22, 2024

/test

@mrodm mrodm requested a review from a team April 23, 2024 09:39
@mrodm mrodm marked this pull request as ready for review April 23, 2024 09:39
volumes:
- ${SERVICE_LOGS_DIR}:/tmp/service_logs/
- ${LOCAL_CA_CERT}:/etc/ssl/certs/elastic-package.pem
Copy link
Member

Choose a reason for hiding this comment

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

Do you know what is the default type when using this syntax?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just checked in a local run, and the type is also "bind", but the Mode changes from "rw" to empty string. I haven't found what that means exactly...

        "Mounts": [
            {
                "Type": "bind",
                "Source": "/home/mariorodriguez/.elastic-package/profiles/default/certs/ca-cert.pem",
                "Destination": "/etc/ssl/certs/elastic-package.pem",
                "Mode": "rw",
                "RW": true,
                "Propagation": "rprivate"
            },
            {
                "Type": "bind",
                "Source": "/home/mariorodriguez/.elastic-package/tmp/service_logs/agent-sophos-utm",
                "Destination": "/tmp/service_logs",
                "Mode": "",
                "RW": true,
                "Propagation": "rprivate"
            },
            {
                "Type": "bind",
                "Source": "/home/mariorodriguez/.elastic-package/tmp/service_logs/agent-sophos-utm",
                "Destination": "/run/service_logs",
                "Mode": "",
                "RW": true,
                "Propagation": "rprivate"
            }
        ],

Copy link
Contributor Author

@mrodm mrodm Apr 24, 2024

Choose a reason for hiding this comment

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

Maybe the service that was failing was because it was expecting the logs in /run/service_logs ?

At the end, all those mounts look similar in the configuration shown with a docker inspect

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated settings to set explicitly read only or read write for those volumes, and keeping the same syntax in all mounts.

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @mrodm

@mrodm mrodm requested a review from jsoriano April 24, 2024 17:22
@mrodm mrodm merged commit 3749827 into elastic:main Apr 25, 2024
@mrodm mrodm deleted the agent_volumes_bind_type branch April 25, 2024 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants