Last active
September 26, 2017 14:01
-
-
Save sjenning/a258a265662a6e3f305e6d3de95cab5a to your computer and use it in GitHub Desktop.
OpenShift Node layout with crio+docker using shared xfs and overlay
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
# edit /etc/sysconfig/docker-storage | |
DOCKER_STORAGE_OPTIONS=--storage-driver=overlay2 | |
# edit /etc/sysconfig/docker | |
OPTIONS=' --selinux-enabled --log-driver=journald --graph=/var/lib/containers/storage/docker' | |
# edit /etc/systemd/system/atomic-openshift-node.service | |
WorkingDirectory=/var/lib/containers/storage/origin/ | |
# atomic-openshift-node.service has PreExec commands that expect the WorkingDirectory to exist already | |
mkdir -p /var/lib/containers/storage/origin/ | |
# copy selinux contexts from original paths | |
semanage fcontext -a -e /var/lib/docker /var/lib/containers/storage/docker | |
semanage fcontext -a -e /var/lib/origin /var/lib/containers/storage/origin | |
# after parted/mkfs.xfs on EBS, edit /etc/fstab: | |
UUID=024dfc87-0dea-465b-ad1f-3602d09e7407 /var/lib/containers/storage xfs defaults,pquota 0 1 | |
# edit /etc/origin/node/*/node-config.yaml | |
container-runtime: | |
- remote | |
container-runtime-endpoint: | |
- /var/run/crio.sock | |
image-service-endpoint: | |
- /var/run/crio.sock | |
... | |
volumeDirectory: /var/lib/containers/storage/origin/openshift.local.volumes | |
# download runc from brew and install. version runc-1.0.0-12.1.gitf8ce01d.el7 in the repo has a bad platform.OS check in it that causes runc to fail. | |
wget http://download.eng.bos.redhat.com/brewroot/packages/runc/1.0.0/14.rc4dev.git84a082b.el7/x86_64/runc-1.0.0-14.rc4dev.git84a082b.el7.x86_64.rpm | |
yum install runc-1.0.0-14.rc4dev.git84a082b.el7.x86_64.rpm | |
# install cri-o | |
yum install crio -y | |
# update kernel, cri-o doesn't seem to run on the RHEL 7.4 GA kernel (?) | |
yum update kernel -y | |
reboot | |
# allow running on RHEL | |
/etc/crio/crio.conf | |
storage_option = [ | |
"overlay2.override_kernel_check=1" | |
] | |
# start/enable crio | |
systemctl enable crio | |
systemctl start crio | |
# restart docker | |
systemctl restart docker | |
# restart atomic-openshift-node | |
systemctl daemon-reload # because we changed the service unit WorkingDirectory | |
systemctl restart atomic-openshift-node.service |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment