k8s官方安装版本

时间:2021-12-24 22:10:31

一、概述

  官方安装链接:https://kubernetes.io/docs/getting-started-guides/kubeadm/

  之前使用是yum直接安装组件,现由kubeadm来自动安装配置;

二、安装(centos7为例)

 yum update
cat <<EOF > /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=http://yum.kubernetes.io/repos/kubernetes-el7-x86_64
enabled=
gpgcheck=
repo_gpgcheck=
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg
https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
EOF
setenforce
yum install -y docker kubelet kubeadm kubectl kubernetes-cni
systemctl enable docker && systemctl start docker
systemctl enable kubelet && systemctl start kubelet