add kubespray to the XTesting as it provides newer version of kubenetes and can be...
[it/test.git] / XTesting / kubespray / docs / etcd.md
1 # etcd
2
3 ## Deployment Types
4
5 It is possible to deploy etcd with three methods. To change the default deployment method (host), use the `etcd_deployment_type` variable. Possible values are `host`, `kubeadm`, and `docker`.
6
7 ### Host
8
9 Host deployment is the default method. Using this method will result in etcd installed as a systemd service.
10
11 ### Docker
12
13 Installs docker in etcd group members and runs etcd on docker containers. Only usable when `container_manager` is set to `docker`.
14
15 ### Kubeadm
16
17 This deployment method is experimental and is only available for new deployments. This deploys etcd as a static pod in master hosts.
18
19 ## Metrics
20
21 To expose metrics on a separate HTTP port, define it in the inventory with:
22
23 ```yaml
24 etcd_metrics_port: 2381
25 ```
26
27 To create a service `etcd-metrics` and associated endpoints in the `kube-system` namespace,
28 define it's labels in the inventory with:
29
30 ```yaml
31 etcd_metrics_service_labels:
32   k8s-app: etcd
33   app.kubernetes.io/managed-by: Kubespray
34   app: kube-prometheus-stack-kube-etcd
35   release: prometheus-stack
36 ```
37
38 The last two labels in the above example allows to scrape the metrics from the
39 [kube-prometheus-stack](https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack)
40 chart with the following Helm `values.yaml` :
41
42 ```yaml
43 kubeEtcd:
44   service:
45     enabled: false
46 ```