Merge "Revert "[ceph-client] enhance logic to enable the autoscaler for Octopus""
This commit is contained in:
commit
128c3f748a
@ -15,6 +15,6 @@ apiVersion: v1
|
||||
appVersion: v1.0.0
|
||||
description: OpenStack-Helm Ceph Client
|
||||
name: ceph-client
|
||||
version: 0.1.8
|
||||
version: 0.1.9
|
||||
home: https://github.com/ceph/ceph-client
|
||||
...
|
||||
|
@ -181,7 +181,13 @@ function pool_validation() {
|
||||
pg_placement_num=$(echo ${pool_obj} | jq -r .pg_placement_num)
|
||||
crush_rule=$(echo ${pool_obj} | jq -r .crush_rule)
|
||||
name=$(echo ${pool_obj} | jq -r .pool_name)
|
||||
|
||||
pg_autoscale_mode=$(echo ${pool_obj} | jq -r .pg_autoscale_mode)
|
||||
if [[ "${ENABLE_AUTOSCALER}" == "true" ]]; then
|
||||
if [[ "${pg_autoscale_mode}" != "on" ]]; then
|
||||
echo "pg autoscaler not enabled on ${name} pool"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
if [[ $(ceph mon versions | awk '/version/{print $3}' | cut -d. -f1) -ge 14 ]]; then
|
||||
if [ "x${size}" != "x${RBD}" ] || [ "x${min_size}" != "x${EXPECTED_POOLMINSIZE}" ] \
|
||||
|| [ "x${crush_rule}" != "x${expectedCrushRuleId}" ]; then
|
||||
|
@ -146,11 +146,13 @@ function reweight_osds () {
|
||||
done
|
||||
}
|
||||
|
||||
function enable_autoscaling () {
|
||||
if [[ $(ceph mgr versions | awk '/version/{print $3}' | cut -d. -f1) -eq 14 ]]; then
|
||||
ceph mgr module enable pg_autoscaler # only required for nautilus
|
||||
function enable_or_disable_autoscaling () {
|
||||
if [[ "${ENABLE_AUTOSCALER}" == "true" ]]; then
|
||||
ceph mgr module enable pg_autoscaler
|
||||
ceph config set global osd_pool_default_pg_autoscale_mode on
|
||||
else
|
||||
ceph mgr module disable pg_autoscaler
|
||||
fi
|
||||
ceph config set global osd_pool_default_pg_autoscale_mode on
|
||||
}
|
||||
|
||||
function set_cluster_flags () {
|
||||
@ -182,8 +184,10 @@ function create_pool () {
|
||||
ceph --cluster "${CLUSTER}" osd pool application enable "${POOL_NAME}" "${POOL_APPLICATION}"
|
||||
fi
|
||||
|
||||
if [[ $(ceph osd versions | awk '/version/{print $3}' | cut -d. -f1) -ge 14 ]] ; then
|
||||
if [[ $(ceph osd versions | awk '/version/{print $3}' | cut -d. -f1) -ge 14 ]] && [[ "${ENABLE_AUTOSCALER}" == "true" ]] ; then
|
||||
ceph --cluster "${CLUSTER}" osd pool set "${POOL_NAME}" pg_autoscale_mode on
|
||||
else
|
||||
ceph --cluster "${CLUSTER}" osd pool set "${POOL_NAME}" pg_autoscale_mode off
|
||||
fi
|
||||
#
|
||||
# Make sure pool is not protected after creation AND expansion so we can manipulate its settings.
|
||||
@ -265,8 +269,8 @@ else
|
||||
cluster_capacity=$(ceph --cluster "${CLUSTER}" df | head -n3 | tail -n1 | awk '{print $1 substr($2, 1, 1)}' | numfmt --from=iec)
|
||||
fi
|
||||
|
||||
if [[ $(ceph mgr versions | awk '/version/{print $3}' | cut -d. -f1) -ge 14 ]]; then
|
||||
enable_autoscaling
|
||||
if [[ $(ceph mgr versions | awk '/version/{print $3}' | cut -d. -f1) -eq 14 ]]; then
|
||||
enable_or_disable_autoscaling
|
||||
fi
|
||||
|
||||
{{- range $pool := .Values.conf.pool.spec -}}
|
||||
|
@ -50,6 +50,8 @@ spec:
|
||||
env:
|
||||
- name: CLUSTER
|
||||
value: "ceph"
|
||||
- name: ENABLE_AUTOSCALER
|
||||
value: {{ .Values.conf.features.pg_autoscaler | quote }}
|
||||
- name: CLUSTER_SET_FLAGS
|
||||
value: {{ .Values.conf.features.cluster_flags.set | quote }}
|
||||
- name: CLUSTER_UNSET_FLAGS
|
||||
|
@ -50,6 +50,8 @@ spec:
|
||||
value: {{ .Values.conf.pool.default.crush_rule | default "replicated_rule" | quote }}
|
||||
- name: MGR_COUNT
|
||||
value: {{ .Values.pod.replicas.mgr | default "1" | quote }}
|
||||
- name: ENABLE_AUTOSCALER
|
||||
value: {{ .Values.conf.features.pg_autoscaler | quote }}
|
||||
{{- range $pool := .Values.conf.pool.spec -}}
|
||||
{{- with $pool }}
|
||||
- name: {{ .name | upper | replace "." "_" }}
|
||||
|
@ -8,5 +8,4 @@ ceph-client:
|
||||
- 0.1.5 Fix Helm test check_pgs() check for inactive PGs
|
||||
- 0.1.6 Uplift from Nautilus to Octopus release
|
||||
- 0.1.7 Don't wait for premerge PGs in the rbd pool job
|
||||
- 0.1.8 Enhance logic to enable the pg autoscaler
|
||||
...
|
||||
|
Loading…
Reference in New Issue
Block a user