23 changed files with 55 additions and 380 deletions
Split View
Diff Options
-
6docs/ha-mode.md
-
2inventory/group_vars/all.yml
-
17roles/etcd/handlers/main.yml
-
16roles/etcd/tasks/configure.yml
-
19roles/etcd/tasks/main.yml
-
7roles/etcd/tasks/refresh_config.yml
-
120roles/etcd/templates/deb-etcd-proxy-docker.initd.j2
-
110roles/etcd/templates/deb-etcd-proxy-host.initd.j2
-
28roles/etcd/templates/etcd-proxy-docker.service.j2
-
19roles/etcd/templates/etcd-proxy-host.service.j2
-
5roles/etcd/templates/etcd-proxy.j2
-
4roles/etcd/templates/etcd.j2
-
11roles/kubernetes-apps/ansible/templates/calico-policy-controller.yml.j2
-
9roles/kubernetes/master/tasks/pre-upgrade.yml
-
1roles/kubernetes/master/templates/manifests/kube-apiserver.manifest.j2
-
1roles/kubernetes/node/templates/cni-calico.conf.j2
-
3roles/kubernetes/preinstall/defaults/main.yml
-
9roles/kubernetes/preinstall/tasks/set_facts.yml
-
35roles/network_plugin/calico/tasks/main.yml
-
4roles/network_plugin/calico/templates/calico-node.service.j2
-
3roles/network_plugin/calico/templates/calicoctl-container.j2
-
4roles/network_plugin/calico/templates/network-environment.j2
-
2roles/network_plugin/flannel/templates/flannel-pod.yml
@ -1,120 +0,0 @@ |
|||
#!/bin/sh |
|||
set -a |
|||
|
|||
### BEGIN INIT INFO |
|||
# Provides: etcd-proxy |
|||
# Required-Start: $local_fs $network $syslog |
|||
# Required-Stop: |
|||
# Default-Start: 2 3 4 5 |
|||
# Default-Stop: 0 1 6 |
|||
# Short-Description: etcd-proxy |
|||
# Description: |
|||
# etcd-proxy is a proxy for etcd: distributed, consistent key-value store for shared configuration and service discovery |
|||
### END INIT INFO |
|||
|
|||
PATH=/sbin:/usr/sbin:/bin/:/usr/bin |
|||
DESC="etcd-proxy" |
|||
NAME=etcd-proxy |
|||
DAEMON={{ docker_bin_dir | default("/usr/bin") }}/docker |
|||
DAEMON_EXEC=`basename $DAEMON` |
|||
DAEMON_ARGS="run --restart=always --env-file=/etc/etcd-proxy.env \ |
|||
--net=host \ |
|||
--stop-signal=SIGKILL \ |
|||
-v /usr/share/ca-certificates/:/etc/ssl/certs:ro \ |
|||
--name={{ etcd_proxy_member_name | default("etcd-proxy") }} \ |
|||
{{ etcd_image_repo }}:{{ etcd_image_tag }} \ |
|||
{% if etcd_after_v3 %} |
|||
{{ etcd_container_bin_dir }}etcd |
|||
{% endif %}" |
|||
|
|||
|
|||
SCRIPTNAME=/etc/init.d/$NAME |
|||
DAEMON_USER=root |
|||
STOP_SCHEDULE="${STOP_SCHEDULE:-QUIT/5/TERM/5/KILL/5}" |
|||
PID=/var/run/etcd-proxy.pid |
|||
|
|||
# Exit if the binary is not present |
|||
[ -x "$DAEMON" ] || exit 0 |
|||
|
|||
# Define LSB log_* functions. |
|||
# Depend on lsb-base (>= 3.2-14) to ensure that this file is present |
|||
# and status_of_proc is working. |
|||
. /lib/lsb/init-functions |
|||
|
|||
do_status() |
|||
{ |
|||
status_of_proc -p $PID "$DAEMON" "$NAME" && exit 0 || exit $? |
|||
} |
|||
|
|||
# Function that starts the daemon/service |
|||
# |
|||
do_start() |
|||
{ |
|||
{{ docker_bin_dir | default("/usr/bin") }}/docker rm -f {{ etcd_proxy_member_name | default("etcd-proxy") }} &>/dev/null || true |
|||
sleep 1 |
|||
start-stop-daemon --background --start --quiet --make-pidfile --pidfile $PID --user $DAEMON_USER --exec $DAEMON -- \ |
|||
$DAEMON_ARGS \ |
|||
|| return 2 |
|||
} |
|||
|
|||
# |
|||
# Function that stops the daemon/service |
|||
# |
|||
do_stop() |
|||
{ |
|||
start-stop-daemon --stop --quiet --retry=$STOP_SCHEDULE --pidfile $PID --name $DAEMON_EXEC |
|||
RETVAL="$?" |
|||
|
|||
sleep 1 |
|||
return "$RETVAL" |
|||
} |
|||
|
|||
|
|||
case "$1" in |
|||
start) |
|||
log_daemon_msg "Starting $DESC" "$NAME" |
|||
do_start |
|||
case "$?" in |
|||
0|1) log_end_msg 0 || exit 0 ;; |
|||
2) log_end_msg 1 || exit 1 ;; |
|||
esac |
|||
;; |
|||
stop) |
|||
log_daemon_msg "Stopping $DESC" "$NAME" |
|||
if do_stop; then |
|||
log_end_msg 0 |
|||
else |
|||
log_failure_msg "Can't stop etcd-proxy" |
|||
log_end_msg 1 |
|||
fi |
|||
;; |
|||
status) |
|||
if do_status; then |
|||
log_end_msg 0 |
|||
else |
|||
log_failure_msg "etcd-proxy is not running" |
|||
log_end_msg 1 |
|||
fi |
|||
;; |
|||
|
|||
restart|force-reload) |
|||
log_daemon_msg "Restarting $DESC" "$NAME" |
|||
if do_stop; then |
|||
if do_start; then |
|||
log_end_msg 0 |
|||
exit 0 |
|||
else |
|||
rc="$?" |
|||
fi |
|||
else |
|||
rc="$?" |
|||
fi |
|||
log_failure_msg "Can't restart etcd-proxy" |
|||
log_end_msg ${rc} |
|||
;; |
|||
*) |
|||
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 |
|||
exit 3 |
|||
;; |
|||
esac |
|||
|
@ -1,110 +0,0 @@ |
|||
#!/bin/sh |
|||
set -a |
|||
|
|||
### BEGIN INIT INFO |
|||
# Provides: etcd-proxy |
|||
# Required-Start: $local_fs $network $syslog |
|||
# Required-Stop: |
|||
# Default-Start: 2 3 4 5 |
|||
# Default-Stop: 0 1 6 |
|||
# Short-Description: etcd-proxy |
|||
# Description: |
|||
# etcd-proxy is a proxy for etcd: distributed, consistent key-value store for shared configuration and service discovery |
|||
### END INIT INFO |
|||
|
|||
PATH=/sbin:/usr/sbin:/bin:/usr/bin |
|||
DESC="etcd-proxy" |
|||
NAME=etcd-proxy |
|||
DAEMON={{ bin_dir }}/etcd |
|||
DAEMON_ARGS="" |
|||
SCRIPTNAME=/etc/init.d/$NAME |
|||
DAEMON_USER=etcd |
|||
STOP_SCHEDULE="${STOP_SCHEDULE:-QUIT/5/TERM/5/KILL/5}" |
|||
PID=/var/run/etcd-proxy.pid |
|||
|
|||
# Exit if the binary is not present |
|||
[ -x "$DAEMON" ] || exit 0 |
|||
|
|||
# Read configuration variable file if it is present |
|||
[ -f /etc/etcd-proxy.env ] && . /etc/etcd-proxy.env |
|||
|
|||
# Define LSB log_* functions. |
|||
# Depend on lsb-base (>= 3.2-14) to ensure that this file is present |
|||
# and status_of_proc is working. |
|||
. /lib/lsb/init-functions |
|||
|
|||
do_status() |
|||
{ |
|||
status_of_proc -p $PID "$DAEMON" "$NAME" && exit 0 || exit $? |
|||
} |
|||
|
|||
# Function that starts the daemon/service |
|||
# |
|||
do_start() |
|||
{ |
|||
start-stop-daemon --background --start --quiet --make-pidfile --pidfile $PID --user $DAEMON_USER --exec $DAEMON -- \ |
|||
$DAEMON_ARGS \ |
|||
|| return 2 |
|||
} |
|||
|
|||
# |
|||
# Function that stops the daemon/service |
|||
# |
|||
do_stop() |
|||
{ |
|||
start-stop-daemon --stop --quiet --retry=$STOP_SCHEDULE --pidfile $PID --name $NAME |
|||
RETVAL="$?" |
|||
|
|||
sleep 1 |
|||
return "$RETVAL" |
|||
} |
|||
|
|||
|
|||
case "$1" in |
|||
start) |
|||
log_daemon_msg "Starting $DESC" "$NAME" |
|||
do_start |
|||
case "$?" in |
|||
0|1) log_end_msg 0 || exit 0 ;; |
|||
2) log_end_msg 1 || exit 1 ;; |
|||
esac |
|||
;; |
|||
stop) |
|||
log_daemon_msg "Stopping $DESC" "$NAME" |
|||
if do_stop; then |
|||
log_end_msg 0 |
|||
else |
|||
log_failure_msg "Can't stop etcd-proxy" |
|||
log_end_msg 1 |
|||
fi |
|||
;; |
|||
status) |
|||
if do_status; then |
|||
log_end_msg 0 |
|||
else |
|||
log_failure_msg "etcd-proxy is not running" |
|||
log_end_msg 1 |
|||
fi |
|||
;; |
|||
|
|||
restart|force-reload) |
|||
log_daemon_msg "Restarting $DESC" "$NAME" |
|||
if do_stop; then |
|||
if do_start; then |
|||
log_end_msg 0 |
|||
exit 0 |
|||
else |
|||
rc="$?" |
|||
fi |
|||
else |
|||
rc="$?" |
|||
fi |
|||
log_failure_msg "Can't restart etcd-proxy" |
|||
log_end_msg ${rc} |
|||
;; |
|||
*) |
|||
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 |
|||
exit 3 |
|||
;; |
|||
esac |
|||
|
@ -1,28 +0,0 @@ |
|||
[Unit] |
|||
Description=etcd-proxy docker wrapper |
|||
Wants=docker.socket |
|||
After=docker.service |
|||
|
|||
[Service] |
|||
User=root |
|||
PermissionsStartOnly=true |
|||
ExecStart={{ docker_bin_dir | default("/usr/bin") }}/docker run --restart=always \ |
|||
--env-file=/etc/etcd-proxy.env \ |
|||
{# TODO(mattymo): Allow docker IP binding and disable in envfile |
|||
-p 2380:2380 -p 2379:2379 #} |
|||
--net=host \ |
|||
--stop-signal=SIGKILL \ |
|||
-v /usr/share/ca-certificates/:/etc/ssl/certs:ro \ |
|||
--name={{ etcd_proxy_member_name | default("etcd-proxy") }} \ |
|||
{{ etcd_image_repo }}:{{ etcd_image_tag }} \ |
|||
{% if etcd_after_v3 %} |
|||
{{ etcd_container_bin_dir }}etcd |
|||
{% endif %} |
|||
ExecStartPre=-{{ docker_bin_dir | default("/usr/bin") }}/docker rm -f {{ etcd_proxy_member_name | default("etcd-proxy") }} |
|||
ExecReload={{ docker_bin_dir | default("/usr/bin") }}/docker restart {{ etcd_proxy_member_name | default("etcd-proxy") }} |
|||
ExecStop={{ docker_bin_dir | default("/usr/bin") }}/docker stop {{ etcd_proxy_member_name | default("etcd-proxy") }} |
|||
Restart=always |
|||
RestartSec=15s |
|||
|
|||
[Install] |
|||
WantedBy=multi-user.target |
@ -1,19 +0,0 @@ |
|||
[Unit] |
|||
Description=etcd-proxy |
|||
After=network.target |
|||
|
|||
[Service] |
|||
Type=notify |
|||
User=etcd |
|||
PermissionsStartOnly=true |
|||
EnvironmentFile=/etc/etcd-proxy.env |
|||
ExecStart={{ bin_dir }}/etcd |
|||
ExecStartPre=/bin/mkdir -p /var/lib/etcd-proxy |
|||
ExecStartPre=/bin/chown -R etcd: /var/lib/etcd-proxy |
|||
NotifyAccess=all |
|||
Restart=always |
|||
RestartSec=10s |
|||
LimitNOFILE=40000 |
|||
|
|||
[Install] |
|||
WantedBy=multi-user.target |
@ -1,5 +0,0 @@ |
|||
ETCD_DATA_DIR=/var/lib/etcd-proxy |
|||
ETCD_PROXY=on |
|||
ETCD_LISTEN_CLIENT_URLS={{ etcd_access_endpoint }} |
|||
ETCD_NAME={{ etcd_proxy_member_name | default("etcd-proxy") }} |
|||
ETCD_INITIAL_CLUSTER={{ etcd_peer_addresses }} |
Write
Preview
Loading…
Cancel
Save