Fix install etcd by host service (#2297)

Fix bug issues #2289
This commit is contained in:
RongZhang 2018-02-12 10:34:01 -06:00 committed by Matthew Mosesohn
parent 5903aea86f
commit c0aad0a6d5
5 changed files with 23 additions and 11 deletions

View file

@ -12,15 +12,6 @@
ETCDCTL_CERT_FILE: "{{ etcd_cert_dir }}/node-{{ inventory_hostname }}.pem"
ETCDCTL_KEY_FILE: "{{ etcd_cert_dir }}/node-{{ inventory_hostname }}-key.pem"
- name: Install etcd launch script
template:
src: etcd.j2
dest: "{{ bin_dir }}/etcd"
owner: 'root'
mode: 0755
backup: yes
notify: restart etcd
- name: Configure | Copy etcd.service systemd file
template:
src: "etcd-{{ etcd_deployment_type }}.service.j2"

View file

@ -4,9 +4,17 @@
{{ docker_bin_dir }}/docker create --name etcdctl-binarycopy {{ etcd_image_repo }}:{{ etcd_image_tag }} &&
{{ docker_bin_dir }}/docker cp etcdctl-binarycopy:/usr/local/bin/etcdctl {{ bin_dir }}/etcdctl &&
{{ docker_bin_dir }}/docker rm -f etcdctl-binarycopy"
when: etcd_deployment_type == "docker"
register: etcd_task_result
until: etcd_task_result.rc == 0
retries: 4
delay: "{{ retry_stagger | random + 3 }}"
changed_when: false
- name: Install etcd launch script
template:
src: etcd.j2
dest: "{{ bin_dir }}/etcd"
owner: 'root'
mode: 0755
backup: yes
notify: restart etcd

View file

@ -0,0 +1,12 @@
---
- name: Install | Copy etcdctl and etcd binary from docker container
command: sh -c "{{ docker_bin_dir }}/docker rm -f etcdctl-binarycopy;
{{ docker_bin_dir }}/docker create --name etcdctl-binarycopy {{ etcd_image_repo }}:{{ etcd_image_tag }} &&
{{ docker_bin_dir }}/docker cp etcdctl-binarycopy:/usr/local/bin/etcdctl {{ bin_dir }}/etcdctl &&
{{ docker_bin_dir }}/docker cp etcdctl-binarycopy:/usr/local/bin/etcd {{ bin_dir }}/etcd &&
{{ docker_bin_dir }}/docker rm -f etcdctl-binarycopy"
register: etcd_task_result
until: etcd_task_result.rc == 0
retries: 4
delay: "{{ retry_stagger | random + 3 }}"
changed_when: false

View file

@ -4,7 +4,7 @@ After=network.target
[Service]
Type=notify
User=etcd
User=root
EnvironmentFile=/etc/etcd.env
ExecStart={{ bin_dir }}/etcd
NotifyAccess=all

View file

@ -10,6 +10,7 @@ helm_enabled: true
istio_enabled: true
efk_enabled: true
local_volume_provisioner_enabled: true
etcd_deployment_type: host
deploy_netchecker: true
kubedns_min_replicas: 1
cloud_provider: gce