-
Notifications
You must be signed in to change notification settings - Fork 40k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4442 from ArtfulCoder/docker_etcd
Running etcd 2.0.5 in a pod on master
- Loading branch information
Showing
8 changed files
with
84 additions
and
283 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{% set ipv4_addr = salt['grains.get']('fqdn_ip4')[0] -%} | ||
|
||
{ | ||
"apiVersion": "v1beta3", | ||
"kind": "Pod", | ||
"metadata": {"name":"etcd-server"}, | ||
"spec":{ | ||
"hostNetwork": true, | ||
"containers":[ | ||
{ | ||
"name": "etcd-container", | ||
"image": "kubernetes/etcd:2.0.5.1", | ||
"command": [ | ||
"/usr/local/bin/etcd", | ||
"--addr", | ||
"{{ipv4_addr}}:4001", | ||
"--bind-addr", | ||
"0.0.0.0:4001", | ||
"--data-dir", | ||
"/var/etcd/data", | ||
"--initial-advertise-peer-urls", | ||
"http://kubernetes-master:2380", | ||
"--name", | ||
"kubernetes-master", | ||
"--initial-cluster", | ||
"kubernetes-master=http://kubernetes-master:2380", | ||
">> /var/log/etcd.log" | ||
], | ||
"ports":[ | ||
{ "name": "serverport", | ||
"containerPort": 2380, | ||
"hostPort": 2380},{ | ||
"name": "clientport", | ||
"containerPort": 4001, | ||
"hostPort": 4001} | ||
], | ||
"volumeMounts": [ | ||
{ "name": "varetcd", | ||
"mountPath": "/var/etcd", | ||
"readOnly": false}, | ||
{ "name": "logetcd", | ||
"mountPath": "/var/log/etcd.log", | ||
"readOnly": false} | ||
] | ||
} ], | ||
"volumes":[ | ||
{ "name": "varetcd", | ||
"hostPath": { | ||
"path": "/mnt/master-pd/var/etcd"} | ||
}, | ||
{ "name": "logetcd", | ||
"hostPath": { | ||
"path": "/var/log/etcd.log"}}] | ||
}} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,140 +1,49 @@ | ||
# We are caching the etcd tar file in GCS for reliability and speed. To | ||
# update this to a new version, do the following: | ||
# 2. Download tar file: | ||
# curl -LO https://github.com/coreos/etcd/releases/download/<ver>/etcd-<ver>-linux-amd64.tar.gz | ||
# 3. Upload to GCS (the cache control makes : | ||
# gsutil cp <tar> gs://kubernetes-release/etcd/<tar> | ||
# 4. Make it world readable: | ||
# gsutil -m acl ch -R -g all:R gs://kubernetes-release/etcd/ | ||
# 5. Get a hash of the tar: | ||
# shasum <tar> | ||
# 6. Update this file with new tar version and new hash | ||
delete_etc_etcd_dir: | ||
file.absent: | ||
- name: /etc/etcd | ||
|
||
{% set etcd_version="v2.0.5" %} | ||
{% set etcd_tar_url="https://storage.googleapis.com/kubernetes-release/etcd/etcd-%s-linux-amd64.tar.gz" | ||
| format(etcd_version) %} | ||
{% set etcd_tar_hash="sha1=34b185efa954327d6cdfe6be5b1eb5fcfb7c478c" %} | ||
delete_etcd_conf: | ||
file.absent: | ||
- name: /etc/etcd/etcd.conf | ||
|
||
etcd-tar: | ||
archive: | ||
- extracted | ||
- user: root | ||
- name: /usr/local/src | ||
- source: {{ etcd_tar_url }} | ||
- source_hash: {{ etcd_tar_hash }} | ||
- archive_format: tar | ||
- if_missing: /usr/local/src/etcd-{{ etcd_version }}-linux-amd64 | ||
{% if grains['saltversioninfo'] <= (2014, 7, 0, 0) %} | ||
- tar_options: xz | ||
{% endif %} | ||
touch /var/log/etcd.log: | ||
cmd.run: | ||
- creates: /var/log/etcd.log | ||
|
||
/var/etcd: | ||
file.directory: | ||
- name: /usr/local/src/etcd-{{ etcd_version }}-linux-amd64 | ||
- user: root | ||
- group: root | ||
- watch: | ||
- archive: etcd-tar | ||
- dir_mode: 700 | ||
- recurse: | ||
- user | ||
- group | ||
- mode | ||
|
||
etcd-symlink: | ||
file.symlink: | ||
- name: /usr/local/bin/etcd | ||
- target: /usr/local/src/etcd-{{ etcd_version }}-linux-amd64/etcd | ||
- force: true | ||
- watch: | ||
- archive: etcd-tar | ||
|
||
etcdctl-symlink: | ||
file.symlink: | ||
- name: /usr/local/bin/etcdctl | ||
- target: /usr/local/src/etcd-{{ etcd_version }}-linux-amd64/etcdctl | ||
- force: true | ||
- watch: | ||
- archive: etcd-tar | ||
|
||
etcd: | ||
group.present: | ||
- system: True | ||
user.present: | ||
- system: True | ||
- gid_from_name: True | ||
- shell: /sbin/nologin | ||
- home: /var/etcd | ||
|
||
/etc/etcd: | ||
file.directory: | ||
- user: root | ||
- group: root | ||
- dir_mode: 755 | ||
|
||
/etc/etcd/etcd.conf: | ||
file.managed: | ||
- source: salt://etcd/etcd.conf | ||
- user: root | ||
- group: root | ||
- mode: 644 | ||
|
||
/var/etcd: | ||
file.directory: | ||
- user: etcd | ||
- group: etcd | ||
- dir_mode: 700 | ||
- require: | ||
- user: etcd | ||
- group: etcd | ||
delete_etcd_default: | ||
file.absent: | ||
- name: /etc/default/etcd | ||
|
||
/var/etcd/data: | ||
file.directory: | ||
- user: etcd | ||
- group: etcd | ||
- dir_mode: 700 | ||
- require: | ||
- user: etcd | ||
- group: etcd | ||
delete_etcd_service_file: | ||
file.absent: | ||
- name: /usr/lib/systemd/system/etcd.service | ||
|
||
{% if grains['os_family'] == 'RedHat' %} | ||
delete_etcd_initd: | ||
file.absent: | ||
- name: /etc/init.d/etcd | ||
|
||
/etc/default/etcd: | ||
/etc/kubernetes/manifests/etcd.manifest: | ||
file.managed: | ||
- source: salt://etcd/default | ||
- source: salt://etcd/etcd.manifest | ||
- template: jinja | ||
- user: root | ||
- group: root | ||
- mode: 644 | ||
- makedirs: true | ||
- dir_mode: 755 | ||
|
||
/usr/lib/systemd/system/etcd.service: | ||
file.managed: | ||
- source: salt://etcd/etcd.service | ||
- user: root | ||
- group: root | ||
|
||
{% else %} | ||
|
||
/etc/init.d/etcd: | ||
file.managed: | ||
- source: salt://etcd/initd | ||
- user: root | ||
- group: root | ||
- mode: 755 | ||
|
||
{% endif %} | ||
|
||
etcd-service: | ||
service.running: | ||
#stop legacy etcd_service | ||
stop_etcd-service: | ||
service.dead: | ||
- name: etcd | ||
- enable: True | ||
- watch: | ||
- file: /etc/etcd/etcd.conf | ||
{% if grains['os_family'] == 'RedHat' %} | ||
- file: /usr/lib/systemd/system/etcd.service | ||
- file: /etc/default/etcd | ||
{% endif %} | ||
- file: etcd-tar | ||
- file: etcd-symlink | ||
- require: | ||
- file: /var/etcd | ||
- file: /var/etcd/data | ||
- user: etcd | ||
- group: etcd | ||
|
||
- enable: None |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters