kubernetes集群搭建九: calicoctl

2018-12-18  本文已影响0人  开始懂了90

下载calicoctl

# 注意下载对应的calico的版本
wget https://github.com/projectcalico/calicoctl/releases/download/v3.2.4/calicoctl

添加执行权限

chmod +x calicoctl && mv calicoctl /usr/local/bin/

编辑calico配置文件

cat >/etc/calico/calicoctl.cfg <<EOF
apiVersion: projectcalico.org/v3
kind: CalicoAPIConfig
metadata:
spec:
  datastoreType: "etcdv3"
  etcdEndpoints: "https://10.39.7.51:2379,https://10.39.7.52:2379,https://10.39.7.57:2379"
  etcdKeyFile: "/etc/kubernetes/ssl/etcd-key.pem"
  etcdCertFile: "/etc/kubernetes/ssl/etcd.pem"
EOF

测试calicotctl

[root@k8s-master-51 ~]# calicoctl node status
Calico process is running.

IPv4 BGP status
+--------------+-------------------+-------+----------+-------------+
| PEER ADDRESS |     PEER TYPE     | STATE |  SINCE   |    INFO     |
+--------------+-------------------+-------+----------+-------------+
| 10.39.7.52   | node-to-node mesh | up    | 09:01:27 | Established |
| 10.39.7.57   | node-to-node mesh | up    | 09:07:12 | Established |
+--------------+-------------------+-------+----------+-------------+

IPv6 BGP status
No IPv6 peers found.
上一篇下一篇

猜你喜欢

热点阅读