Skip to content

Commit

Permalink
apiserver: create clusterrolebinding after apiserver started
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhang Jun committed Jul 19, 2018
1 parent 646c19a commit fab6c19
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions 06-2.api-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,14 +214,6 @@ for node_ip in ${NODE_IPS[@]}

替换后的 unit 文件:[kube-apiserver.service](https://github.com/opsnull/follow-me-install-kubernetes-cluster/blob/master/systemd/kube-apiserver.service)

## 授予 kubernetes 证书访问 kubelet API 的权限

在执行 kubectl exec、run、logs 等命令时,apiserver 会转发到 kubelet。这里定义 RBAC 规则,授权 apiserver 调用 kubelet API。

``` bash
$ kubectl create clusterrolebinding kube-apiserver:kubelet-apis --clusterrole=system:kubelet-api-admin --user kubernetes
```

## 启动 kube-apiserver 服务

``` bash
Expand Down Expand Up @@ -299,6 +291,13 @@ tcp 0 0 172.27.129.105:6443 0.0.0.0:* LISTEN
+ 6443: 接收 https 请求的安全端口,对所有请求做认证和授权;
+ 由于关闭了非安全端口,故没有监听 8080;

## 授予 kubernetes 证书访问 kubelet API 的权限

在执行 kubectl exec、run、logs 等命令时,apiserver 会转发到 kubelet。这里定义 RBAC 规则,授权 apiserver 调用 kubelet API。

``` bash
$ kubectl create clusterrolebinding kube-apiserver:kubelet-apis --clusterrole=system:kubelet-api-admin --user kubernetes
```

## 参考

Expand Down

0 comments on commit fab6c19

Please sign in to comment.