Release 1.2.5-rc1
Signed-off-by: David Ko <dko@suse.com>
This commit is contained in:
parent
70cacf0ebe
commit
9fa6cd48f2
@ -1,7 +1,7 @@
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
name: longhorn
|
name: longhorn
|
||||||
version: 1.2.4
|
version: 1.2.5-rc1
|
||||||
appVersion: v1.2.4
|
appVersion: v1.2.5-rc1
|
||||||
kubeVersion: ">=1.18.0-0"
|
kubeVersion: ">=1.18.0-0"
|
||||||
description: Longhorn is a distributed block storage system for Kubernetes.
|
description: Longhorn is a distributed block storage system for Kubernetes.
|
||||||
keywords:
|
keywords:
|
||||||
|
@ -25,13 +25,13 @@ image:
|
|||||||
longhorn:
|
longhorn:
|
||||||
engine:
|
engine:
|
||||||
repository: longhornio/longhorn-engine
|
repository: longhornio/longhorn-engine
|
||||||
tag: v1.2.4
|
tag: v1.2.5-rc1
|
||||||
manager:
|
manager:
|
||||||
repository: longhornio/longhorn-manager
|
repository: longhornio/longhorn-manager
|
||||||
tag: v1.2.4
|
tag: v1.2.5-rc1
|
||||||
ui:
|
ui:
|
||||||
repository: longhornio/longhorn-ui
|
repository: longhornio/longhorn-ui
|
||||||
tag: v1.2.4
|
tag: v1.2.5-rc1
|
||||||
instanceManager:
|
instanceManager:
|
||||||
repository: longhornio/longhorn-instance-manager
|
repository: longhornio/longhorn-instance-manager
|
||||||
tag: v1_20220303
|
tag: v1_20220303
|
||||||
|
@ -4,8 +4,8 @@ longhornio/csi-resizer:v1.2.0
|
|||||||
longhornio/csi-snapshotter:v3.0.3
|
longhornio/csi-snapshotter:v3.0.3
|
||||||
longhornio/csi-node-driver-registrar:v2.3.0
|
longhornio/csi-node-driver-registrar:v2.3.0
|
||||||
longhornio/backing-image-manager:v2_20210820
|
longhornio/backing-image-manager:v2_20210820
|
||||||
longhornio/longhorn-engine:v1.2.4
|
longhornio/longhorn-engine:v1.2.5-rc1
|
||||||
longhornio/longhorn-instance-manager:v1_20220303
|
longhornio/longhorn-instance-manager:v1_20220303
|
||||||
longhornio/longhorn-manager:v1.2.4
|
longhornio/longhorn-manager:v1.2.5-rc1
|
||||||
longhornio/longhorn-share-manager:v1_20211020
|
longhornio/longhorn-share-manager:v1_20211020
|
||||||
longhornio/longhorn-ui:v1.2.4
|
longhornio/longhorn-ui:v1.2.5-rc1
|
||||||
|
@ -948,7 +948,7 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: longhorn-manager
|
- name: longhorn-manager
|
||||||
image: longhornio/longhorn-manager:v1.2.4
|
image: longhornio/longhorn-manager:v1.2.5-rc1
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
securityContext:
|
securityContext:
|
||||||
privileged: true
|
privileged: true
|
||||||
@ -957,7 +957,7 @@ spec:
|
|||||||
- -d
|
- -d
|
||||||
- daemon
|
- daemon
|
||||||
- --engine-image
|
- --engine-image
|
||||||
- longhornio/longhorn-engine:v1.2.4
|
- longhornio/longhorn-engine:v1.2.5-rc1
|
||||||
- --instance-manager-image
|
- --instance-manager-image
|
||||||
- longhornio/longhorn-instance-manager:v1_20220303
|
- longhornio/longhorn-instance-manager:v1_20220303
|
||||||
- --share-manager-image
|
- --share-manager-image
|
||||||
@ -965,7 +965,7 @@ spec:
|
|||||||
- --backing-image-manager-image
|
- --backing-image-manager-image
|
||||||
- longhornio/backing-image-manager:v2_20210820
|
- longhornio/backing-image-manager:v2_20210820
|
||||||
- --manager-image
|
- --manager-image
|
||||||
- longhornio/longhorn-manager:v1.2.4
|
- longhornio/longhorn-manager:v1.2.5-rc1
|
||||||
- --service-account
|
- --service-account
|
||||||
- longhorn-service-account
|
- longhorn-service-account
|
||||||
ports:
|
ports:
|
||||||
@ -1079,7 +1079,7 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: longhorn-ui
|
- name: longhorn-ui
|
||||||
image: longhornio/longhorn-ui:v1.2.4
|
image: longhornio/longhorn-ui:v1.2.5-rc1
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name : nginx-cache
|
- name : nginx-cache
|
||||||
@ -1147,18 +1147,18 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
initContainers:
|
initContainers:
|
||||||
- name: wait-longhorn-manager
|
- name: wait-longhorn-manager
|
||||||
image: longhornio/longhorn-manager:v1.2.4
|
image: longhornio/longhorn-manager:v1.2.5-rc1
|
||||||
command: ['sh', '-c', 'while [ $(curl -m 1 -s -o /dev/null -w "%{http_code}" http://longhorn-backend:9500/v1) != "200" ]; do echo waiting; sleep 2; done']
|
command: ['sh', '-c', 'while [ $(curl -m 1 -s -o /dev/null -w "%{http_code}" http://longhorn-backend:9500/v1) != "200" ]; do echo waiting; sleep 2; done']
|
||||||
containers:
|
containers:
|
||||||
- name: longhorn-driver-deployer
|
- name: longhorn-driver-deployer
|
||||||
image: longhornio/longhorn-manager:v1.2.4
|
image: longhornio/longhorn-manager:v1.2.5-rc1
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
command:
|
command:
|
||||||
- longhorn-manager
|
- longhorn-manager
|
||||||
- -d
|
- -d
|
||||||
- deploy-driver
|
- deploy-driver
|
||||||
- --manager-image
|
- --manager-image
|
||||||
- longhornio/longhorn-manager:v1.2.4
|
- longhornio/longhorn-manager:v1.2.5-rc1
|
||||||
- --manager-url
|
- --manager-url
|
||||||
- http://longhorn-backend:9500/v1
|
- http://longhorn-backend:9500/v1
|
||||||
env:
|
env:
|
||||||
|
@ -1,18 +1,123 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
dependencies() {
|
export RED='\x1b[0;31m'
|
||||||
|
export GREEN='\x1b[38;5;22m'
|
||||||
|
export CYAN='\x1b[36m'
|
||||||
|
export YELLOW='\x1b[33m'
|
||||||
|
export NO_COLOR='\x1b[0m'
|
||||||
|
|
||||||
|
if [ -z "${LOG_TITLE}" ]; then
|
||||||
|
LOG_TITLE=''
|
||||||
|
fi
|
||||||
|
if [ -z "${LOG_LEVEL}" ]; then
|
||||||
|
LOG_LEVEL="INFO"
|
||||||
|
fi
|
||||||
|
|
||||||
|
debug() {
|
||||||
|
if [[ "${LOG_LEVEL}" == "DEBUG" ]]; then
|
||||||
|
local log_title
|
||||||
|
if [ -n "${LOG_TITLE}" ]; then
|
||||||
|
log_title="(${LOG_TITLE})"
|
||||||
|
else
|
||||||
|
log_title=''
|
||||||
|
fi
|
||||||
|
echo -e "${GREEN}[DEBUG]${log_title} ${NO_COLOR}$1"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
info() {
|
||||||
|
if [[ "${LOG_LEVEL}" == "DEBUG" ]] ||\
|
||||||
|
[[ "${LOG_LEVEL}" == "INFO" ]]; then
|
||||||
|
local log_title
|
||||||
|
if [ -n "${LOG_TITLE}" ]; then
|
||||||
|
log_title="(${LOG_TITLE})"
|
||||||
|
else
|
||||||
|
log_title=''
|
||||||
|
fi
|
||||||
|
echo -e "${CYAN}[INFO] ${log_title} ${NO_COLOR}$1"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
warn() {
|
||||||
|
if [[ "${LOG_LEVEL}" == "DEBUG" ]] ||\
|
||||||
|
[[ "${LOG_LEVEL}" == "INFO" ]] ||\
|
||||||
|
[[ "${LOG_LEVEL}" == "WARN" ]]; then
|
||||||
|
local log_title
|
||||||
|
if [ -n "${LOG_TITLE}" ]; then
|
||||||
|
log_title="(${LOG_TITLE})"
|
||||||
|
else
|
||||||
|
log_title=''
|
||||||
|
fi
|
||||||
|
echo -e "${YELLOW}[WARN] ${log_title} ${NO_COLOR}$1"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
error() {
|
||||||
|
if [[ "${LOG_LEVEL}" == "DEBUG" ]] ||\
|
||||||
|
[[ "${LOG_LEVEL}" == "INFO" ]] ||\
|
||||||
|
[[ "${LOG_LEVEL}" == "WARN" ]] ||\
|
||||||
|
[[ "${LOG_LEVEL}" == "ERROR" ]]; then
|
||||||
|
local log_title
|
||||||
|
if [ -n "${LOG_TITLE}" ]; then
|
||||||
|
log_title="(${LOG_TITLE})"
|
||||||
|
else
|
||||||
|
log_title=''
|
||||||
|
fi
|
||||||
|
echo -e "${RED}[ERROR]${log_title} ${NO_COLOR}$1"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
detect_node_os()
|
||||||
|
{
|
||||||
|
local pod="$1"
|
||||||
|
|
||||||
|
OS=`kubectl exec -it $pod -- nsenter --mount=/proc/1/ns/mnt -- bash -c 'grep -E "^ID_LIKE=" /etc/os-release | cut -d= -f2'`
|
||||||
|
if [[ -z "${OS}" ]]; then
|
||||||
|
OS=`kubectl exec -it $pod -- nsenter --mount=/proc/1/ns/mnt -- bash -c 'grep -E "^ID=" /etc/os-release | cut -d= -f2'`
|
||||||
|
fi
|
||||||
|
echo "$OS"
|
||||||
|
}
|
||||||
|
|
||||||
|
set_packages_and_check_cmd()
|
||||||
|
{
|
||||||
|
case $OS in
|
||||||
|
*"debian"* | *"ubuntu"* )
|
||||||
|
CHECK_CMD='dpkg -l | grep -w'
|
||||||
|
PACKAGES=(nfs-common open-iscsi)
|
||||||
|
;;
|
||||||
|
*"centos"* | *"fedora"* | *"rocky"* | *"ol"* )
|
||||||
|
CHECK_CMD='rpm -q'
|
||||||
|
PACKAGES=(nfs-utils iscsi-initiator-utils)
|
||||||
|
;;
|
||||||
|
*"suse"* )
|
||||||
|
CHECK_CMD='rpm -q'
|
||||||
|
PACKAGES=(nfs-client open-iscsi)
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
CHECK_CMD=''
|
||||||
|
PACKAGES=()
|
||||||
|
warn "Stop the environment check because '$OS' is not supported in the environment check script."
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
check_dependencies() {
|
||||||
local targets=($@)
|
local targets=($@)
|
||||||
|
|
||||||
local allFound=true
|
local allFound=true
|
||||||
for ((i=0; i<${#targets[@]}; i++)); do
|
for ((i=0; i<${#targets[@]}; i++)); do
|
||||||
local target=${targets[$i]}
|
local target=${targets[$i]}
|
||||||
if [ "$(which $target)" == "" ]; then
|
if [ "$(which $target)" == "" ]; then
|
||||||
allFound=false
|
allFound=false
|
||||||
echo Not found: $target
|
error "Not found: $target"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
if [ "$allFound" == "false" ]; then
|
if [ "$allFound" == "false" ]; then
|
||||||
echo "Please install missing dependencies."
|
error "Please install missing dependencies."
|
||||||
exit 2
|
exit 2
|
||||||
|
else
|
||||||
|
info "Required dependencies are installed."
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -33,9 +138,10 @@ spec:
|
|||||||
labels:
|
labels:
|
||||||
app: longhorn-environment-check
|
app: longhorn-environment-check
|
||||||
spec:
|
spec:
|
||||||
|
hostPID: true
|
||||||
containers:
|
containers:
|
||||||
- name: longhorn-environment-check
|
- name: longhorn-environment-check
|
||||||
image: busybox
|
image: alpine:3.12
|
||||||
args: ["/bin/sh", "-c", "sleep 1000000000"]
|
args: ["/bin/sh", "-c", "sleep 1000000000"]
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: mountpoint
|
- name: mountpoint
|
||||||
@ -48,14 +154,14 @@ spec:
|
|||||||
hostPath:
|
hostPath:
|
||||||
path: /tmp/longhorn-environment-check
|
path: /tmp/longhorn-environment-check
|
||||||
EOF
|
EOF
|
||||||
kubectl create -f $TEMP_DIR/environment_check.yaml
|
kubectl create -f $TEMP_DIR/environment_check.yaml > /dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup() {
|
cleanup() {
|
||||||
echo "cleaning up..."
|
info "Cleaning up longhorn-environment-check pods..."
|
||||||
kubectl delete -f $TEMP_DIR/environment_check.yaml
|
kubectl delete -f $TEMP_DIR/environment_check.yaml > /dev/null
|
||||||
rm -rf $TEMP_DIR
|
rm -rf $TEMP_DIR
|
||||||
echo "clean up complete"
|
info "Cleanup completed."
|
||||||
}
|
}
|
||||||
|
|
||||||
wait_ds_ready() {
|
wait_ds_ready() {
|
||||||
@ -65,16 +171,16 @@ wait_ds_ready() {
|
|||||||
local desiredNumberScheduled=$(echo $ds | jq .status.desiredNumberScheduled)
|
local desiredNumberScheduled=$(echo $ds | jq .status.desiredNumberScheduled)
|
||||||
|
|
||||||
if [ "$desiredNumberScheduled" == "$numberReady" ] && [ "$desiredNumberScheduled" != "0" ]; then
|
if [ "$desiredNumberScheduled" == "$numberReady" ] && [ "$desiredNumberScheduled" != "0" ]; then
|
||||||
echo "all pods ready ($numberReady/$desiredNumberScheduled)"
|
info "All longhorn-environment-check pods are ready ($numberReady/$desiredNumberScheduled)."
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "waiting for pods to become ready ($numberReady/$desiredNumberScheduled)"
|
info "Waiting for longhorn-environment-check pods to become ready ($numberReady/$desiredNumberScheduled)..."
|
||||||
sleep 3
|
sleep 3
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
validate_ds() {
|
check_mount_propagation() {
|
||||||
local allSupported=true
|
local allSupported=true
|
||||||
local pods=$(kubectl -l app=longhorn-environment-check get po -o json)
|
local pods=$(kubectl -l app=longhorn-environment-check get po -o json)
|
||||||
|
|
||||||
@ -88,25 +194,101 @@ validate_ds() {
|
|||||||
|
|
||||||
if [ "$mountPropagation" != "Bidirectional" ]; then
|
if [ "$mountPropagation" != "Bidirectional" ]; then
|
||||||
allSupported=false
|
allSupported=false
|
||||||
echo "node $nodeName: MountPropagation DISABLED"
|
error "node $nodeName: MountPropagation is disabled"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ "$allSupported" != "true" ]; then
|
if [ "$allSupported" != "true" ]; then
|
||||||
echo
|
error "MountPropagation is disabled on at least one node. As a result, CSI driver and Base image cannot be supported."
|
||||||
echo " MountPropagation is disabled on at least one node."
|
|
||||||
echo " As a result, CSI driver and Base image cannot be supported."
|
|
||||||
echo
|
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
echo -e "\n MountPropagation is enabled!\n"
|
info "MountPropagation is enabled."
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies kubectl jq mktemp
|
check_package_installed() {
|
||||||
|
local pods=$(kubectl get pods -o name | grep longhorn-environment-check)
|
||||||
|
|
||||||
|
local allFound=true
|
||||||
|
|
||||||
|
for pod in ${pods}; do
|
||||||
|
OS=`detect_node_os $pod`
|
||||||
|
if [ x"$OS" == x"" ]; then
|
||||||
|
error "Unable to detect OS on node $node."
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
set_packages_and_check_cmd "$OS"
|
||||||
|
|
||||||
|
for ((i=0; i<${#PACKAGES[@]}; i++)); do
|
||||||
|
local package=${PACKAGES[$i]}
|
||||||
|
|
||||||
|
kubectl exec -it $pod -- nsenter --mount=/proc/1/ns/mnt -- timeout 30 bash -c "$CHECK_CMD $package" > /dev/null 2>&1
|
||||||
|
if [ $? != 0 ]; then
|
||||||
|
allFound=false
|
||||||
|
node=`kubectl get ${pod} --no-headers -o=custom-columns=:.spec.nodeName`
|
||||||
|
error "$package is not found in $node."
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ "$allFound" == "false" ]; then
|
||||||
|
error "Please install missing packages."
|
||||||
|
exit 2
|
||||||
|
else
|
||||||
|
info "Required packages are installed."
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
check_multipathd() {
|
||||||
|
local pods=$(kubectl get pods -o name | grep longhorn-environment-check)
|
||||||
|
local allNotFound=true
|
||||||
|
|
||||||
|
for pod in ${pods}; do
|
||||||
|
kubectl exec -t $pod -- nsenter --mount=/proc/1/ns/mnt -- bash -c "systemctl status --no-pager multipathd.service" > /dev/null 2>&1
|
||||||
|
if [ $? = 0 ]; then
|
||||||
|
allNotFound=false
|
||||||
|
node=`kubectl get ${pod} --no-headers -o=custom-columns=:.spec.nodeName`
|
||||||
|
warn "multipathd is running on $node."
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ "$allNotFound" == "false" ]; then
|
||||||
|
warn "multipathd would probably result in the Longhorn volume mount failure. Please refer to https://longhorn.io/kb/troubleshooting-volume-with-multipath for more information."
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
check_iscsid() {
|
||||||
|
local pods=$(kubectl get pods -o name | grep longhorn-environment-check)
|
||||||
|
local allFound=true
|
||||||
|
|
||||||
|
for pod in ${pods}; do
|
||||||
|
kubectl exec -t $pod -- nsenter --mount=/proc/1/ns/mnt -- bash -c "systemctl status --no-pager iscsid.service" > /dev/null 2>&1
|
||||||
|
|
||||||
|
if [ $? != 0 ]; then
|
||||||
|
allFound=false
|
||||||
|
node=`kubectl get ${pod} --no-headers -o=custom-columns=:.spec.nodeName`
|
||||||
|
error "iscsid is not running on $node."
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ "$allFound" == "false" ]; then
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
DEPENDENCIES=(kubectl jq mktemp)
|
||||||
|
check_dependencies ${DEPENDENCIES[@]}
|
||||||
|
|
||||||
TEMP_DIR=$(mktemp -d)
|
TEMP_DIR=$(mktemp -d)
|
||||||
|
|
||||||
trap cleanup EXIT
|
trap cleanup EXIT
|
||||||
create_ds
|
create_ds
|
||||||
wait_ds_ready
|
wait_ds_ready
|
||||||
validate_ds
|
check_package_installed
|
||||||
|
check_iscsid
|
||||||
|
check_multipathd
|
||||||
|
check_mount_propagation
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: longhorn-uninstall
|
- name: longhorn-uninstall
|
||||||
image: longhornio/longhorn-manager:v1.2.4
|
image: longhornio/longhorn-manager:v1.2.5-rc1
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
securityContext:
|
securityContext:
|
||||||
privileged: true
|
privileged: true
|
||||||
|
Loading…
Reference in New Issue
Block a user