Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't provide a single volume at /home/salt/data #264

Closed
mrichar1 opened this issue Oct 8, 2024 · 1 comment · Fixed by #265
Closed

Can't provide a single volume at /home/salt/data #264

mrichar1 opened this issue Oct 8, 2024 · 1 comment · Fixed by #265
Assignees
Labels
bug Something isn't working

Comments

@mrichar1
Copy link
Contributor

mrichar1 commented Oct 8, 2024

I am looking to run salt-master on a kubernetes cluster with a single persistent volume mounted in /home/salt/data to persist all the relevant salt-master config.

I have set this up as follows:

containers:
      - name: salt-master
        image: ghcr.io/cdalvaro/docker-salt-master:3007.1_2
        ports:
        - containerPort: 4505
        - containerPort: 4506
        volumeMounts:
        - name: salt-master-pv
          mountPath: /home/salt/data/

However the image expects separate volumes to be explicitly defined for logs and keys in the Dockerfile:

VOLUME [ "${SALT_KEYS_DIR}", "${SALT_LOGS_DIR}" ]

This causes these volumes to always be mounted - in my case since I am not specifying these volumes it remounts the local disk at these directories over the top of my mount:

# mount |grep salt
10.0.0.1:/volumes/salt-config on /home/salt/data type nfs (rw,relatime)
/dev/sda6 on /home/salt/data/keys type xfs (rw,noatime,attr2,inode64,logbufs=8,logbsize=32k,noquota)
/dev/sda6 on /home/salt/data/logs type xfs (rw,noatime,attr2,inode64,logbufs=8,logbsize=32k,noquota)

The fix for this is to omit the VOLUMES line in Dockerfile - this still allows volumes to be specified with docker on the command-line (e.g. --volume $(pwd)/keys/:/home/salt/data/keys/), but if not set then the container will just use /home/salt/data/keys 'as-is' - either the local disk, or whatever is mounted there. (Which is effectively identical to the current behaviour).

Would this be something you would consider changing?

@mrichar1 mrichar1 added the bug Something isn't working label Oct 8, 2024
@cdalvaro
Copy link
Owner

cdalvaro commented Oct 8, 2024

Hi @mrichar1, thank you for raising this issue.

I initially set those directories as volumes in the Dockerfile as a safeguard, ensuring that users wouldn’t lose keys or logs if they forgot to mount the corresponding volumes.

That said, I’m open to removing them from the Dockerfile and updating the documentation examples to include the logs volume as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants