github.com/solo-io/cue@v0.4.7/doc/tutorial/kubernetes/manual/services/infra/etcd/kube.cue (about) 1 package kube 2 3 service: etcd: kubernetes: spec: clusterIP: "None" 4 5 deployment: etcd: { 6 kind: "stateful" 7 replicas: 3 8 9 image: "quay.io/coreos/etcd:v3.3.10" 10 11 kubernetes: spec: template: spec: containers: [{command: ["/usr/local/bin/etcd"]}] 12 13 arg: name: "$(NAME)" 14 arg: "data-dir": "/data/etcd3" 15 arg: "initial-advertise-peer-urls": "http://$(IP):2380" 16 arg: "listen-peer-urls": "http://$(IP):2380" 17 arg: "listen-client-urls": "http://$(IP):2379,http://127.0.0.1:2379" 18 arg: "advertise-client-urls": "http://$(IP):2379" 19 arg: discovery: "https://discovery.etcd.io/xxxxxx" 20 21 env: ETCDCTL_API: "3" 22 env: ETCD_AUTO_COMPACTION_RETENTION: "4" 23 24 envSpec: NAME: valueFrom: fieldRef: fieldPath: "metadata.name" 25 envSpec: IP: valueFrom: fieldRef: fieldPath: "status.podIP" 26 27 expose: port: client: 2379 28 expose: port: peer: 2380 29 30 kubernetes: spec: template: spec: containers: [{ 31 volumeMounts: [{ 32 name: "etcd3" 33 mountPath: "/data" 34 }] 35 livenessProbe: { 36 httpGet: { 37 path: "/health" 38 port: "client" 39 } 40 initialDelaySeconds: 30 41 } 42 }] 43 44 kubernetes: spec: { 45 volumeClaimTemplates: [{ 46 metadata: { 47 name: "etcd3" 48 annotations: "volume.alpha.kubernetes.io/storage-class": "default" 49 } 50 spec: { 51 accessModes: ["ReadWriteOnce"] 52 resources: requests: storage: "10Gi" 53 } 54 }] 55 56 serviceName: "etcd" 57 template: metadata: annotations: "prometheus.io.port": "2379" 58 template: metadata: annotations: "prometheus.io.scrape": "true" 59 template: spec: affinity: { 60 podAntiAffinity: requiredDuringSchedulingIgnoredDuringExecution: [{ 61 labelSelector: matchExpressions: [{ 62 key: "app" 63 operator: "In" 64 values: ["etcd"] 65 }] 66 topologyKey: "kubernetes.io/hostname" 67 }] 68 } 69 template: spec: terminationGracePeriodSeconds: 10 70 } 71 }