Kubernetes Config Files

From Wizard Rants
Revision as of 08:17, 22 May 2020 by Northrup2 (talk | contribs) (Created page with "<systemhighlight> INTERNAL_IP=$(ifconfig ens4 | grep -v inet6 |grep 'inet' | tr -s ' ' | cut -d' ' -f3) cat <<EOF | sudo tee /etc/systemd/system/etcd.service [Unit] Descriptio...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

<systemhighlight> INTERNAL_IP=$(ifconfig ens4 | grep -v inet6 |grep 'inet' | tr -s ' ' | cut -d' ' -f3) cat <<EOF | sudo tee /etc/systemd/system/etcd.service [Unit] Description=etcd Documentation=https://github.com/coreos

[Service] Type=notify ExecStart=/usr/local/bin/etcd \\

 --name ${ETCD_NAME} \\
 --cert-file=/etc/etcd/kubernetes.pem \\
 --key-file=/etc/etcd/kubernetes-key.pem \\
 --peer-cert-file=/etc/etcd/kubernetes.pem \\
 --peer-key-file=/etc/etcd/kubernetes-key.pem \\
 --trusted-ca-file=/etc/etcd/ca.pem \\
 --peer-trusted-ca-file=/etc/etcd/ca.pem \\
 --peer-client-cert-auth \\
 --client-cert-auth \\
 --initial-advertise-peer-urls https://${INTERNAL_IP}:2380 \\
 --listen-peer-urls https://${INTERNAL_IP}:2380 \\
 --listen-client-urls https://${INTERNAL_IP}:2379,https://127.0.0.1:2379 \\
 --advertise-client-urls https://${INTERNAL_IP}:2379 \\
 --initial-cluster-token etcd-cluster-0 \\
 --initial-cluster us-etcd-01=https://10.1.20.11:2380,us-etcd-02=https://10.1.20.12:2380,us-etcd-03=https://10.1.20.10:2380 \\
 --initial-cluster-state new \\
 --data-dir=/var/lib/etcd

Restart=on-failure RestartSec=5

[Install] WantedBy=multi-user.target EOF </systemhighlight>