In most cases, data partitions are originally created by installing FCOS, rather than by installing another operating system. In such cases, the OKD installer should be allowed to configure your disk partitions.
However, there are two cases where you might want to intervene to override the default partitioning when installing an
Create separate partitions: For greenfield installations on an empty
disk, you might want to add separate storage to a partition. This is
officially supported for making
/var or a subdirectory of
/var, such as
/var/lib/etcd, a separate partition, but not both.
For disk sizes larger than 100GB, and especially disk sizes larger than 1TB, create a separate
/var partition. See "Creating a separate
/var partition" and this Red Hat Knowledgebase article for more information.
Kubernetes supports only two file system partitions. If you add more than one partition to the original configuration, Kubernetes cannot monitor all of them.
Retain existing partitions: For a brownfield installation where you are reinstalling OKD on an existing node and want to retain data partitions installed from your previous operating system, there are both boot arguments and options to
coreos-installer that allow you to retain existing data partitions.
Creating a separate
In general, disk partitioning for OKD should be left to the
installer. However, there are cases where you might want to create separate partitions in a part of the filesystem that you expect to grow.
OKD supports the addition of a single partition to attach
storage to either the
/var partition or a subdirectory of
/var/lib/containers: Holds container-related content that can grow
as more images and containers are added to a system.
/var/lib/etcd: Holds data that you might want to keep separate for purposes such as performance optimization of etcd storage.
/var: Holds data that you might want to keep separate for purposes such as auditing.
For disk sizes larger than 100GB, and especially larger than 1TB, create a separate
Storing the contents of a
/var directory separately makes it easier to grow storage for those areas as needed and reinstall OKD at a later date and keep that data intact. With this method, you will not have to pull all your containers again, nor will you have to copy massive log files when you update systems.
/var must be in place before a fresh installation of
Fedora CoreOS (FCOS), the following procedure sets up the separate
by creating a machine config manifest that is inserted during the
preparation phases of an OKD installation.
Create a directory to hold the OKD installation files:
$ mkdir $HOME/clusterconfig
openshift-install to create a set of files in the
openshift subdirectories. Answer the system questions as you are prompted:
$ openshift-install create manifests --dir $HOME/clusterconfig
? SSH Public Key ...
$ ls $HOME/clusterconfig/openshift/
Create a Butane config that configures the additional partition. For example, name the file
$HOME/clusterconfig/98-var-partition.bu, change the disk device name to the name of the storage device on the
worker systems, and set the storage size as appropriate. This example places the
/var directory on a separate partition:
- device: /dev/<device_name> (1)
- label: var
start_mib: <partition_start_offset> (2)
size_mib: <partition_size> (3)
- device: /dev/disk/by-partlabel/var
mount_options: [defaults, prjquota]