cilium

Форк
0
/
standalone-etcd.yaml 
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

15
apiVersion: v1
16
kind: Service
17
metadata:
18
  name: "etcd-cilium"
19
  annotations:
20
    # Create endpoints also if the related pod isn't ready
21
    service.alpha.kubernetes.io/tolerate-unready-endpoints: "true"
22
spec:
23
  ports:
24
  - port: 32379
25
    name: client
26
    nodePort: 31079
27
  - port: 32380
28
    name: peer
29
    nodePort: 31080
30
  type: NodePort
31
  selector:
32
    component: "cilium-etcd"
33
---
34
apiVersion: apps/v1
35
kind: StatefulSet
36
metadata:
37
  name: "etcd-cilium"
38
  labels:
39
    component: "cilium-etcd"
40
spec:
41
  selector:
42
    matchLabels:
43
      component: "cilium-etcd"
44
  serviceName: "cilium-etcd"
45
  template:
46
    metadata:
47
      name: "etcd"
48
      labels:
49
        component: "cilium-etcd"
50
    spec:
51
      tolerations:
52
      - key: "node.kubernetes.io/not-ready"
53
        operator: "Exists"
54
      hostNetwork: true
55
      affinity:
56
        podAntiAffinity:
57
          requiredDuringSchedulingIgnoredDuringExecution:
58
            - labelSelector:
59
                matchExpressions:
60
                  - key: "component"
61
                    operator: In
62
                    values:
63
                    - cilium-etcd
64
              topologyKey: "kubernetes.io/hostname"
65
      containers:
66
      - name: "etcd"
67
        image: "quay.io/coreos/etcd:v3.3.25"
68
        env:
69
        - name: HOSTNAME_IP
70
          valueFrom:
71
            fieldRef:
72
              fieldPath: status.podIP
73
        volumeMounts:
74
        - name: local-vol
75
          mountPath: /var/etcd
76
        command:
77
          - "/usr/local/bin/etcd"
78
        args:
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
86
      volumes:
87
        - name: local-vol
88
          hostPath:
89
            path: /var/etcd
90

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.