본문 바로가기
카테고리 없음

k8s 1.13 설치 가이드

by Knowledge Store In Hyunsoft 2018. 12. 13.

k8s 1.13 설치 가이드

 

sudo yum install yum-utils

sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

yum install -y docker-ce-18.06.1.ce-3.el7.x86_64

systemctl enable docker.service

systemctl start docker.service

 

 

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

 

 

cat <<EOF >  /etc/sysctl.d/k8s.conf

net.bridge.bridge-nf-call-ip6tables = 1

net.bridge.bridge-nf-call-iptables = 1

EOF

 

 

 

## todo fstab에도 설정해야함.

swapoff -a

 

vi /etc/fstab //swap 주석처리

 

sysctl net.bridge.bridge-nf-call-iptables=1

 

 

setenforce 0

sed -i 's/^SELINUX=enforcing$/SELINUX=permissive/' /etc/selinux/config

 

 

yum install -y kubelet kubeadm kubectl --disableexcludes=kubernetes

 

systemctl enable kubelet && systemctl start kubelet

 

 

##master

kubeadm init --apiserver-advertise-address=192.168.117.19

 

 

#master

export KUBECONFIG=/etc/kubernetes/admin.conf

 

vi ~/.bash_profile

 

 

 

kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')"

 

kubectl get podes --all-namespaces

 

kubectl get nodes

 

 

kubeadm join 10.0.2.15:6443 --token 8a9l17.fgofb5rk13269a9i --discovery-token-ca-cert-hash sha256:7a5d6f388de9f36d2a33d19e645bbf49074a82544335c8bc9159431ca28bb409

 

 

 

 

728x90

댓글