Skip to content

Commit

Permalink
format output
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhang Jun committed Jun 20, 2018
1 parent e97bf5e commit 84186a0
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 42 deletions.
8 changes: 5 additions & 3 deletions 04.部署etcd集群.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,10 @@ for node_ip in ${NODE_IPS[@]}

预期输出:

https://172.27.129.105:2379 is healthy: successfully committed proposal: took = 2.192932ms
https://172.27.129.111:2379 is healthy: successfully committed proposal: took = 3.546896ms
https://172.27.129.112:2379 is healthy: successfully committed proposal: took = 3.013667ms
``` bash
https://172.27.129.105:2379 is healthy: successfully committed proposal: took = 2.192932ms
https://172.27.129.111:2379 is healthy: successfully committed proposal: took = 3.546896ms
https://172.27.129.112:2379 is healthy: successfully committed proposal: took = 3.013667ms
```

输出均为 `healthy` 时表示集群服务正常。
22 changes: 12 additions & 10 deletions 07-1.docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,13 +157,15 @@ for node_ip in ${NODE_IPS[@]}

确认各 work 节点的 docker0 网桥和 flannel.1 接口的 IP 处于同一个网段中(如下 172.30.39.0 和 172.30.39.1):

3: flannel.1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UNKNOWN group default
link/ether ce:2f:d6:53:e5:f3 brd ff:ff:ff:ff:ff:ff
inet 172.30.39.0/32 scope global flannel.1
valid_lft forever preferred_lft forever
inet6 fe80::cc2f:d6ff:fe53:e5f3/64 scope link
valid_lft forever preferred_lft forever
4: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
link/ether 02:42:bf:65:16:5c brd ff:ff:ff:ff:ff:ff
inet 172.30.39.1/24 brd 172.30.39.255 scope global docker0
valid_lft forever preferred_lft forever
``` bash
3: flannel.1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UNKNOWN group default
link/ether ce:2f:d6:53:e5:f3 brd ff:ff:ff:ff:ff:ff
inet 172.30.39.0/32 scope global flannel.1
valid_lft forever preferred_lft forever
inet6 fe80::cc2f:d6ff:fe53:e5f3/64 scope link
valid_lft forever preferred_lft forever
4: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
link/ether 02:42:bf:65:16:5c brd ff:ff:ff:ff:ff:ff
inet 172.30.39.1/24 brd 172.30.39.255 scope global docker0
valid_lft forever preferred_lft forever
```
39 changes: 20 additions & 19 deletions 07-3.kube-proxy.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,23 +225,24 @@ for node_ip in ${NODE_IPS[@]}

预期输出:

>>> 172.27.129.105
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
TCP 10.254.0.1:443 rr persistent 10800
-> 172.27.129.105:6443 Masq 1 0 0
>>> 172.27.129.111
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
TCP 10.254.0.1:443 rr persistent 10800
-> 172.27.129.105:6443 Masq 1 0 0
>>> 172.27.129.112
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
TCP 10.254.0.1:443 rr persistent 10800
-> 172.27.129.105:6443 Masq 1 0 0

``` bash
>>> 172.27.129.105
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
TCP 10.254.0.1:443 rr persistent 10800
-> 172.27.129.105:6443 Masq 1 0 0
>>> 172.27.129.111
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
TCP 10.254.0.1:443 rr persistent 10800
-> 172.27.129.105:6443 Masq 1 0 0
>>> 172.27.129.112
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
TCP 10.254.0.1:443 rr persistent 10800
-> 172.27.129.105:6443 Masq 1 0 0
```
可见将所有到 kubernetes cluster ip 443 端口的请求都转发到 kube-apiserver 的 6443 端口;
1 change: 0 additions & 1 deletion 09-0.部署集群插件.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

插件是集群的附件组件,丰富和完善了集群的功能。


+ [09-1.coredns](./09-1.dns插件.md)
+ [09-2.Dashboard](./09-2.dashboard插件.md)
+ [09-3.Heapster (influxdb、grafana)](./09-3.heapster插件.md)
Expand Down
19 changes: 10 additions & 9 deletions 09-4.metrics-server插件.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,16 @@ scp metrics-server*.pem k8s@${MASTER_NODE}:/etc/kubernetes/cert/

添加如下配置参数:

--requestheader-client-ca-file=/etc/kubernetes/cert/ca.pem
--requestheader-allowed-names=""
--requestheader-extra-headers-prefix="X-Remote-Extra-"
--requestheader-group-headers=X-Remote-Group
--requestheader-username-headers=X-Remote-User
--proxy-client-cert-file=/etc/kubernetes/cert/metrics-server.pem
--proxy-client-key-file=/etc/kubernetes/cert/metrics-server-key.pem
--runtime-config=api/all=true

``` bash
--requestheader-client-ca-file=/etc/kubernetes/cert/ca.pem
--requestheader-allowed-names=""
--requestheader-extra-headers-prefix="X-Remote-Extra-"
--requestheader-group-headers=X-Remote-Group
--requestheader-username-headers=X-Remote-User
--proxy-client-cert-file=/etc/kubernetes/cert/metrics-server.pem
--proxy-client-key-file=/etc/kubernetes/cert/metrics-server-key.pem
--runtime-config=api/all=true
```
+ `--requestheader-XXX``--proxy-client-XXX` 是 kube-apiserver 的 aggregator layer 相关的配置参数,metrics-server & HPA 需要使用;
+ `--requestheader-client-ca-file`:用于签名 `--proxy-client-cert-file``--proxy-client-key-file` 指定的证书;在启用了 metric aggregator 时使用;
+ 如果 --requestheader-allowed-names 不为空,则--proxy-client-cert-file 证书的 CN 必须位于 allowed-names 中,默认为 aggregator;
Expand Down

0 comments on commit 84186a0

Please sign in to comment.