Skip to content

Commit

Permalink
Showing 4 changed files with 47 additions and 11 deletions.
14 changes: 7 additions & 7 deletions deploy/longhorn.yaml
Original file line number Diff line number Diff line change
@@ -241,7 +241,7 @@ spec:
spec:
containers:
- name: longhorn-manager
image: longhornio/longhorn-manager:v0.8.1-rc2
image: longhornio/longhorn-manager:master
imagePullPolicy: Always
securityContext:
privileged: true
@@ -250,11 +250,11 @@ spec:
- -d
- daemon
- --engine-image
- longhornio/longhorn-engine:v0.8.1-rc2
- longhornio/longhorn-engine:master
- --instance-manager-image
- longhornio/longhorn-instance-manager:v1_20200301
- --manager-image
- longhornio/longhorn-manager:v0.8.1-rc2
- longhornio/longhorn-manager:master
- --service-account
- longhorn-service-account
ports:
@@ -350,7 +350,7 @@ spec:
spec:
containers:
- name: longhorn-ui
image: longhornio/longhorn-ui:v0.8.1-rc2
image: longhornio/longhorn-ui:master
ports:
- containerPort: 8000
name: http
@@ -394,18 +394,18 @@ spec:
spec:
initContainers:
- name: wait-longhorn-manager
image: longhornio/longhorn-manager:v0.8.1-rc2
image: longhornio/longhorn-manager:master
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:
- name: longhorn-driver-deployer
image: longhornio/longhorn-manager:v0.8.1-rc2
image: longhornio/longhorn-manager:master
imagePullPolicy: Always
command:
- longhorn-manager
- -d
- deploy-driver
- --manager-image
- longhornio/longhorn-manager:v0.8.1-rc2
- longhornio/longhorn-manager:master
- --manager-url
- http://longhorn-backend:9500/v1
env:
7 changes: 4 additions & 3 deletions scripts/lhexec
Original file line number Diff line number Diff line change
@@ -41,12 +41,13 @@ exec_command() {

INSTANCE_MANAGER_NAME_FILTER="{.items[?(@.spec.volumeName==\"${VOLUME_NAME}\")].status.instanceManagerName}"
INSTANCE_MANAGER_NAME=`kubectl -n ${NS} get lhe --output=jsonpath="${INSTANCE_MANAGER_NAME_FILTER}"`

ENGINE_PORT_FILTER="{.items[?(@.spec.volumeName==\"${VOLUME_NAME}\")].status.port}"
ENGINE_PORT=`kubectl -n ${NS} get lhe --output=jsonpath="${ENGINE_PORT_FILTER}"`

kubectl -n ${NS} exec -it ${INSTANCE_MANAGER_NAME} -- bash -c "longhorn --url localhost:${ENGINE_PORT} ${COMMAND_ARGS}"

LONGHORN_BIN_PATH=`kubectl -n ${NS} exec -it ${INSTANCE_MANAGER_NAME} -- bash -c "ps -eo command | grep \" ${VOLUME_NAME} \" | grep -v grep | awk '{ printf(\"%s\", \\$1)}'"`

kubectl -n ${NS} exec -it ${INSTANCE_MANAGER_NAME} -- bash -c "${LONGHORN_BIN_PATH} --url localhost:${ENGINE_PORT} ${COMMAND_ARGS}"
}


35 changes: 35 additions & 0 deletions scripts/migrate-for-pre-070-volumes.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env bash

NS="longhorn-system"

print_usage() {
echo "Usage: ${0} [ |-h|--help] [volume_name|--all]"
echo ""
echo "Examples:"
echo " ${0} test-vol"
echo " ${0} --all"
echo ""
echo "Note: Must have Longhorn installed in "longhorn-system" namespace"
echo ""
exit 0
}

exec_command() {
COMMAND_ARG="${@}"
LONGHORN_MANAGER=$(kubectl -n ${NS} get po -l "app=longhorn-manager" | tr '\000' '\n' | sed -n '2p' | awk '{print $1}')
kubectl -n ${NS} exec -it ${LONGHORN_MANAGER} -- bash -c "longhorn-manager migrate-for-pre-070-volumes ${COMMAND_ARG}"
}


ARG=$1
case $ARG in
"" | "-h" | "--help")
print_usage
;;
*)
if [[ $# -ne 1 ]]; then
echo "Command args number shouldn't be greater than 1"
fi
exec_command ${@}
;;
esac
2 changes: 1 addition & 1 deletion uninstall/uninstall.yaml
Original file line number Diff line number Diff line change
@@ -58,7 +58,7 @@ spec:
spec:
containers:
- name: longhorn-uninstall
image: longhornio/longhorn-manager:v0.8.1-rc2
image: longhornio/longhorn-manager:master
imagePullPolicy: Always
command:
- longhorn-manager

0 comments on commit 85ab7c8

Please sign in to comment.