5

我发现我的 kubernetes 集群正在向 usage.projectcalico.org 发送报告,如何禁用它以及使用 usage.projectcalico.org 的具体情况如何?

4

2 回答 2

3

Felix 是发送使用信息的 Calico 组件。

Felix 可以配置为禁用使用 ping。

在DaemonSet中设置FELIX_USAGEREPORTINGENABLED环境变量可以是"false"(需要是 yaml 中的字符串!)calico-node

FelixConfiguration资源中的UsageReportingEnabled字段设置为。这可能在 etcd 或 Kubernetes API 中,具体取决于您使用的存储。两者都可以用.falsecalicoctl

calicoctl patch felixConfiguration default \
  --patch='{"spec": {"UsageReportingEnabled": false}}'

如果你碰巧使用 kubespray,修改这个设置会有点困难,因为这些变量不会暴露给 Ansible,除了手动修改模板yaml

于 2019-05-23T04:07:27.770 回答
0

根据源代码:

    # Disable Usage Reporting to usage.projectcalico.org
    # We want to avoid polluting analytics data with unit test noise
    curl_etcd("calico/v1/config/UsageReportingEnabled",
                   options=["-XPUT -d value=False"], ip=ip)

这是curl_etcd

def curl_etcd(path, options=None, recursive=True, ip=None):
    """
    Perform a curl to etcd, returning JSON decoded response.
    :param path:  The key path to query
    :param options:  Additional options to include in the curl
    :param recursive:  Whether we want recursive query or not
    :return:  The JSON decoded response.
    """
    if options is None:
        options = []
    if ETCD_SCHEME == "https":
        # Etcd is running with SSL/TLS, require key/certificates
        rc = check_output(
            "curl --cacert %s --cert %s --key %s "
            "-sL https://%s:2379/v2/keys/%s?recursive=%s %s"
            % (ETCD_CA, ETCD_CERT, ETCD_KEY, ETCD_HOSTNAME_SSL,
               path, str(recursive).lower(), " ".join(options)),
            shell=True)
    else:
        rc = check_output(
            "curl -sL http://%s:2379/v2/keys/%s?recursive=%s %s"
            % (ip, path, str(recursive).lower(), " ".join(options)),
            shell=True)

    return json.loads(rc.strip())
于 2019-05-22T18:11:48.290 回答