- Remove duplicate db.metrics section (port 7203 conflict) - Fix coordinator health endpoint (/health not /api/v1/services/m3db/health) - Update README: remove NodePort references, always use LoadBalancer - Add bootstrap instructions (workaround for init job chicken-and-egg) - Fix test-metrics.sh: correct health endpoint and JSON parsing
116 lines
3.2 KiB
YAML
116 lines
3.2 KiB
YAML
##############################################################################
|
|
# etcd cluster for M3DB placement & topology
|
|
# M3DB requires etcd for cluster coordination
|
|
##############################################################################
|
|
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: etcd
|
|
namespace: m3db
|
|
labels:
|
|
app.kubernetes.io/name: etcd
|
|
app.kubernetes.io/part-of: m3db
|
|
spec:
|
|
clusterIP: None
|
|
publishNotReadyAddresses: true
|
|
ports:
|
|
- name: client
|
|
port: 2379
|
|
targetPort: 2379
|
|
- name: peer
|
|
port: 2380
|
|
targetPort: 2380
|
|
selector:
|
|
app.kubernetes.io/name: etcd
|
|
|
|
---
|
|
|
|
apiVersion: apps/v1
|
|
kind: StatefulSet
|
|
metadata:
|
|
name: etcd
|
|
namespace: m3db
|
|
labels:
|
|
app.kubernetes.io/name: etcd
|
|
app.kubernetes.io/part-of: m3db
|
|
spec:
|
|
serviceName: etcd
|
|
replicas: 3
|
|
podManagementPolicy: Parallel
|
|
selector:
|
|
matchLabels:
|
|
app.kubernetes.io/name: etcd
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app.kubernetes.io/name: etcd
|
|
app.kubernetes.io/part-of: m3db
|
|
spec:
|
|
affinity:
|
|
podAntiAffinity:
|
|
requiredDuringSchedulingIgnoredDuringExecution:
|
|
- labelSelector:
|
|
matchExpressions:
|
|
- key: app.kubernetes.io/name
|
|
operator: In
|
|
values:
|
|
- etcd
|
|
topologyKey: kubernetes.io/hostname
|
|
containers:
|
|
- name: etcd
|
|
image: quay.io/coreos/etcd:v3.5.15
|
|
ports:
|
|
- containerPort: 2379
|
|
name: client
|
|
- containerPort: 2380
|
|
name: peer
|
|
env:
|
|
- name: POD_NAME
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: metadata.name
|
|
command:
|
|
- etcd
|
|
args:
|
|
- --name=$(POD_NAME)
|
|
- --listen-peer-urls=http://0.0.0.0:2380
|
|
- --listen-client-urls=http://0.0.0.0:2379
|
|
- --advertise-client-urls=http://$(POD_NAME).etcd.m3db.svc.cluster.local:2379
|
|
- --initial-advertise-peer-urls=http://$(POD_NAME).etcd.m3db.svc.cluster.local:2380
|
|
- --initial-cluster=etcd-0=http://etcd-0.etcd.m3db.svc.cluster.local:2380,etcd-1=http://etcd-1.etcd.m3db.svc.cluster.local:2380,etcd-2=http://etcd-2.etcd.m3db.svc.cluster.local:2380
|
|
- --initial-cluster-state=new
|
|
- --data-dir=/var/lib/etcd/data
|
|
- --auto-compaction-retention=1
|
|
volumeMounts:
|
|
- name: etcd-data
|
|
mountPath: /var/lib/etcd
|
|
resources:
|
|
requests:
|
|
cpu: 200m
|
|
memory: 256Mi
|
|
limits:
|
|
cpu: 500m
|
|
memory: 512Mi
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /health
|
|
port: 2379
|
|
initialDelaySeconds: 15
|
|
periodSeconds: 10
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /health
|
|
port: 2379
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 5
|
|
volumeClaimTemplates:
|
|
- metadata:
|
|
name: etcd-data
|
|
spec:
|
|
storageClassName: vultr-block-storage-m3db
|
|
accessModes: ["ReadWriteOnce"]
|
|
resources:
|
|
requests:
|
|
storage: 10Gi
|