docker导出日志到本地的方法是什么
275
2022-10-27
1分钟创建k8s 集群 create kubernetes cluster in 1 minute
设置集群的主机名字,我是k8s用于centos8,k7s用于centos7的配置
setup local host name centos8
cat <
setup local host name centos7
cat <
禁止防火墙开启VxLan穿透
disable firewall & selinux and enable transparent masquerading (VxLan)
systemctl stop firewalld systemctl disable firewalld setenforce 0 sed -i --follow-symlinks 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/sysconfig/selinux modprobe br_netfilter
禁止swap,开启iptable 桥(如果有)
setup bridge iptables rules & disable memory swap
cat <
禁用ipv6
disable ipv6 on centos7
cat <
安装docker
install docker on centos8
dnf config-manager --add-repo=dnf install dnf install docker-ce --nobest -y systemctl start docker systemctl enable docker docker version docker images
install docker on centos7
sudo yum install -y yum-utils yum-config-manager \ --add-repo \ yum install -y docker-ce docker-ce-cli containerd.io systemctl start docker systemctl enable docker docker version docker images
安装repo 禁用selinux
add k8s repo and install
cat < 可以选择性安装不同班的kubeadm,默认用最新 #option install different version kubeadm #yum list --showduplicates kubeadm --disableexcludes=kubernetes #yum install -y kubelet-1.18.8-0 --disableexcludes=kubernetes #yum install -y kubectl-1.18.8-0 --disableexcludes=kubernetes #yum install -y kubeadm-1.18.8-0 --disableexcludes=kubernetes #systemctl enable --now kubelet #systemctl status kubelet -l customer config.yaml cat < 有几率if you have iptable error echo 1 > /proc/sys/net/bridge/bridge-nf-call-iptables echo 1 > /proc/sys/net/bridge/bridge-nf-call-ip6tables change cgroup sed -i 's/cgroup-driver=systemd/cgroup-driver=cgroupfs/g' /etc/systemd/system/kubelet.service.d/10-kubeadm.conf systemctl daemon-reload && systemctl restart kubelet journalctl -f -u kubelet.service init cluster in master node kubeadm init --kubernetes-version=1.18.8 \ --apiserver-advertise-address=192.168.99.107 \ --service-cidr=10.10.0.0/16 \ --pod-network-cidr=10.122.0.0/16 \ --v=5 kube config prep mkdir -p $HOME/.kube sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config sudo chown $(id -u):$(id -g) $HOME/.kube/config install kuberouter kubectl apply -f cluster in worker node kubeadm join 192.168.99.107:6443 --token 81r96h.f0yj1z6l23gt0emh \ --discovery-token-ca-cert-hash sha256:567f3f2a5e3630d6063c954bda42f094dcdcdb93bc6ea620a73299dcb30ddfae \ --v=6 3 nodes cluster install calico network instead of kubernetes cni kubectl apply -f init \ --apiserver-advertise-address=192.168.99.107 \ --pod-network-cidr=10.122.0.0/16 \ --v=5 mkdir -p $HOME/.kube cp -i /etc/kubernetes/admin.conf $HOME/.kube/config chown $(id -u):$(id -g) $HOME/.kube/config echo export KUBECONFIG=~/.kube/config>> ~/.bashrc source ~/.bashrc kubectl apply -f join 192.168.99.107:6443 --token s0buim.93oefcuj5bglxl8k \ --discovery-token-ca-cert-hash sha256:55fa1f22b8679d8617e70cb8ff6827034e3eaadb0c72cb095337520ca513dcf4
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~