Add a second etcd instance for use with events.

pull/6/head
Brendan Burns 2015-09-29 12:43:18 -07:00
parent 26c51881ca
commit a4581c7cd5
2 changed files with 33 additions and 9 deletions

View File

@ -2,7 +2,7 @@
"apiVersion": "v1",
"kind": "Pod",
"metadata": {
"name":"etcd-server",
"name":"etcd-server{{ suffix }}",
"namespace": "kube-system"
},
"spec":{
@ -19,12 +19,12 @@
"command": [
"/bin/sh",
"-c",
"/usr/local/bin/etcd --addr 127.0.0.1:4001 --bind-addr 127.0.0.1:4001 --data-dir /var/etcd/data 1>>/var/log/etcd.log 2>&1"
"/usr/local/bin/etcd --listen-peer-urls=http://127.0.0.1:{{ server_port }} --addr 127.0.0.1:{{ port }} --bind-addr 127.0.0.1:{{ port }} --data-dir /var/etcd/data{{ suffix }} 1>>/var/log/etcd{{ suffix }}.log 2>&1"
],
"livenessProbe": {
"httpGet": {
"host": "127.0.0.1",
"port": 4001,
"port": {{ port }},
"path": "/health"
},
"initialDelaySeconds": 15,
@ -32,11 +32,13 @@
},
"ports":[
{ "name": "serverport",
"containerPort": 2380,
"hostPort": 2380},{
"containerPort": {{ server_port }},
"hostPort": {{ server_port }}
},{
"name": "clientport",
"containerPort": 4001,
"hostPort": 4001}
"containerPort": {{ port }},
"hostPort": {{ port }}
}
],
"volumeMounts": [
{"name": "varetcd",
@ -44,7 +46,7 @@
"readOnly": false
},
{"name": "varlogetcd",
"mountPath": "/var/log/etcd.log",
"mountPath": "/var/log/etcd{{ suffix }}.log",
"readOnly": false
}
]
@ -57,7 +59,7 @@
},
{ "name": "varlogetcd",
"hostPath": {
"path": "/var/log/etcd.log"}
"path": "/var/log/etcd{{ suffix }}.log"}
}
]
}}

View File

@ -38,6 +38,10 @@ touch /var/log/etcd.log:
cmd.run:
- creates: /var/log/etcd.log
touch /var/log/etcd-events.log:
cmd.run:
- creates: /var/log/etcd-events.log
/var/etcd:
file.directory:
- user: root
@ -57,3 +61,21 @@ touch /var/log/etcd.log:
- mode: 644
- makedirs: true
- dir_mode: 755
- context:
suffix: ""
port: 4001
server_port: 2380
/etc/kubernetes/manifests/etcd-events.manifest:
file.managed:
- source: salt://etcd/etcd.manifest
- template: jinja
- user: root
- group: root
- mode: 644
- makedirs: true
- dir_mode: 755
- context:
suffix: "-events"
port: 4002
server_port: 2381