Skip to content

Commit

Permalink
SKS-3327: improve root partition expanding commands in preKubeadmComm…
Browse files Browse the repository at this point in the history
…ands
  • Loading branch information
huaqing1994 committed Jan 3, 2025
1 parent 656241c commit ddac06d
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions templates/cluster-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,10 @@ spec:
#! to the system disk through Tower API. These commands will add the new
#! capacity of the system disk to the root partition.
#! - |
#! . /etc/os-release
#! rootpath="/dev/mapper/rl-root"
#! if [[ $ID == 'openEuler' ]]; then
#! rootpath="/dev/mapper/openeuler-root"
#! fi
#! rootdevice=$(lsblk -pnro MOUNTPOINT,NAME | awk '$1 ~ /^\/$/ { print $2 }')
#! rootpartition=$(lsblk -pnro MOUNTPOINT,PKNAME | awk '$1 ~ /^\/$/ { print $2 }')
#! - |
#! result=$(growpart /dev/vda 2)
#! result=$(growpart ${rootpartition%[0-9]*} ${rootpartition##*[a-z]})
#! if [[ $? == 0 ]]; then
#! echo "$result"
#! elif [[ $result == NOCHANGE* ]]; then
Expand All @@ -119,9 +116,9 @@ spec:
#! echo "$result"
#! exit 1
#! fi
#! - "pvresize /dev/vda2"
#! - "pvresize $rootpartition"
#! - |
#! result=$(lvextend -l+100%FREE -n $rootpath 2>&1)
#! result=$(lvextend -l+100%FREE -n $rootdevice 2>&1)
#! if [[ $? == 0 ]]; then
#! echo "$result"
#! elif [[ $result == *'matches existing size'* ]]; then
Expand Down Expand Up @@ -277,13 +274,10 @@ spec:
#! to the system disk through Tower API. These commands will add the new
#! capacity of the system disk to the root partition.
#! - |
#! . /etc/os-release
#! rootpath="/dev/mapper/rl-root"
#! if [[ $ID == 'openEuler' ]]; then
#! rootpath="/dev/mapper/openeuler-root"
#! fi
#! rootdevice=$(lsblk -pnro MOUNTPOINT,NAME | awk '$1 ~ /^\/$/ { print $2 }')
#! rootpartition=$(lsblk -pnro MOUNTPOINT,PKNAME | awk '$1 ~ /^\/$/ { print $2 }')
#! - |
#! result=$(growpart /dev/vda 2)
#! result=$(growpart ${rootpartition%[0-9]*} ${rootpartition##*[a-z]})
#! if [[ $? == 0 ]]; then
#! echo "$result"
#! elif [[ $result == NOCHANGE* ]]; then
Expand All @@ -292,9 +286,9 @@ spec:
#! echo "$result"
#! exit 1
#! fi
#! - "pvresize /dev/vda2"
#! - "pvresize $rootpartition"
#! - |
#! result=$(lvextend -l+100%FREE -n $rootpath 2>&1)
#! result=$(lvextend -l+100%FREE -n $rootdevice 2>&1)
#! if [[ $? == 0 ]]; then
#! echo "$result"
#! elif [[ $result == *'matches existing size'* ]]; then
Expand Down

0 comments on commit ddac06d

Please sign in to comment.