OpenShift oc cluster up as Systemd Service

Running a single node OpenShift cluster is very easy with oc cluster up.

It's also very easy to run it as system service with persistent configuration, so that on system boot the simple single-node OpenShift cluster starts using the configuration saved. Just put the following Systemd unit under /etc/systemd/system/openshift.service and enable / start it.

[Unit]
Description=OpenShift oc cluster up Service
After=docker.service
Requires=docker.service

[Service]
ExecStart=/usr/local/bin/oc cluster up --host-config-dir=/var/lib/openshift/config --host-data-dir=/var/lib/openshift/data --host-pv-dir=/var/lib/openshift/pv --host-volumes-dir=/var/lib/openshift/volumes --use-existing-config=true --public-hostname=openshift.example.ch --routing-suffix=app.example.com --loglevel=1 --metrics=true
ExecStop=/usr/local/bin/oc cluster down
WorkingDirectory=/var/lib/openshift
Restart=no
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=occlusterup
User=root
Type=oneshot
RemainAfterExit=yes
TimeoutSec=300

[Install]
WantedBy=multi-user.target

More information about the single node OpenShift cluster can be found on Github.

You've successfully subscribed to Tobias Brunner aka tobru
Great! Next, complete checkout to get full access to all premium content.
Error! Could not sign up. invalid link.
Welcome back! You've successfully signed in.
Error! Could not sign in. Please try again.
Success! Your account is fully activated, you now have access to all content.
Error! Stripe checkout failed.
Success! Your billing info is updated.
Error! Billing info update failed.