Skip to content

Commit

Permalink
fix typing
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhang Jun committed Jul 18, 2018
1 parent f4de6be commit c05624d
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 4 deletions.
10 changes: 9 additions & 1 deletion 01.系统初始化和全局变量.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ $ vagrant up

## 主机名

设置永久主机名称,然后重新登录:

``` bash
$ sudo hostnamectl set-hostname kube-node1 # 将 kube-node1 替换为当前主机名
```
+ 设置的主机名保存在 `/etc/hostname` 文件中;

修改每台机器的 `/etc/hosts` 文件,添加主机名和 IP 的对应关系:

``` bash
Expand All @@ -36,6 +43,7 @@ $ grep kube-node /etc/hosts

``` bash
$ sudo useradd -m k8s
$ sudo sh -c 'echo 123456 | passwd k8s --stdin' # 为 k8s 账户设置密码
$ sudo visudo
$ sudo grep '%wheel.*NOPASSWD: ALL' /etc/sudoers
%wheel ALL=(ALL) NOPASSWD: ALL
Expand Down Expand Up @@ -237,7 +245,7 @@ export NODE_NAMES=(kube-node1 kube-node2 kube-node3)
export MASTER_VIP=172.27.129.253

# kube-apiserver VIP 地址(HA 组件 haproxy 监听 8443 端口)
export KUBE_APISERVER="https://${MASTER_IP}:8443"
export KUBE_APISERVER="https://${MASTER_VIP}:8443"

# HA 节点,VIP 所在的网络接口名称
export VIP_IF="eth0"
Expand Down
2 changes: 1 addition & 1 deletion 03.部署kubectl命令行工具.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ kubectl config use-context kubernetes --kubeconfig=kubectl.kubeconfig

## 分发 kubeconfig 文件

分发到所有使用 `kubelet` 命令的节点:
分发到所有使用 `kubectl` 命令的节点:

``` bash
source /opt/k8s/bin/environment.sh
Expand Down
3 changes: 3 additions & 0 deletions 07-2.kubelet.md
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,9 @@ rules:
apiGroup: rbac.authorization.k8s.io
EOF
```
+ auto-approve-csrs-for-group:自动 approve node 的第一次 CSR; 注意第一次 CSR 时,请求的 Group 为 system:bootstrappers
+ node-client-cert-renewal:自动 approve node 后续过期的 client 证书,自动生成的证书 Group 为 system:nodes;
+ node-server-cert-renewal:自动 approve node 后续过期的 server 证书,自动生成的证书 Group 为 system:nodes;

生效配置:

Expand Down
2 changes: 1 addition & 1 deletion A.浏览器访问kube-apiserver安全端口.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

这是因为 kube-apiserver 的 server 证书是我们创建的根证书 ca.pem 签名的,需要将根证书 ca.pem 导入操作系统,并设置永久信任。对于 Mac,操作如下:

![ssl-failed](images/keychain.png)
![keychain](images/keychain.png)

再次访问 https://172.27.129.105:6443/,已信任,但提示 401,未授权的访问:

Expand Down
2 changes: 1 addition & 1 deletion manifests/environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export NODE_NAMES=(kube-node1 kube-node2 kube-node3)
export MASTER_VIP=172.27.129.253

# kube-apiserver VIP 地址(HA 组件 haproxy 监听 8443 端口)
export KUBE_APISERVER="https://${MASTER_IP}:8443"
export KUBE_APISERVER="https://${MASTER_VIP}:8443"

# HA 节点,配置 VIP 的网络接口名称
export VIP_IF="eth0"
Expand Down
3 changes: 3 additions & 0 deletions systemd/docker.service
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ LimitNPROC=infinity
LimitCORE=infinity
Delegate=yes
KillMode=process
# Uncomment TasksMax if your systemd version supports it.
# Only systemd 226 and above support this version.
TasksMax=infinity

[Install]
WantedBy=multi-user.target

0 comments on commit c05624d

Please sign in to comment.