docker安装
删除依赖包
sudo yum remove docker
docker-client
docker-client-latest
docker-common
docker-latest
docker-latest-logrotate
docker-logrotate
docker-selinux
docker-engine-selinux
docker-engine
安装依赖包
sudo yum install -y yum-utils
device-mapper-persistent-data
lvm2
设置yum源
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
安装docker命令
$ sudo yum makecache fast
$ sudo yum install docker-ce
docker开机启动和开启命令
$ sudo systemctl enable docker
$ sudo systemctl start docker
测试后安装成功
docker run hello-world
k8s安装
kubeadm工具安装
设置yum源
[kubernetes]
name=Kubernetes
baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64
enabled=1
gpgcheck=0
安装kubeadm
yum install -y kubelet kubeadm kubectl --disableexcludes=kubernetes
设置kubeadm开机启动
systemctl enable kubelet && systemctl start kubelet
设置docker开机启动
systemctl enable docker && systemctl start docker
kubeadm config
初始化一个配置文件
kubeadm config print init-defaults > init.default.yaml
可以对文件进行编辑按需生成合适的配置定制仓库地址用
apiVersion: kubeadm.k8s.io/v1beta1
kind: ClusterConfiguration
imageRepository: docker.io/dustise
kubernetesVersion: v1.14.0
networking:
podSubnet: "192.168.0.0/16"
下载相关镜像
kubeadm config images pull --config=init -config.yaml