본문 바로가기
OS/kubernetes

kubernetes 설치 방법

by Knowledge Store In Hyunsoft 2018. 2. 10.

yum install -y docker

systemctl enable docker && systemctl start docker


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

EOF

setenforce 0

yum install -y kubelet kubeadm kubectl

systemctl enable kubelet && systemctl start kubelet



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

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

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

EOF

sysctl --system



방화벽 off & swapoff -a


systemctl stop firewalld

swapoff -a



vi /etc/selinux/config.

SELINUX=disabled

#howto swapoff

vi /etc/fstab


vi .bash_profile

export KUBECONFIG=/etc/kubernetes/admin.conf



master 

 kubeadm init  

- 구동 시간 약 5분정도 소요됨

node

kubeadm join --token d96e15.fe26a9f5210ac339 172.16.117.48:6443 --discovery-token-ca-cert-hash sha256:9413c8425401c19f4e9b88f74a40cd69d671b632f05493cc239e8124679d2f1e



#weave

export kubever=$(kubectl version | base64 | tr -d '\n')

kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$kubever"




kubectl create -f https://rawgit.com/kubernetes/dashboard/master/src/deploy/kubernetes-dashboard.yaml

kubectl create -f  "https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml"

dokcer ip chagange

https://gist.githubusercontent.com/kamermans/94b1c41086de0204750b/raw/c93d923eb9605a8ce1916e6004f77413b46fa4f4/configure_docker0.sh

kubectl get nodes

kubectl get pods --all-namespaces

kubectl get pods -n sock-shop

kubectl namespace sock-shop

kubectl apply -n sock-shop -f "https://github.com/microservices-demo/microservices-demo/blob/master/deploy/kubernetes/complete-demo.yaml?raw=true"

https://rtfmp.com/2015/10/08/how-configure-x11-forwarding-in-rhel7-centos7/

https://rtfmp.com/2015/10/08/how-configure-x11-forwarding-in-rhel7-centos7/

yum install -y xorg-x11-server-Xorg xorg-x11-xauth xorg-x11-apps

나눔고딕

https://joojy.net/p/20170131169

kubeadm join --token 91024a.131b727291769832 172.16.117.50:6443 --discovery-token-ca-cert-hash sha256:f54523fac91da63d71a8378e8f7c50364526cc87db3141d3868dc37bd7acce67



# 폰트 설치 경로로 이동합니다.


cd /usr/share/fonts/

wget http://cdn.naver.com/naver/NanumFont/fontfiles/NanumFont_TTF_ALL.zip

unzip NanumFont_TTF_ALL.zip -d NanumFont

rm -f NanumFont_TTF_ALL.zip

fc-cache -r




cat <<EOF > /etc/yum.repos.d/google-chrome.repo

[google-chrome]

name=google-chrome

baseurl=http://dl.google.com/linux/chrome/rpm/stable/x86_64

enabled=1

gpgcheck=1

gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub

EOF


yum -y install google-chrome-stable


google-chrome




kubectl -n kube-system get secret | grep dash

kubectl -n kube-system describe secret kubernetes-dashboard-token-2xhlg


kubectl -n kube-system describe secret root-sa-token-g778h



cd /usr/local/bin/

wget http://stedolan.github.io/jq/download/linux64/jq

chmod a+x jq



@fkwhrl33!


https://developer.ibm.com/recipes/tutorials/deploying-a-containerized-app-in-kubernetes-using-kubernetes-dashboard/



kubectl create secret generic mysql-pass --from-literal=password=mysqlpwd


kube_role.zip

kube.txt


728x90

댓글