1. 安装 etcd , kubernetes.
sudo yum install -y etcd kubernetes
2. 修改配置文件
sudo vim /etc/sysconfig/docker
OPTIONS 内容设置为 :
OPTIONS='--selinux-enabled=false --insecure-registry gcr.io'
sudo vim /etc/kubernetes/apiserver
把 --admission_control参数中的 ServiceAccount删除。
或者
ref: https://blog.csdn.net/a506681571/article/details/86087456
Generate a signing key:
openssl genrsa -out /tmp/serviceaccount.key 2048
Update /etc/kubernetes/apiserver:
KUBE_API_ARGS="--service_account_key_file=/tmp/serviceaccount.key"
Update /etc/kubernetes/controller-manager:
KUBE_CONTROLLER_MANAGER_ARGS="--service_account_private_key_file=/tmp/serviceaccount.key"
3,按顺序启动所有服务:
sudo systemctl start etcd
sudo systemctl start docker
sudo systemctl start kube-apiserver
sudo systemctl start kube-controller-manager
sudo systemctl start kube-scheduler
sudo systemctl start kubelet
sudo systemctl start kube-proxy