aboutsummaryrefslogtreecommitdiffstats
path: root/functest_kubernetes/ims/etcd-depl.yaml
blob: 0fc50cb69a19887786a001ffd54736da39b1f1be (plain)
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
59
60
61
62
63
apiVersion: apps/v1
kind: Deployment
metadata:
  name: etcd
spec:
  replicas: 1
  selector:
    matchLabels:
      instance-type: etcd-pod
  template:
    metadata:
      creationTimestamp: null
      labels:
        instance-type: etcd-pod
    spec:
      containers:
      - args:
        - --name
        - $(MY_POD_NAME)
        - --advertise-client-urls
        - http://$(MY_POD_IP):2379,http://$(MY_POD_IP):4001
        - --listen-client-urls
        - http://0.0.0.0:2379,http://0.0.0.0:4001
        - --initial-advertise-peer-urls
        - http://$(MY_POD_IP):2380
        - --listen-peer-urls
        - http://0.0.0.0:2380
        # By default use a single pod cluster
        - --initial-cluster
        - $(MY_POD_NAME)=http://$(MY_POD_IP):2380
        # Alternatively multi-pod clusters can be supported Using central discvovery.  Run e.g.
        #   curl https://discovery.etcd.io/new?size=3 | sed s/https/http/
        # to get a discovery URL for a 3 pod cluster, substitute the returned value below, and
        # set replicas: 3 above.
        #- --discovery
        #- <URL returned by command above>
        - --initial-cluster-state
        - new
        env:
        - name: MY_POD_IP
          valueFrom:
            fieldRef:
              fieldPath: status.podIP
        - name: MY_POD_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        image: {{ quay_repo }}/coreos/etcd:v2.2.5
        name: etcd
        ports:
        - containerPort: 2379
        - containerPort: 2380
        - containerPort: 4001
        livenessProbe:
          tcpSocket:
            port: 4001
          initialDelaySeconds: 300
        readinessProbe:
          tcpSocket:
            port: 4001
      imagePullSecrets:
      - name: ~
      restartPolicy: Always