github.com/solo-io/cue@v0.4.7/doc/tutorial/kubernetes/original/services/infra/etcd/kube.yaml (about) 1 apiVersion: v1 2 kind: Service 3 metadata: 4 name: etcd 5 labels: 6 app: etcd 7 component: infra 8 spec: 9 clusterIP: None 10 selector: 11 app: etcd 12 ports: 13 - port: 2379 14 targetPort: 2379 15 protocol: TCP 16 name: client 17 - port: 2380 18 targetPort: 2380 19 protocol: TCP 20 name: peer 21 --- 22 apiVersion: apps/v1 23 kind: StatefulSet 24 metadata: 25 name: etcd 26 spec: 27 serviceName: etcd 28 replicas: 3 29 template: 30 metadata: 31 labels: 32 app: etcd 33 component: infra 34 annotations: 35 prometheus.io.scrape: "true" 36 prometheus.io.port: "2379" 37 spec: 38 affinity: 39 podAntiAffinity: 40 requiredDuringSchedulingIgnoredDuringExecution: 41 - labelSelector: 42 matchExpressions: 43 - key: "app" 44 operator: In 45 values: 46 - etcd 47 topologyKey: "kubernetes.io/hostname" 48 terminationGracePeriodSeconds: 10 49 containers: 50 - name: etcd 51 image: quay.io/coreos/etcd:v3.3.10 52 ports: 53 - name: client 54 containerPort: 2379 55 - name: peer 56 containerPort: 2380 57 livenessProbe: 58 httpGet: 59 path: /health 60 port: client 61 initialDelaySeconds: 30 62 volumeMounts: 63 - name: etcd3 64 mountPath: /data 65 env: 66 - name: ETCDCTL_API 67 value: "3" 68 - name: ETCD_AUTO_COMPACTION_RETENTION 69 value: "4" 70 - name: NAME 71 valueFrom: 72 fieldRef: 73 fieldPath: metadata.name 74 - name: IP 75 valueFrom: 76 fieldRef: 77 fieldPath: status.podIP 78 command: ["/usr/local/bin/etcd"] 79 args: [ 80 "-name", "$(NAME)", 81 "-data-dir", "/data/etcd3", 82 "-initial-advertise-peer-urls", "http://$(IP):2380", 83 "-listen-peer-urls", "http://$(IP):2380", 84 "-listen-client-urls", "http://$(IP):2379,http://127.0.0.1:2379", 85 "-advertise-client-urls", "http://$(IP):2379", 86 # bootstrap 87 # "-initial-cluster-token", "etcd-prod-events2", 88 "-discovery", "https://discovery.etcd.io/xxxxxx", 89 ] 90 volumeClaimTemplates: 91 - metadata: 92 name: etcd3 93 annotations: 94 volume.alpha.kubernetes.io/storage-class: default 95 spec: 96 accessModes: [ "ReadWriteOnce" ] 97 resources: 98 requests: 99 storage: 10Gi