Continuing my Kubernetes the Hard Way homelab build. Steps 01-06 are already done, this covers step 07.
Original guide: 07-bootstrapping-etcd.md
Thoughts I had while doing this
This step sets up the etcd cluster. From what I understand, etcd is basically Kubernetes' database, it's where the "state" of the whole cluster gets stored.
Quick TLDR before the actual steps:
- grab the etcd binaries/service file
- copy them over to the controller/server node
- then install and configure etcd as a systemd service
- End result: a running
etcdLinux service on the controller.
So I basically just installed a database for Kubernetes.
Prerequisites
root@luger-VirtualBox:~/kubernetes-the-hard-way# scp \
downloads/controller/etcd \
downloads/client/etcdctl \
units/etcd.service \
root@server:~/
etcd 100% 24MB 92.2MB/s 00:00
etcdctl 100% 16MB 130.8MB/s 00:00
etcd.service
Install the etcd binaries
root@server:~# {
mv etcd etcdctl /usr/local/bin/
}
Configure the etcd server
root@server:~# {
mkdir -p /etc/etcd /var/lib/etcd
chmod 700 /var/lib/etcd
cp ca.crt kube-api-server.key kube-api-server.crt \
/etc/etcd/
}
root@server:~# mv etcd.service /etc/systemd/system/
Start the etcd server
root@server:~# {
systemctl daemon-reload
systemctl enable etcd
systemctl start etcd
}
Created symlink /etc/systemd/system/multi-user.target.wants/etcd.service → /etc/systemd/system/etcd.service.
Verification
root@server:~# etcdctl member list
6702b0a34e2cfd39, started, controller, http://127.0.0.1:2380, http://127.0.0.1:2379, false
etcd is up, and member list confirms it's running as a single-member cluster named controller.
Summary
Got etcd installed and running as a systemd service on the controller node, using the CA and API server certs from step 04 to secure it. Followed the guide as-is, no deviations this time.
Top comments (0)