-
Notifications
You must be signed in to change notification settings - Fork 180
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
Expose salt event publisher for Saline #9380
Open
vzhestkov
wants to merge
2
commits into
uyuni-project:master
Choose a base branch
from
vzhestkov:expose-salt-event-publisher
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+27
−2
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[Unit] | ||
Description=Salt Event Publisher | ||
After=network.target salt-master.service | ||
Requires=salt-master.service | ||
|
||
[Service] | ||
Type=simple | ||
User=salt | ||
StandardOutput=syslog | ||
StandardError=syslog | ||
SyslogIdentifier=salt-event-publisher | ||
ExecStartPre=/bin/bash -c 'until [ -S /run/salt/master/master_event_pub.ipc ]; do sleep 1; done' | ||
ExecStart=/usr/bin/socat TCP4-LISTEN:4512,reuseaddr,fork UNIX-CONNECT:/run/salt/master/master_event_pub.ipc | ||
Restart=always | ||
SuccessExitStatus=0 143 | ||
RestartForceExitStatus=143 | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
1 change: 1 addition & 0 deletions
1
containers/server-image/server-image.changes.vzhestkov.expose-salt-event-publisher
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- Expose salt event bus with salt-event-publisher.service |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to expose one more port with this? I'm assuming not, since this port should be for consumption inside the uyuni network and not exposed to the outside world.
Do you think we need to have some kind of authentication mechanism for it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This basically boils down to sharing the IPC namespace between the saline container and the server one. Did you try https://docs.podman.io/en/latest/markdown/podman-run.1.html#sharing-ipc-between-containers ? In any case this should probably not be the default and only added if saline is enabled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rjmateus this port is not intended to be exposed outside, but required just for saline container to connect and it's working in one direction only, but exposes the unencrypted data. Do we need to protect it somehow if we are not going to expose it except to the other containers on the server? In case of detaching
salt-master
andsalt-api
we should expose couple more ports the same way to make it possible forsalt-api
to communicate tosalt-master
.@cbosdo feel bit stupid but I didn't get how it could be applicable here, the section you send the link to is describing interprocess communication with shared memory, but in this case it's just a socket. There is a way to enable
tcp
transport there in the master config, but it's using hardcoded127.0.0.1
and can't be exposed that way. If I understood the idea wrong, could you please point me to more clear example of using such approach?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC Unix sockets are also parts of the IPCs and thus sharing the IPC namespace between saline container and the container running salt could do the trick.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a type of IPC, but not using shared memory, basically it's a file and what I found before that in some cases it's shared as a file volume, I've read the section by the link you pointed, but still didn't get the idea how to make it working. And I can't find any example for such use case.