github.com/m3db/m3@v1.5.0/scripts/vagrant/provision/manifests/etcd-single.yaml (about) 1 apiVersion: v1 2 kind: Service 3 metadata: 4 name: etcd 5 labels: 6 app: etcd 7 spec: 8 ports: 9 - port: 2379 10 name: client 11 - port: 2380 12 name: peer 13 clusterIP: None 14 selector: 15 app: etcd 16 --- 17 apiVersion: v1 18 kind: Service 19 metadata: 20 name: etcd-cluster 21 labels: 22 app: etcd 23 spec: 24 selector: 25 app: etcd 26 ports: 27 - port: 2379 28 protocol: TCP 29 type: ClusterIP 30 --- 31 apiVersion: apps/v1 32 kind: StatefulSet 33 metadata: 34 name: etcd 35 labels: 36 app: etcd 37 spec: 38 serviceName: "etcd" 39 replicas: 1 40 selector: 41 matchLabels: 42 app: etcd 43 template: 44 metadata: 45 labels: 46 app: etcd 47 spec: 48 containers: 49 - name: etcd 50 image: quay.io/coreos/etcd:v3.3.10 51 command: 52 - "etcd" 53 - "--name" 54 - "$(MY_POD_NAME)" 55 - "--listen-peer-urls" 56 - "http://$(MY_IP):2380" 57 - "--listen-client-urls" 58 - "http://$(MY_IP):2379,http://127.0.0.1:2379" 59 - "--advertise-client-urls" 60 - "http://$(MY_POD_NAME).etcd:2379" 61 - "--initial-cluster-token" 62 - "etcd-cluster-1" 63 - "--initial-advertise-peer-urls" 64 - "http://$(MY_POD_NAME).etcd:2380" 65 - "--initial-cluster" 66 - "etcd-0=http://$(MY_POD_NAME).etcd:2380" 67 - "--initial-cluster-state" 68 - "new" 69 - "--data-dir" 70 - "/var/lib/etcd" 71 ports: 72 - containerPort: 2379 73 name: client 74 - containerPort: 2380 75 name: peer 76 env: 77 - name: MY_IP 78 valueFrom: 79 fieldRef: 80 fieldPath: status.podIP 81 - name: MY_POD_NAME 82 valueFrom: 83 fieldRef: 84 fieldPath: metadata.name 85 - name: ETCDCTL_API 86 value: "3"