This commit is contained in:
2023-10-04 11:04:01 +11:00
parent 66e63d0268
commit 029f5bf9d8
5 changed files with 25 additions and 7 deletions
+1 -1
View File
@@ -25,7 +25,6 @@ apiServer:
timeoutForControlPlane: 4m0s timeoutForControlPlane: 4m0s
apiVersion: kubeadm.k8s.io/v1beta3 apiVersion: kubeadm.k8s.io/v1beta3
certificatesDir: /etc/kubernetes/pki certificatesDir: /etc/kubernetes/pki
clusterName: home-cluster
controlPlaneEndpoint: 192.168.1.2:6443 controlPlaneEndpoint: 192.168.1.2:6443
controllerManager: {} controllerManager: {}
dns: {} dns: {}
@@ -37,6 +36,7 @@ etcd:
- https://192.168.1.10:2379 - https://192.168.1.10:2379
- https://192.168.1.11:2379 - https://192.168.1.11:2379
- https://192.168.1.2:2379 - https://192.168.1.2:2379
- https://192.168.1.6:2379
keyFile: /etc/etcd/etcd-key.pem keyFile: /etc/etcd/etcd-key.pem
kind: ClusterConfiguration kind: ClusterConfiguration
kubernetesVersion: v1.26.0 kubernetesVersion: v1.26.0
+1 -1
View File
@@ -21,7 +21,7 @@ ExecStart=/usr/local/bin/etcd \\
--listen-client-urls https://${INTERNAL_IP}:2379,https://127.0.0.1:2379 \\ --listen-client-urls https://${INTERNAL_IP}:2379,https://127.0.0.1:2379 \\
--advertise-client-urls https://${INTERNAL_IP}:2379 \\ --advertise-client-urls https://${INTERNAL_IP}:2379 \\
--initial-cluster-token etcd-cluster-0 \\ --initial-cluster-token etcd-cluster-0 \\
--initial-cluster server-3=https://192.168.1.2:2380,ssd-server-1=https://192.168.1.111:2380,ssd-server-3=https://192.168.1.9:2380 \\ --initial-cluster server-3=https://192.168.1.2:2380,ssd-server-2=https://192.168.1.10:2380,plex=https://192.168.1.11:2380,ssd-server-4=https://192.168.1.6:2380 \\
--initial-cluster-state existing \\ --initial-cluster-state existing \\
--data-dir=/var/lib/etcd --data-dir=/var/lib/etcd
Restart=on-failure Restart=on-failure
Regular → Executable
+6 -1
View File
@@ -5,8 +5,13 @@ sudo ETCDCTL_API=3 etcdctl member list \
--cert=/etc/etcd/etcd.pem \ --cert=/etc/etcd/etcd.pem \
--key=/etc/etcd/etcd-key.pem --key=/etc/etcd/etcd-key.pem
# member add # member add from an existing node
sudo ETCDCTL_API=3 etcdctl member add server-3 --peer-urls=https://192.168.1.2:2380 --endpoints=https://127.0.0.1:2379 --cacert=/etc/etcd/ca.pem --cert=/etc/etcd/etcd.pem --key=/etc/etcd/etcd-key.pem sudo ETCDCTL_API=3 etcdctl member add server-3 --peer-urls=https://192.168.1.2:2380 --endpoints=https://127.0.0.1:2379 --cacert=/etc/etcd/ca.pem --cert=/etc/etcd/etcd.pem --key=/etc/etcd/etcd-key.pem
# get all keys # get all keys
sudo ETCDCTL_API=3 etcdctl get --prefix=true "" -w json --endpoints=https://127.0.0.1:2379 --cacert=/etc/etcd/ca.pem --cert=/etc/etcd/etcd.pem --key=/etc/etcd/etcd-key.pem sudo ETCDCTL_API=3 etcdctl get --prefix=true "" -w json --endpoints=https://127.0.0.1:2379 --cacert=/etc/etcd/ca.pem --cert=/etc/etcd/etcd.pem --key=/etc/etcd/etcd-key.pem
# remove a member
sudo ETCDCTL_API=3 etcdctl member remove 3f3a73a30a4872c4 --endpoints=https://127.0.0.1:2379 --cacert=/etc/etcd/ca.pem --cert=/etc/etcd/etcd.pem --key=/etc/etcd/etcd-key.pem
+7 -4
View File
@@ -3,12 +3,15 @@
# Update HOST0, HOST1 and HOST2 with the IPs of your hosts # Update HOST0, HOST1 and HOST2 with the IPs of your hosts
export HOST0=192.168.1.2 export HOST0=192.168.1.2
export HOST1=192.168.1.11 export HOST1=192.168.1.11
export HOST2=192.168.1.111 export HOST2=192.168.1.10
export HOST2=192.168.1.6
# Update NAME0, NAME1 and NAME2 with the hostnames of your hosts # Update NAME0, NAME1 and NAME2 with the hostnames of your hosts
export NAME0="server-1" export NAME0="server-3"
export NAME1="plex" export NAME1="plex"
export NAME2="ssd-server-1" export NAME2="ssd-server-2"
export NAME3="ssd-server-4"
# Create temp directories to store files that will end up on other hosts. # Create temp directories to store files that will end up on other hosts.
mkdir -p /tmp/${HOST0}/ /tmp/${HOST1}/ /tmp/${HOST2}/ mkdir -p /tmp/${HOST0}/ /tmp/${HOST1}/ /tmp/${HOST2}/
@@ -37,7 +40,7 @@ etcd:
peerCertSANs: peerCertSANs:
- "${HOST}" - "${HOST}"
extraArgs: extraArgs:
initial-cluster: ${NAMES[0]}=https://${HOSTS[0]}:2380,${NAMES[1]}=https://${HOSTS[1]}:2380,${NAMES[2]}=https://${HOSTS[2]}:2380 initial-cluster: ${NAMES[0]}=https://${HOSTS[0]}:2380,${NAMES[1]}=https://${HOSTS[1]}:2380,${NAMES[2]}=https://${HOSTS[2]}:2380,${NAMES[3]}=https://${HOSTS[3]}:2380
initial-cluster-state: new initial-cluster-state: new
name: ${NAME} name: ${NAME}
listen-peer-urls: https://${HOST}:2380 listen-peer-urls: https://${HOST}:2380
+10
View File
@@ -165,3 +165,13 @@ https://computingforgeeks.com/install-cri-o-container-runtime-on-ubuntu-linux/
https://kubernetes.io/docs/setup/production-environment/container-runtimes/#cgroup-driver https://kubernetes.io/docs/setup/production-environment/container-runtimes/#cgroup-driver
# install kubeadm and kublet # install kubeadm and kublet
# install some old version of a package
apt list --all-versions kubeadm
# then install
sudo apt install kubeadm=1.27.6-00
# Datadog crash probably related to redis, please make sure redis is healthy