systemctldisablefirewalld
#禁用SELINUX
setenforce0
sed-i–follow-symlinks’s/SELINUX=enforcing/SELINUX=disabled/g’/etc/sysconfig/selinux
#关闭swap
swapoff-a
或永久关闭
vi/etc/fstab
注释掉下面这句
#/dev/mapper/centos-swapswapswapdefaults00
#设置br_netfilter
modprobebr_netfilter
echo’1′>/proc/sys/net/bridge/bridge-nf-call-iptables
#设置iptables等
echo’1′>/proc/sys/net/bridge/bridge-nf-call-iptables
sudobash-c’echo1>/proc/sys/net/ipv4/ip_forward’
#添加yum源
vi/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
“`
阿里云:
###然后安装
“`
yuminstall-ykubeletkubeadmkubectl
附录:
卸载
yumremovekubeletkubeadmkubectl
安装指定版本
yuminstall-ykubelet-1.13.5-0.x86_64
yuminstall-ykubectl-1.13.5-0.x86_64
yuminstall-ykubeadm-1.13.5-0.x86_64
“`
###官网参考
https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/
###
###常用命令
“`
kubectlcluster-info
kubectlgetpods–all-namespaces
sudojournalctl-ukubelet–all|tail
kubectllogs99a04cab33e1-n=istio-system
kubectl–kubeconfig=/home/linux/.kube/kubeconfig.yamlgetsvc-ningress-nginx
watchkubectlgetpods–all-namespaces
kubectltaintnodes–allnode-role.kubernetes.io/master-