OpenShift Setting and Enforcing emptyDir Quotas: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
 
(14 intermediate revisions by the same user not shown)
Line 15: Line 15:
==Configure Nodes to Allocate Local Volume Space on an XFS File System==
==Configure Nodes to Allocate Local Volume Space on an XFS File System==


The local volume space on a node is allocated on a directory configured in [[Node-config.yml#Local_Volume_Configuration|/etc/origin/node/node-config.yaml]].
The local volume space on a node is allocated on a directory configured in [[Node-config.yml#Local_Volume_Configuration|/etc/origin/node/node-config.yaml]].
 
To configure quota enforcement, bring the node down as described here: {{Internal|OpenShift_Node_Operations#Stop_a_Node|Stop a Node}}
 
Attach a block device with sufficient storage space to the node. If the node is a KVM host, the procedure is described here:
 
{{Internal|Linux_Virtualization_Adding_Storage_to_Guests|Add Storage to KVM Guests}}
 
At the end of the procedure, the node should have access to an extra XFS filesystem.


==Configure the XFS File System to Allow Quota Enforcement==
==Configure the XFS File System to Allow Quota Enforcement==
Mount the newly created filesystem at boot, with 'gquota' enabled, as shown below:
/dev/vdc1  /openshift.local.volumes            xfs    defaults,gquota  0 0
==Configure node-config.yml==
Update [[Node-config.yml#Local_Volume_Configuration|node-config.yml]] with the new location of the local volume space and the actual value of quota per FSGroup.
...
volumeDirectory: /openshift.local.volumes
volumeConfig:
  localQuota:
    '''perFSGroup''': <font color=teal>"2G"</font>
==Reboot and Test Quota Enforcement Availability==
{{Internal|XFS_Quotas#Info|xfs_quota Info}}


==Configure Pod Templates==
==Configure Pod Templates==

Latest revision as of 21:44, 19 February 2018

External

Internal

Overview

By default, pods can allocate on emptyDirs as much space as the underlying filesystem has available. It is possible to set up a configuration that would restrict space allocation to a quota enforced with the XFS quota mechanism, provided that the backing filesystem used to allocate space for emptyDirs is XFS.

Procedure

Configure Nodes to Allocate Local Volume Space on an XFS File System

The local volume space on a node is allocated on a directory configured in /etc/origin/node/node-config.yaml.

To configure quota enforcement, bring the node down as described here:

Stop a Node

Attach a block device with sufficient storage space to the node. If the node is a KVM host, the procedure is described here:

Add Storage to KVM Guests

At the end of the procedure, the node should have access to an extra XFS filesystem.

Configure the XFS File System to Allow Quota Enforcement

Mount the newly created filesystem at boot, with 'gquota' enabled, as shown below:

/dev/vdc1   /openshift.local.volumes             xfs     defaults,gquota   0 0

Configure node-config.yml

Update node-config.yml with the new location of the local volume space and the actual value of quota per FSGroup.

...
volumeDirectory: /openshift.local.volumes
volumeConfig:
  localQuota:
    perFSGroup: "2G"

Reboot and Test Quota Enforcement Availability

xfs_quota Info

Configure Pod Templates