2018-03-06 22:33:18 +00:00
|
|
|
{
|
|
|
|
"apiVersion": "v1",
|
|
|
|
"kind": "Pod",
|
|
|
|
"metadata": {
|
|
|
|
"name":"etcd-server{{ suffix }}",
|
|
|
|
"namespace": "kube-system",
|
|
|
|
"annotations": {
|
2018-07-18 14:47:22 +00:00
|
|
|
"scheduler.alpha.kubernetes.io/critical-pod": "",
|
|
|
|
"seccomp.security.alpha.kubernetes.io/pod": "docker/default"
|
2018-03-06 22:33:18 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"spec":{
|
|
|
|
"hostNetwork": true,
|
|
|
|
"containers":[
|
|
|
|
{
|
|
|
|
"name": "etcd-container",
|
2018-11-26 18:23:56 +00:00
|
|
|
"image": "{{ pillar.get('etcd_docker_repository', 'k8s.gcr.io/etcd') }}:{{ pillar.get('etcd_docker_tag', '3.2.24-1') }}",
|
2018-03-06 22:33:18 +00:00
|
|
|
"resources": {
|
|
|
|
"requests": {
|
|
|
|
"cpu": {{ cpulimit }}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"command": [
|
|
|
|
"/bin/sh",
|
|
|
|
"-c",
|
2018-07-18 14:47:22 +00:00
|
|
|
"if [ -e /usr/local/bin/migrate-if-needed.sh ]; then /usr/local/bin/migrate-if-needed.sh 1>>/var/log/etcd{{ suffix }}.log 2>&1; fi; exec /usr/local/bin/etcd --name etcd-{{ hostname }} --listen-peer-urls {{ etcd_protocol }}://{{ host_ip }}:{{ server_port }} --initial-advertise-peer-urls {{ etcd_protocol }}://{{ hostname }}:{{ server_port }} --advertise-client-urls http://127.0.0.1:{{ port }} --listen-client-urls http://127.0.0.1:{{ port }} {{ quota_bytes }} --data-dir /var/etcd/data{{ suffix }} --initial-cluster-state {{ cluster_state }} --initial-cluster {{ etcd_cluster }} {{ etcd_creds }} {{ etcd_extra_args }} 1>>/var/log/etcd{{ suffix }}.log 2>&1"
|
2018-03-06 22:33:18 +00:00
|
|
|
],
|
|
|
|
"env": [
|
|
|
|
{ "name": "TARGET_STORAGE",
|
|
|
|
"value": "{{ pillar.get('storage_backend', 'etcd3') }}"
|
|
|
|
},
|
|
|
|
{ "name": "TARGET_VERSION",
|
2018-11-26 18:23:56 +00:00
|
|
|
"value": "{{ pillar.get('etcd_version', '3.2.24') }}"
|
2018-03-06 22:33:18 +00:00
|
|
|
},
|
|
|
|
{ "name": "DATA_DIRECTORY",
|
|
|
|
"value": "/var/etcd/data{{ suffix }}"
|
|
|
|
},
|
|
|
|
{ "name": "INITIAL_CLUSTER",
|
|
|
|
"value": "{{ etcd_cluster }}"
|
2018-07-18 14:47:22 +00:00
|
|
|
},
|
|
|
|
{ "name": "LISTEN_PEER_URLS",
|
|
|
|
"value": "{{ etcd_protocol }}://{{ host_ip }}:{{ server_port }}"
|
|
|
|
},
|
|
|
|
{ "name": "INITIAL_ADVERTISE_PEER_URLS",
|
|
|
|
"value": "{{ etcd_protocol }}://{{ hostname }}:{{ server_port }}"
|
|
|
|
},
|
|
|
|
{ "name": "ETCD_CREDS",
|
|
|
|
"value": "{{ etcd_creds }}"
|
|
|
|
},
|
|
|
|
{ "name": "ETCD_SNAPSHOT_COUNT",
|
|
|
|
"value": "10000"
|
2018-03-06 22:33:18 +00:00
|
|
|
}
|
|
|
|
],
|
|
|
|
"livenessProbe": {
|
|
|
|
"httpGet": {
|
|
|
|
"host": "127.0.0.1",
|
|
|
|
"port": {{ port }},
|
|
|
|
"path": "/health"
|
|
|
|
},
|
|
|
|
"initialDelaySeconds": {{ liveness_probe_initial_delay }},
|
|
|
|
"timeoutSeconds": 15
|
|
|
|
},
|
|
|
|
"ports": [
|
|
|
|
{ "name": "serverport",
|
|
|
|
"containerPort": {{ server_port }},
|
2018-07-18 14:47:22 +00:00
|
|
|
"hostPort": {{ server_port }}
|
2018-03-06 22:33:18 +00:00
|
|
|
},
|
|
|
|
{ "name": "clientport",
|
|
|
|
"containerPort": {{ port }},
|
|
|
|
"hostPort": {{ port }}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"volumeMounts": [
|
|
|
|
{ "name": "varetcd",
|
|
|
|
"mountPath": "/var/etcd",
|
|
|
|
"readOnly": false
|
|
|
|
},
|
|
|
|
{ "name": "varlogetcd",
|
|
|
|
"mountPath": "/var/log/etcd{{ suffix }}.log",
|
|
|
|
"readOnly": false
|
|
|
|
},
|
|
|
|
{ "name": "etc",
|
2018-11-26 18:23:56 +00:00
|
|
|
"mountPath": "/etc/srv/kubernetes",
|
2018-03-06 22:33:18 +00:00
|
|
|
"readOnly": false
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"volumes":[
|
|
|
|
{ "name": "varetcd",
|
|
|
|
"hostPath": {
|
|
|
|
"path": "/mnt/master-pd/var/etcd"}
|
|
|
|
},
|
|
|
|
{ "name": "varlogetcd",
|
|
|
|
"hostPath": {
|
|
|
|
"path": "/var/log/etcd{{ suffix }}.log",
|
|
|
|
"type": "FileOrCreate"}
|
|
|
|
},
|
|
|
|
{ "name": "etc",
|
|
|
|
"hostPath": {
|
2018-11-26 18:23:56 +00:00
|
|
|
"path": "/etc/srv/kubernetes"}
|
2018-03-06 22:33:18 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}}
|