美文网首页
kubernetes集群搭建九: calicoctl

kubernetes集群搭建九: calicoctl

作者: 开始懂了90 | 来源:发表于2018-12-18 16:58 被阅读0次

    下载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.
    

    相关文章

      网友评论

          本文标题:kubernetes集群搭建九: calicoctl

          本文链接:https://www.haomeiwen.com/subject/comlkqtx.html