centos install kubernetes (standalone)

单机版kubernetes

1. 安装 etcd , kubernetes.

1
sudo yum install -y etcd kubernetes

2. 修改配置文件

1
sudo  vim /etc/sysconfig/docker

OPTIONS 内容设置为 :

1
OPTIONS='--selinux-enabled=false --insecure-registry gcr.io'
1
sudo vim /etc/kubernetes/apiserver 
1
把 --admission_control参数中的 ServiceAccount删除。

或者

ref: https://blog.csdn.net/a506681571/article/details/86087456
Generate a signing key:

1
openssl genrsa -out /tmp/serviceaccount.key 2048

Update /etc/kubernetes/apiserver:

1
KUBE_API_ARGS="--service_account_key_file=/tmp/serviceaccount.key"

Update /etc/kubernetes/controller-manager:

1
KUBE_CONTROLLER_MANAGER_ARGS="--service_account_private_key_file=/tmp/serviceaccount.key"

3,按顺序启动所有服务:

1
2
3
4
5
6
7
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

参考文章

评论