cilium
89 строк · 2.6 Кб
1###############################################################################
2#
3# This is a standalone etcd deployment for PoC or testing purposes. It runs a
4# single replica etcd using host networking. Data is stored in /var/etcd on the
5# host's disk. A scheduling toleration allows it to be scheduled before the
6# cluster is ready. A scheduling anti affinity ensures that never more than one
7# instance is running per node. A NodePort service makes etcd avaiable on a
8# stable address on all nodes without requiring DNS resolution to work
9#
10# etcd address:
11# http://127.0.0.1:31079
12#
13###############################################################################
14
15apiVersion: v1
16kind: Service
17metadata:
18name: "etcd-cilium"
19annotations:
20# Create endpoints also if the related pod isn't ready
21service.alpha.kubernetes.io/tolerate-unready-endpoints: "true"
22spec:
23ports:
24- port: 32379
25name: client
26nodePort: 31079
27- port: 32380
28name: peer
29nodePort: 31080
30type: NodePort
31selector:
32component: "cilium-etcd"
33---
34apiVersion: apps/v1
35kind: StatefulSet
36metadata:
37name: "etcd-cilium"
38labels:
39component: "cilium-etcd"
40spec:
41selector:
42matchLabels:
43component: "cilium-etcd"
44serviceName: "cilium-etcd"
45template:
46metadata:
47name: "etcd"
48labels:
49component: "cilium-etcd"
50spec:
51tolerations:
52- key: "node.kubernetes.io/not-ready"
53operator: "Exists"
54hostNetwork: true
55affinity:
56podAntiAffinity:
57requiredDuringSchedulingIgnoredDuringExecution:
58- labelSelector:
59matchExpressions:
60- key: "component"
61operator: In
62values:
63- cilium-etcd
64topologyKey: "kubernetes.io/hostname"
65containers:
66- name: "etcd"
67image: "quay.io/coreos/etcd:v3.3.25"
68env:
69- name: HOSTNAME_IP
70valueFrom:
71fieldRef:
72fieldPath: status.podIP
73volumeMounts:
74- name: local-vol
75mountPath: /var/etcd
76command:
77- "/usr/local/bin/etcd"
78args:
79- --name=cilium-etcd-$(HOSTNAME_IP)
80- --listen-client-urls=http://0.0.0.0:32379
81- --listen-peer-urls=http://0.0.0.0:32380
82- --advertise-client-urls=http://$(HOSTNAME_IP):32379
83- --initial-cluster-token=cilium-etcd-cluster-1
84- --initial-cluster-state=new
85- --data-dir=/var/etcd/cilium-etcd/default.etcd
86volumes:
87- name: local-vol
88hostPath:
89path: /var/etcd
90