From b9e5c50bf6a574e4ff0e8a24ea7c7c8fabeabcc4 Mon Sep 17 00:00:00 2001 From: Cian Johnston Date: Fri, 23 Apr 2021 09:42:06 +0000 Subject: [PATCH 1/1] ceph: configuration fixes * Wire through deviceFilter properly * Expose rook configuration knobs via env vars Change-Id: Idfdb2d229f542ea73835f41b1ea574a3f72b8023 Signed-off-by: Cian Johnston --- .../playbooks/roles/common/vars/main.yml | 28 +++++++++---------- .../roles/install/templates/cluster.yaml.j2 | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/apps/ceph/kubespray/playbooks/roles/common/vars/main.yml b/apps/ceph/kubespray/playbooks/roles/common/vars/main.yml index 5a35dd8..81ae14a 100644 --- a/apps/ceph/kubespray/playbooks/roles/common/vars/main.yml +++ b/apps/ceph/kubespray/playbooks/roles/common/vars/main.yml @@ -20,7 +20,7 @@ rook_data_dir_path: "/var/lib/rook" rook_storage_dir_path: "/rook/storage-dir" -rook_namespace: "rook-ceph" +rook_namespace: "{{ lookup('env', 'ROOK_NAMESPACE') | default('rook-ceph', true) }}" # Per SuSE best practices for Rook deployments, separating nodes providing storage # from nodes running workloads consuming said storage @@ -35,25 +35,25 @@ rook_storage_nodes: "{{ groups['storage'] }}" rook_nostorage_nodes: "{{ groups['k8s-cluster'] | difference(rook_storage_nodes) }}" # Disabled for small test environment -rook_ceph_crashcollector_disable: true -rook_use_host_network: false -rook_node_device_filter: "vdb" +rook_ceph_crashcollector_disable: "{{ lookup('env', 'ROOK_CEPH_CRASHCOLLECTOR_DISABLE') | default(true, true) }}" +rook_use_host_network: "{{ lookup('env', 'ROOK_USE_HOST_NETWORK') | default(false, true) }}" +rook_node_device_filter: "{{ lookup('env', 'ROOK_NODE_DEVICE_FILTER') | default('^vdb$', true) }}" -rook_block_pool_name: "block-pool" -rook_block_pool_replicas: 1 +rook_block_pool_name: "{{ lookup('env', 'ROOK_BLOCK_POOL_NAME') | default('block-pool', true) }}" +rook_block_pool_replicas: "{{ lookup('env', 'ROOK_BLOCK_POOL_REPLICAS') | default(1, true) | int }}" # The below values should be customized according to deployment requirements # See: https://docs.ceph.com/en/latest/rados/configuration/pool-pg-config-ref/ -rook_ceph_osd_pool_default_size: 1 -rook_ceph_osd_pool_default_min_size: 1 -rook_ceph_mon_warn_on_no_pool_redundancy: false +rook_ceph_osd_pool_default_size: "{{ lookup('env', 'ROOK_CEPH_OSD_POOL_DEFAULT_SIZE') | default(1, true) | int }}" +rook_ceph_osd_pool_default_min_size: "{{ lookup('env', 'ROOK_CEPH_OSD_POOL_DEFAULT_MIN_SIZE') | default(1, true) | int }}" +rook_ceph_mon_warn_on_no_pool_redundancy: "{{ lookup('env', 'ROOK_CEPH_MON_WARN_ON_NO_POOL_REDUNDANCY') | default(false, true) }}" # Increase this as required. Must be an odd number. 3 is the recommended value. -rook_ceph_mon_count: 1 +rook_ceph_mon_count: "{{ lookup('env', 'ROOK_CEPH_MON_COUNT') | default(1, true) | int }}" -rook_block_storage_name: "block-storage" -rook_block_storage_fs: "xfs" +rook_block_storage_name: "{{ lookup('env', 'ROOK_BLOCK_STORAGE_NAME') | default('block-storage', true) }}" +rook_block_storage_fs: "{{ lookup('env', 'ROOK_BLOCK_STORAGE_FS') | default('xfs', true) }}" rook_filesystem: "{{ lookup('env', 'ROOK_FS') | default('false', true) }}" -rook_filesystem_name: "rookfs" -rook_filesystem_storageclass_name: "csi-cephfs" +rook_filesystem_name: "{{ lookup('env', 'ROOK_FILESYSTEM_NAME') | default('rookfs', true) }}" +rook_filesystem_storageclass_name: "{{ lookup('env', 'ROOK_FILESYSTEM_STORAGECLASS_NAME') | default('csi-cephfs, true) }}" # vim: set ts=2 sw=2 expandtab: diff --git a/apps/ceph/kubespray/playbooks/roles/install/templates/cluster.yaml.j2 b/apps/ceph/kubespray/playbooks/roles/install/templates/cluster.yaml.j2 index 36d29ba..c49d1c3 100644 --- a/apps/ceph/kubespray/playbooks/roles/install/templates/cluster.yaml.j2 +++ b/apps/ceph/kubespray/playbooks/roles/install/templates/cluster.yaml.j2 @@ -185,7 +185,7 @@ spec: storage: # cluster level storage configuration and selection useAllNodes: true useAllDevices: false - deviceFilter: "^vdb$" + deviceFilter: "{{ rook_node_device_filter }}" location: config: # crushRoot: "custom-root" # specify a non-default root label for the CRUSH map -- 2.25.1