Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
cda55a78
Commit
cda55a78
authored
Oct 31, 2016
by
Kubernetes Submit Queue
Committed by
GitHub
Oct 31, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #35783 from wojtek-t/support_rollback
Automatic merge from submit-queue Better logging and support for running non-default version from etcd image Ref #20504
parents
10649270
62299921
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
3 deletions
+10
-3
migrate-if-needed.sh
cluster/images/etcd/migrate-if-needed.sh
+8
-2
etcd.manifest
cluster/saltbase/salt/etcd/etcd.manifest
+1
-1
test-update-storage-objects.sh
hack/test-update-storage-objects.sh
+1
-0
No files found.
cluster/images/etcd/migrate-if-needed.sh
View file @
cda55a78
...
...
@@ -57,6 +57,12 @@ if [ "${TARGET_STORAGE}" != "etcd2" -a "${TARGET_STORAGE}" != "etcd3" ]; then
exit
1
fi
# Correctly support upgrade and rollback to non-default version.
if
[
"
${
DO_NOT_MOVE_BINARIES
:-}
"
!=
"true"
]
;
then
cp
"/usr/local/bin/etcd-
${
TARGET_VERSION
}
"
"/usr/local/bin/etcd"
cp
"/usr/local/bin/etcdctl-
${
TARGET_VERSION
}
"
"/usr/local/bin/etcdctl"
fi
# NOTE: SUPPORTED_VERSION has to match release binaries present in the
# etcd image (to make this script work correctly).
# We cannot use array since sh doesn't support it.
...
...
@@ -156,9 +162,9 @@ for step in ${SUPPORTED_VERSIONS}; do
fi
# Kill etcd and wait until this is down.
stop_etcd
CURRENT_VERSION
=
${
step
}
echo
"
${
CURRENT_VERSION
}
/
${
CURRENT_STORAGE
}
"
>
"
${
DATA_DIRECTORY
}
/
${
VERSION_FILE
}
"
fi
CURRENT_VERSION
=
${
step
}
echo
"
${
CURRENT_VERSION
}
/
${
CURRENT_STORAGE
}
"
>
"
${
DATA_DIRECTORY
}
/
${
VERSION_FILE
}
"
if
[
"
$(
echo
${
CURRENT_VERSION
}
|
cut
-c1-2
)
"
=
"3."
-a
"
${
CURRENT_STORAGE
}
"
=
"etcd2"
-a
"
${
TARGET_STORAGE
}
"
=
"etcd3"
]
;
then
# If it is the first 3.x release in the list and we are migrating
# also from 'etcd2' to 'etcd3', do the migration now.
...
...
cluster/saltbase/salt/etcd/etcd.manifest
View file @
cda55a78
...
...
@@ -37,7 +37,7 @@
"command": [
"/bin/sh",
"-c",
"if [ -e /usr/local/bin/migrate-if-needed.sh ]; then /usr/local/bin/migrate-if-needed.sh; fi; /usr/local/bin/etcd --name etcd-{{ hostname }} --listen-peer-urls http://{{ hostname }}:{{ server_port }} --initial-advertise-peer-urls http://{{ hostname }}:{{ server_port }} --advertise-client-urls http://127.0.0.1:{{ port }} --listen-client-urls http://127.0.0.1:{{ port }} --data-dir /var/etcd/data{{ suffix }} --initial-cluster-state {{ cluster_state }} --initial-cluster {{ etcd_cluster }} 1>>/var/log/etcd{{ suffix }}.log 2>&1"
"if [ -e /usr/local/bin/migrate-if-needed.sh ]; then /usr/local/bin/migrate-if-needed.sh
1>>/var/log/etcd{{ suffix }}.log 2>&1
; fi; /usr/local/bin/etcd --name etcd-{{ hostname }} --listen-peer-urls http://{{ hostname }}:{{ server_port }} --initial-advertise-peer-urls http://{{ hostname }}:{{ server_port }} --advertise-client-urls http://127.0.0.1:{{ port }} --listen-client-urls http://127.0.0.1:{{ port }} --data-dir /var/etcd/data{{ suffix }} --initial-cluster-state {{ cluster_state }} --initial-cluster {{ etcd_cluster }} 1>>/var/log/etcd{{ suffix }}.log 2>&1"
],
"env": [
{ "name": "TARGET_STORAGE",
...
...
hack/test-update-storage-objects.sh
View file @
cda55a78
...
...
@@ -165,6 +165,7 @@ TARGET_STORAGE="etcd3" \
ETCD
=
$(
which etcd
)
\
ETCDCTL
=
$(
which etcdctl
)
\
ATTACHLEASE
=
"
${
KUBE_OUTPUT_HOSTBIN
}
/attachlease"
\
DO_NOT_MOVE_BINARIES
=
"true"
\
${
KUBE_ROOT
}
/cluster/images/etcd/migrate-if-needed.sh
kube::etcd::start
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment