github.com/m3db/m3@v1.5.0/kube/etcd.yaml (about)

     1  apiVersion: v1
     2  kind: Service
     3  metadata:
     4    name: etcd
     5    labels:
     6      app: etcd
     7    namespace: m3db
     8  spec:
     9    ports:
    10    - port: 2379
    11      name: client
    12    - port: 2380
    13      name: peer
    14    clusterIP: None
    15    selector:
    16      app: etcd
    17  ---
    18  apiVersion: v1
    19  kind: Service
    20  metadata:
    21    name: etcd-cluster
    22    labels:
    23      app: etcd
    24    namespace: m3db
    25  spec:
    26    selector:
    27      app: etcd
    28    ports:
    29    - port: 2379
    30      protocol: TCP
    31    type: ClusterIP
    32  ---
    33  apiVersion: apps/v1
    34  kind: StatefulSet
    35  metadata:
    36    name: etcd
    37    labels:
    38      app: etcd
    39    namespace: m3db
    40  spec:
    41    serviceName: "etcd"
    42    replicas: 3
    43    selector:
    44      matchLabels:
    45        app: etcd
    46    template:
    47      metadata:
    48        labels:
    49          app: etcd
    50      spec:
    51        containers:
    52        - name: etcd
    53          image: quay.io/coreos/etcd:v3.4.3
    54          command:
    55          - "etcd"
    56          - "--name"
    57          - "$(MY_POD_NAME)"
    58          - "--listen-peer-urls"
    59          - "http://$(MY_IP):2380"
    60          - "--listen-client-urls"
    61          - "http://$(MY_IP):2379,http://127.0.0.1:2379"
    62          - "--advertise-client-urls"
    63          - "http://$(MY_POD_NAME).etcd:2379"
    64          - "--initial-cluster-token"
    65          - "etcd-cluster-1"
    66          - "--initial-advertise-peer-urls"
    67          - "http://$(MY_POD_NAME).etcd:2380"
    68          - "--initial-cluster"
    69          - "etcd-0=http://etcd-0.etcd:2380,etcd-1=http://etcd-1.etcd:2380,etcd-2=http://etcd-2.etcd:2380"
    70          - "--initial-cluster-state"
    71          - "new"
    72          - "--data-dir"
    73          - "/var/lib/etcd"
    74          ports:
    75          - containerPort: 2379
    76            name: client
    77          - containerPort: 2380
    78            name: peer
    79          volumeMounts:
    80          - name: etcd-data
    81            mountPath: /var/lib/etcd
    82          env:
    83          - name: MY_IP
    84            valueFrom:
    85              fieldRef:
    86                fieldPath: status.podIP
    87          - name: MY_POD_NAME
    88            valueFrom:
    89              fieldRef:
    90                fieldPath: metadata.name
    91          - name: ETCDCTL_API
    92            value: "3"
    93    volumeClaimTemplates:
    94      - metadata:
    95          name: etcd-data
    96        spec:
    97          accessModes:
    98            - ReadWriteOnce
    99          storageClassName: fast
   100          resources:
   101            requests:
   102              storage: 50Gi