Skip to content

add fully aio systemd unit file and script#292

Merged
rootfs merged 1 commit intoopenshift:mainfrom
sallyom:unit-file-all-in-one
Sep 21, 2021
Merged

add fully aio systemd unit file and script#292
rootfs merged 1 commit intoopenshift:mainfrom
sallyom:unit-file-all-in-one

Conversation

@sallyom
Copy link
Contributor

@sallyom sallyom commented Sep 21, 2021

Signed-off-by: Sally O'Malley somalley@redhat.com
Signed-off-by: Parul Singh parsingh@redhat.com

Which issue(s) this PR addresses:
This PR partially resolves #276

This PR:
Adds a systemd unit file to run microshift all-in-one with podman
The service:

  • creates microshift-vol podman volume if it does not exist
  • starts microshift via podman run command
  • writes location of KUBECONFIG to /etc/microshift-aio/microshift-aio.conf for easy source /etc/microshift-aio/microshift-aio.conf upon service startup
  • included the auto-update podman annotation, but this needs testing to be sure it works correctly (ie, not sure which tags, if it changes the tags)
  • With systemctl stop microshift-aoi
    • microshift pod is stopped/deleted
    • microshift-vol is not deleted

@openshift-ci openshift-ci bot requested review from copejon and rootfs September 21, 2021 18:45
Copy link
Member

Choose a reason for hiding this comment

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

what is this for?

Copy link
Contributor Author

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:

cat <<EOF > /etc/microshift-aio/microshift-aio.conf
export KUBECONFIG=$(/usr/bin/podman volume inspect microshift-vol --format "{{.Mountpoint}}")/microshift/resources/kubeadmin/kubeconfig
EOF

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.

Copy link
Contributor Author

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.conf
I tried ExecStartPost=source, ExecStartPost=/bin/bash source etc, nothing worked but there is def something that does, I gave up and pushed the commit but will keep looking

Copy link
Contributor Author

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

Copy link
Member

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

Copy link
Member

Choose a reason for hiding this comment

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

this probably doesn't need, since the container starts with --rm

@sallyom sallyom force-pushed the unit-file-all-in-one branch from fef0b66 to 461a51d Compare September 21, 2021 18:58
Signed-off-by: Sally O'Malley <somalley@redhat.com>
Signed-off-by: Parul Singh <parsingh@redhat.com>

Co-authored-by: Sally O'Malley <parsingh@redhat.com>
Co-authored-by: Parul Singh <parsingh@redhat.com>
@sallyom sallyom force-pushed the unit-file-all-in-one branch from 461a51d to f216081 Compare September 21, 2021 19:34
@rootfs
Copy link
Member

rootfs commented Sep 21, 2021

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 21, 2021
@rootfs rootfs merged commit 42a2722 into openshift:main Sep 21, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 21, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rootfs

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Enhancement]: Add systemd units for production deployments on Podman

2 participants