update etcd script

pull/863/head
Ruslan Savchuk 2025-03-31 22:58:18 +02:00
parent 1dd54d58c4
commit 7a786179c6
1 changed files with 14 additions and 24 deletions

View File

@ -27,12 +27,10 @@ wget -q --show-progress --https-only --timestamping \
And install them And install them
```bash ```bash
{ mv cfssl_1.4.1_linux_amd64 cfssl \
mv cfssl_1.4.1_linux_amd64 cfssl && mv cfssljson_1.4.1_linux_amd64 cfssljson \
mv cfssljson_1.4.1_linux_amd64 cfssljson && chmod +x cfssl cfssljson \
chmod +x cfssl cfssljson && mv cfssl cfssljson /usr/local/bin/
sudo mv cfssl cfssljson /usr/local/bin/
}
``` ```
After the tools are installed successfully, we need to generate ca certificate. After the tools are installed successfully, we need to generate ca certificate.
@ -132,13 +130,9 @@ kubernetes.pem
And distribute certificate files created And distribute certificate files created
```bash ```bash
{ mkdir -p /etc/etcd /var/lib/etcd \
sudo mkdir -p /etc/etcd /var/lib/etcd && chmod 700 /var/lib/etcd \
sudo chmod 700 /var/lib/etcd && cp ca.pem kubernetes.pem kubernetes-key.pem /etc/etcd/
sudo cp ca.pem \
kubernetes.pem kubernetes-key.pem \
/etc/etcd/
}
``` ```
## configure ## configure
@ -151,15 +145,13 @@ wget -q --show-progress --https-only --timestamping \
After the download is complete, we can move etcd binaries to the proper folders After the download is complete, we can move etcd binaries to the proper folders
```bash ```bash
{ tar -xvf etcd-v3.4.15-linux-amd64.tar.gz \
tar -xvf etcd-v3.4.15-linux-amd64.tar.gz && mv etcd-v3.4.15-linux-amd64/etcd* /usr/local/bin/
sudo mv etcd-v3.4.15-linux-amd64/etcd* /usr/local/bin/
}
``` ```
Now, we can configure etcd service Now, we can configure etcd service
```bash ```bash
cat <<EOF | sudo tee /etc/systemd/system/etcd.service cat <<EOF | tee /etc/systemd/system/etcd.service
[Unit] [Unit]
Description=etcd Description=etcd
Documentation=https://github.com/coreos Documentation=https://github.com/coreos
@ -195,11 +187,9 @@ Configuration options specified:
And finally, we need to run our etcd service And finally, we need to run our etcd service
```bash ```bash
{ systemctl daemon-reload \
sudo systemctl daemon-reload && systemctl enable etcd \
sudo systemctl enable etcd && systemctl start etcd
sudo systemctl start etcd
}
``` ```
To ensure that our service successfully started, run To ensure that our service successfully started, run
@ -225,7 +215,7 @@ Output:
When etcd is up and running, we can check whether we can communicate with it When etcd is up and running, we can check whether we can communicate with it
``` ```
sudo ETCDCTL_API=3 etcdctl member list \ ETCDCTL_API=3 etcdctl member list \
--endpoints=https://127.0.0.1:2379 \ --endpoints=https://127.0.0.1:2379 \
--cacert=/etc/etcd/ca.pem \ --cacert=/etc/etcd/ca.pem \
--cert=/etc/etcd/kubernetes.pem \ --cert=/etc/etcd/kubernetes.pem \