kubeprary설치 - External LB설정
블로그 글: https://malwareanalysis.tistory.com/132
유투브 영상: https://youtu.be/12vNy4IvF14
발표 pdf: https://www.slideshare.net/sungwookchoi5/onpremise-kubespray
vagrant up
- putty 등 ssh원격접속 도구로 접속
- 계정: vagrant, 비밀번호: vagrant
- bootstrap서버를 제외한 모든 서버에 설정
sudo swapoff -a
sudo sed -i '/swap/d' /etc/fstab
sudo systemctl stop ufw
sudo systemctl disable ufw
sudo apt install python3-pip python3-setuptools virtualenv -y
virtualenv --python=python3 venv
. venv/bin/activate
git clone https://github.com/kubernetes-sigs/kubespray
cd kubespray
pip install -r requirements.txt
- node1,2,3은 controlplane노드
- node4,5는 worker노드
cp -rfp inventory/sample inventory/mycluster
vi inventory/mycluster/inventory.ini
[all]
node1 ansible_host=192.168.25.41 ip=192.168.25.41 etcd_member_name=etcd1
node2 ansible_host=192.168.25.42 ip=192.168.25.42 etcd_member_name=etcd2
node3 ansible_host=192.168.25.43 ip=192.168.25.43 etcd_member_name=etcd3
node4 ansible_host=192.168.25.44 ip=192.168.25.44
node5 ansible_host=192.168.25.45 ip=192.168.25.45
# ## configure a bastion host if your nodes are not directly reachable
# [bastion]
# bastion ansible_host=x.x.x.x ansible_user=some_user
[kube_control_plane]
node1
node2
node3
[etcd]
node1
node2
node3
[kube_node]
node4
node5
[calico_rr]
[k8s_cluster:children]
kube_control_plane
kube_node
calico_rr
vi inventory/mycluster/group_vars/k8s_cluster/k8s-cluster.yml
container_manager: containerd
vi inventory/mycluster/group_vars/etcd.yml
etcd_deployment_type: host
ansible-playbook -i inventory/mycluster/inventory.ini --become --become-user=root cluster.yml
- controlplane에 접속 후 root계정으로 스위칭
sudo su
kubectl