Kubernets On Premises Guide - TheOpenCloudEngine/uEngine-cloud GitHub Wiki

์•„์ฃผ ์œ ์šฉํ•œ ๋ธ”๋กœ๊ทธ

https://blog.inkubate.io/install-and-configure-a-multi-master-kubernetes-cluster-with-kubeadm/

Install

$ sudo yum install ansible
$ vi mykey.pem
Copy private key

$ chmod 400 mykey.pem
$ sudo vi /etc/ansible/hosts

[all:vars]
ansible_user=centos
ansible_ssh_private_key_file=/home/centos/belugarKey.pem

[admin]
172.31.17.210

[master]
172.31.21.245
172.31.31.93
172.31.22.70

[node]
172.31.20.221
172.31.20.109
172.31.30.242

$ ansible all -a "yum install -y docker" --sudo
$ ansible all -a "systemctl enable docker" --sudo
$ ansible all -a "systemctl start docker" --sudo
$ sudo vi kubelet.yml

---
- hosts: all
  remote_user: "{{ansible_user}}"
  tasks:
    - name: kubernetes repo
      become: true 
      shell:
        cmd: |
          cat <<EOF > /etc/yum.repos.d/kubernetes.repo
          [kubernetes]
          name=Kubernetes
          baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
          enabled=1
          gpgcheck=1
          repo_gpgcheck=1
          gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
          exclude=kube*
          EOF

    - name: kubelet install
      command: "{{ item }}"
      with_items:
        - sudo setenforce 0
        - sudo yum install -y kubelet kubeadm kubectl --disableexcludes=kubernetes
        - sudo systemctl enable kubelet
        - sudo systemctl start kubelet

    - name: setenforce
      become: true 
      shell:
        cmd: |
          cat <<EOF >  /etc/sysctl.d/k8s.conf
          net.bridge.bridge-nf-call-ip6tables = 1
          net.bridge.bridge-nf-call-iptables = 1
          EOF

    - name: systemctl
      become: true     
      command: "{{ item }}"
      with_items:
        - sysctl --system

$ ansible-playbook kubelet.yml

swapoff

$ swapoff -a
$ sed -i '/ swap / s/^/#/' /etc/fstab

all master

cat << EOF > /etc/systemd/system/kubelet.service.d/20-etcd-service-manager.conf
[Service]
ExecStart=
ExecStart=/usr/bin/kubelet --cgroup-driver=systemd --address=127.0.0.1 --pod-manifest-path=/etc/kubernetes/manifests --allow-privileged=true
Restart=always
EOF

systemctl daemon-reload
systemctl restart kubelet
  1. TCP ๋กœ๋“œ๋ฐธ๋Ÿฐ์Šค ๊ตฌ์„ฑํ• ๊ฒƒ. ๋งˆ์Šคํ„ฐ 3๊ฐœ ๋…ธ๋“œ์˜ 6443 ํฌํŠธ๋กœ.
Calico CDIR (์‚ฌ์ด๋” ๋ธ”๋ก)
192.168.0.0/16

$ kubectl version
์ฟ ๋ฒ„๋„ค์ด์ธ  ๋ฒ„์ ผ v1.11.2

cgroup

# ๋„์ปค cgroup ํ™•์ธ
$ docker info | grep -i cgroup
$ vi /etc/default/kubelet
KUBELET_KUBEADM_EXTRA_ARGS=--cgroup-driver=systemd

$ vi /etc/sysconfig/kubelet
KUBELET_EXTRA_ARGS=--cgroup-driver=systemd



$ vi /etc/default/kubelet
$ 

# Reset
$ kubeadm reset


๋ ˆํผ๋Ÿฐ์Šค

https://github.com/cookeem/kubeadm-ha

โš ๏ธ **GitHub.com Fallback** โš ๏ธ