-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathetcd.yaml
58 lines (58 loc) · 1.99 KB
/
etcd.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
apiVersion: v1
kind: Pod
metadata:
annotations:
scheduler.alpha.kubernetes.io/critical-pod: ""
creationTimestamp: null
labels:
component: etcd
tier: control-plane
name: {{ ansible_fqdn }}
namespace: kube-system
spec:
containers:
- command:
- etcd
- --name={{ ansible_fqdn }}
- --data-dir=/var/lib/etcd
- --heartbeat-interval=1000
- --election-timeout=5000
- --listen-client-urls=https://{{ ansible_default_ipv4.address }}:2379
- --advertise-client-urls=https://{{ ansible_default_ipv4.address }}:2379
- --listen-peer-urls=https://{{ ansible_default_ipv4.address }}:2380
- --initial-advertise-peer-urls=https://{{ ansible_default_ipv4.address }}:2380
- --cert-file=/certs/server.pem
- --key-file=/certs/server-key.pem
- --client-cert-auth
- --trusted-ca-file=/certs/ca.pem
- --peer-cert-file=/certs/peer.pem
- --peer-key-file=/certs/peer-key.pem
- --peer-client-cert-auth
- --peer-trusted-ca-file=/certs/ca.pem
- --initial-cluster={{ hostvars[groups['k8s-masters'][0]].ansible_fqdn }}=https://{{ hostvars[groups['k8s-masters'][0]].ansible_default_ipv4.address }}:2380,{{ hostvars[groups['k8s-masters'][1]].ansible_fqdn }}=https://{{ hostvars[groups['k8s-masters'][1]].ansible_default_ipv4.address }}:2380,{{ hostvars[groups['k8s-masters'][2]].ansible_fqdn }}=https://{{ hostvars[groups['k8s-masters'][2]].ansible_default_ipv4.address }}:2380
- --initial-cluster-token=my-etcd-token
- --initial-cluster-state
- new
image: gcr.io/google_containers/etcd-amd64:3.1.11
livenessProbe:
httpGet:
path: /health
port: 2379
scheme: HTTP
initialDelaySeconds: 15
timeoutSeconds: 15
name: etcd
volumeMounts:
- mountPath: /var/lib/etcd
name: etcd
- mountPath: /certs
name: certs
hostNetwork: true
volumes:
- hostPath:
path: /var/lib/etcd
type: DirectoryOrCreate
name: etcd
- hostPath:
path: /etc/kubernetes/pki/etcd
name: certs