-
Notifications
You must be signed in to change notification settings - Fork 224
add fully aio systemd unit file and script #292
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
Merged
Merged
Changes from all commits
Commits
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 hidden or 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 hidden or 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,24 @@ | ||
| #!/bin/bash | ||
|
|
||
| set -euxo pipefail | ||
|
|
||
| setsebool -P container_manage_cgroup true | ||
|
|
||
| if ! /usr/bin/podman volume exists microshift-vol | ||
| then | ||
| /usr/bin/podman volume create microshift-vol | ||
| fi | ||
|
|
||
| [[ -d /etc/microshift-aio ]] || mkdir /etc/microshift-aio | ||
|
|
||
| /usr/bin/podman run -d --rm \ | ||
| --name microshift --privileged \ | ||
| -v /lib/modules:/lib/modules \ | ||
| -v microshift-vol:/var/lib \ | ||
| --hostname microshift \ | ||
| --label "io.containers.autoupdate=registry" \ | ||
| -p 6443:6443 quay.io/microshift/microshift:4.7.0-0.microshift-2021-08-31-224727-aio | ||
|
|
||
| cat <<EOF > /etc/microshift-aio/microshift-aio.conf | ||
| export KUBECONFIG=$(/usr/bin/podman volume inspect microshift-vol --format "{{.Mountpoint}}")/microshift/resources/kubeadmin/kubeconfig | ||
| EOF | ||
This file contains hidden or 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,15 @@ | ||
| [Unit] | ||
| Description=microshift all-in-one | ||
| Wants=network-online.target | ||
| After=network-online.target | ||
| RequiresMountsFor=/run/containers/storage | ||
|
|
||
| [Service] | ||
| Restart=on-failure | ||
| TimeoutStopSec=70 | ||
| ExecStart=/bin/bash /usr/bin/microshift-aio-run | ||
| ExecStop=/usr/bin/podman stop -t 20 microshift | ||
| Type=forking | ||
|
|
||
| [Install] | ||
| WantedBy=multi-user.target default.target |
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.
what is this for?
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.
I wanted a file with the location of the KUBECONFIG like so:
I could not see a better way of getting that path from the service, but that is definitely extra and does not need to be included in the service. I figured it saves users from having to look up the path.
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.
I also could not figure out how to run
ExecStartPost=source /etc/microshift-aio/microshift-aio.confI tried
ExecStartPost=source,ExecStartPost=/bin/bash sourceetc, nothing worked but there is def something that does, I gave up and pushed the commit but will keep lookingThere 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.
@husky-parul if you find something that works or if we decide it's not necessary, you can remove it, feel free to squash/amend, too
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.
i see, that makes sense