5

I found that my kubernetes cluster was sending reports to usage.projectcalico.org, how can this be disabled and how exactly is it using usage.projectcalico.org?

Alex Cohen
  • 5,596
  • 16
  • 54
  • 104

2 Answers2

3

Felix is the Calico component that sends usage information.

Felix can be configured to disable the usage ping.

Set the FELIX_USAGEREPORTINGENABLED environment variable can be to "false" (needs to be a string in yaml land!) in the calico-node DaemonSet

Set the UsageReportingEnabled field in the FelixConfiguration resource to false. This could be in etcd or in the Kubernetes API depending on what store you use. Both modifiable with calicoctl.

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

If you happen to be using kubespray, modifying this setting is a little harder as these variables are not exposed to Ansible, other than by manually modifying templates or yaml.

Matt
  • 68,711
  • 7
  • 155
  • 158
0

According to the source code:

    # 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)

And here is the definition of 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())
oz123
  • 27,559
  • 27
  • 125
  • 187