Closed chuckn246 closed 5 months ago
I was able to get the service started by using the etcd systemd service example from here: https://github.com/etcd-io/etcd/blob/main/contrib/systemd/etcd.service then editing it with code from the commit where the code was removed.
etcd_name=$(hostname -s)
internal_ip=$(hostname -I | awk '{ print $1 }')
cat <<EOF > /etc/systemd/system/etcd.service
[Unit]
Description=etcd key-value store
Documentation=https://github.com/etcd-io/etcd
After=network-online.target local-fs.target remote-fs.target time-sync.target
Wants=network-online.target local-fs.target remote-fs.target time-sync.target
[Service]
Type=notify
Environment=ETCD_UNSUPPORTED_ARCH=arm64
ExecStart=/usr/local/bin/etcd \\
--name ${etcd_name} \\
--cert-file=/etc/etcd/kube-api-server.crt \\
--key-file=/etc/etcd/kube-api-server.key \\
--peer-cert-file=/etc/etcd/kube-api-server.crt \\
--peer-key-file=/etc/etcd/kube-api-server.key \\
--trusted-ca-file=/etc/etcd/ca.crt \\
--peer-trusted-ca-file=/etc/etcd/ca.crt \\
--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 ${etcd_name}=https://${internal_ip}:2380 \\
--initial-cluster-state new \\
--data-dir=/var/lib/etcd
Restart=always
RestartSec=10s
LimitNOFILE=40000
[Install]
WantedBy=multi-user.target
EOF
I'm not sure if this is correct yet but the service starts.
In the doc, it prompts you to use the the etcd service found in the units/
dir
In the doc, it prompts you to use the the etcd service found in the
units/
dir
oh drr, yup it's in the scp
command..
Thanks!
I made it to 07-bootstrapping-etcd and noticed the systemd service configuration is missing.
I looked at the git history and noticed that the heredoc that originally created the service file was recently removed.
edit: https://github.com/kelseyhightower/kubernetes-the-hard-way/blob/master/docs/07-bootstrapping-etcd.md