Skip to content

Commit

Permalink
Merge remote-tracking branch 'kubernetes-incubator/master'
Browse files Browse the repository at this point in the history
* kubernetes-incubator/master:
  Removed unused sysctl override
  Fix node drain error when trying to evict pods from jobs
  Use docker instead of rkt for regular etcdadm tasks (kubernetes-retired#4)
  • Loading branch information
camilb committed Jun 22, 2017
2 parents abba2d6 + 2348073 commit 4b897ee
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 68 deletions.
21 changes: 5 additions & 16 deletions core/controlplane/config/templates/cloud-config-controller
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,6 @@ coreos:
ExecStartPre=/opt/bin/cfn-etcd-environment
ExecStart=/usr/bin/mv -f /var/run/coreos/etcd-environment /etc/etcd-environment

{{if .UseCalico }}
# https://github.com/coreos/docs/blob/5d7b1cccb8286185275b07db1495828be9fdb0ea/os/other-settings.md#tuning-sysctl-parameters
- name: systemd-modules-load.service
command: restart
- name: systemd-sysctl.service
command: restart
{{ end }}

{{if .Experimental.AwsEnvironment.Enabled}}
- name: set-aws-environment.service
enable: true
Expand Down Expand Up @@ -1164,6 +1156,11 @@ write_files:
- replicasets
verbs:
- get
- apiGroups: ["batch"]
resources:
- jobs
verbs:
- get
- apiGroups: [""]
resources:
- replicationcontrollers
Expand Down Expand Up @@ -2158,14 +2155,6 @@ write_files:
}
}

# http://docs.projectcalico.org/v2.0/usage/configuration/
- path: /etc/modules-load.d/nf.conf
content: |
nf_conntrack
- path: /etc/sysctl.d/nf.conf
content: |
net.netfilter.nf_conntrack_max=1000000

{{ end }}

{{if .Experimental.Authentication.Webhook.Enabled}}
Expand Down
17 changes: 0 additions & 17 deletions core/controlplane/config/templates/cloud-config-worker
Original file line number Diff line number Diff line change
Expand Up @@ -249,14 +249,6 @@ coreos:
RequiredBy=rkt-api.service
{{ end }}

{{if .UseCalico }}
# https://github.com/coreos/docs/blob/5d7b1cccb8286185275b07db1495828be9fdb0ea/os/other-settings.md#tuning-sysctl-parameters
- name: systemd-modules-load.service
command: restart
- name: systemd-sysctl.service
command: restart
{{ end }}

{{if .AwsEnvironment.Enabled}}
- name: set-aws-environment.service
enable: true
Expand Down Expand Up @@ -853,15 +845,6 @@ write_files:
}
}
}

# http://docs.projectcalico.org/v2.0/usage/configuration/
- path: /etc/modules-load.d/nf.conf
content: |
nf_conntrack
- path: /etc/sysctl.d/nf.conf
content: |
net.netfilter.nf_conntrack_max=1000000

{{ end }}

{{ if and .Experimental.TLSBootstrap.Enabled .AssetsConfig.HasTLSBootstrapToken }}
Expand Down
56 changes: 21 additions & 35 deletions etcdadm/etcdadm
Original file line number Diff line number Diff line change
Expand Up @@ -493,29 +493,21 @@ member_restore_from_local_snapshot() {
rm -rf "$restored_dir"
fi

_run_as_root rkt run \
--insecure-options=image \
--set-env ETCDCTL_API=3 \
--dns=host \
--net=host \
--volume $(member_snapshots_dir_name),kind=host,source="$(member_host_snapshots_dir_path)" \
--mount volume="$(member_snapshots_dir_name)",target=/"$(member_snapshots_dir_name)" \
--volume data-dir-root,kind=host,source="$(dirname "$restored_dir")" \
--mount volume=data-dir-root,target="$(dirname "$restored_dir")" \
--volume data-dir,kind=empty \
--mount volume=data-dir,target=/var/lib/etcd \
--uuid-file-save="$uuid_file" \
"$etcd_aci_url" \
--exec etcdctl -- \
_run_as_root docker run --rm \
-e ETCDCTL_API=3 \
--network=host \
--volume="$(member_host_snapshots_dir_path)":/"$(member_snapshots_dir_name)" \
--volume="$(dirname "$restored_dir")":"$(dirname "$restored_dir")" \
--volume=/var/lib/etcd \
quay.io/coreos/etcd:v$etcd_version \
etcdctl \
--write-out simple \
--endpoints "$(member_client_url)" snapshot restore \
--data-dir "$restored_dir" \
--initial-cluster "$(config_etcd_initial_cluster)" \
--initial-advertise-peer-urls "$(member_peer_url)" \
--name "$(member_name)" \
"$snapshot_name"
_run_as_root rkt stop --force --uuid-file "$uuid_file" || echo pod is already stopped
_run_as_root rkt rm --uuid-file "$uuid_file"

_run_as_root mv "$restored_dir"/* "$data_dir"/
_run_as_root rm -rf "$restored_dir"
Expand Down Expand Up @@ -784,33 +776,27 @@ member_data_dir() {

member_etcdctl() {
local uuid_file
local rkt_opts=(--insecure-options=image)
local docker_opts=(--rm)

uuid_file="$(config_state_dir)/etcdctl-$BASHPID.uuid"

if [ "${ETCDCTL_CACERT:-}" != "" -a "${ETCDCTL_CERT:-}" != "" -a "${ETCDCTL_KEY:-}" != "" ]; then
local credentials
credentials=$(dirname "${ETCDCTL_CACERT}")
rkt_opts+=(--set-env ETCDCTL_CACERT=${ETCDCTL_CACERT})
rkt_opts+=(--set-env ETCDCTL_CERT=${ETCDCTL_CERT})
rkt_opts+=(--set-env ETCDCTL_KEY=${ETCDCTL_KEY})
rkt_opts+=(--volume credentials,kind=host,source=${credentials})
rkt_opts+=(--mount volume=credentials,target=${credentials})
docker_opts+=(-e ETCDCTL_CACERT=${ETCDCTL_CACERT})
docker_opts+=(-e ETCDCTL_CERT=${ETCDCTL_CERT})
docker_opts+=(-e ETCDCTL_KEY=${ETCDCTL_KEY})
docker_opts+=(--volume=${credentials}:${credentials})
fi

_run_as_root rkt run ${rkt_opts[*]} \
--set-env ETCDCTL_API=3 \
--dns=host \
--net=host \
--volume "$(member_snapshots_dir_name)",kind=host,source="$(member_host_snapshots_dir_path)" \
--mount volume="$(member_snapshots_dir_name)",target=/"$(member_snapshots_dir_name)" \
--volume data-dir,kind=host,source="$(member_data_dir)" \
--mount volume=data-dir,target=/var/lib/etcd \
--uuid-file-save="$uuid_file" \
"$etcd_aci_url" \
--exec etcdctl -- --endpoints "$(member_client_url)" ${*}
_run_as_root rkt rm --uuid-file "$uuid_file"
rm "$uuid_file"
_run_as_root docker run ${docker_opts[*]} \
--env ETCDCTL_API=3 \
--network=host \
--volume="$(member_host_snapshots_dir_path)":/"$(member_snapshots_dir_name)" \
--volume="$(member_data_dir)":/var/lib/etcd \
--volume "$(member_snapshots_dir_name)":"$(member_host_snapshots_dir_path)" \
quay.io/coreos/etcd:v$etcd_version \
etcdctl --endpoints "$(member_client_url)" ${*}
}

member_is_healthy() {
Expand Down

0 comments on commit 4b897ee

Please sign in to comment.