Skip to main content
Calico Open Source 3.31 (latest) documentation

Configuring Felix

tip

The following tables detail the configuration file and environment variable parameters. For FelixConfiguration resource settings, refer to Felix Configuration Resource.

Configuration for Felix is read from one of four possible locations, in order, as follows.

  1. Environment variables.
  2. The Felix configuration file.
  3. Host-specific FelixConfiguration resources (node.<nodename>).
  4. The global FelixConfiguration resource (default).

The value of any configuration parameter is the value read from the first location containing a value. For example, if an environment variable contains a value, it takes top precedence.

If not set in any of these locations, most configuration parameters have defaults, and it should be rare to have to explicitly set them.

The full list of parameters which can be set is as follows.

Spec

Datastore connection

DatastoreType

AttributeValue
KeyDatastoreType
Description

Controls which datastore driver Felix will use. Typically, this is detected from the environment and it does not need to be set manually. (For example, if KUBECONFIG is set, the kubernetes datastore driver will be used by default).

SchemaOne of: etcdv3, kubernetes (case insensitive)
Defaultetcdv3

EtcdAddr

AttributeValue
KeyEtcdAddr
Description

When using the etcdv3 datastore driver, the etcd server and port to connect to. If EtcdEndpoints is also specified, it takes precedence.

SchemaString matching regex ^[^:/]+:\d+$
Default127.0.0.1:2379

EtcdCaFile

AttributeValue
KeyEtcdCaFile
Description

When using the etcdv3 datastore driver, path to TLS CA file to use when connecting to etcd. If the CA file is specified, the other TLS parameters are mandatory.

SchemaPath to file, which must exist
Defaultnone

EtcdCertFile

AttributeValue
KeyEtcdCertFile
Description

When using the etcdv3 datastore driver, path to TLS certificate file to use when connecting to etcd. If the certificate file is specified, the other TLS parameters are mandatory.

SchemaPath to file, which must exist
Defaultnone

EtcdEndpoints

AttributeValue
KeyEtcdEndpoints
Description

When using the etcdv3 datastore driver, comma-delimited list of etcd endpoints to connect to, replaces EtcdAddr and EtcdScheme.

SchemaList of HTTP endpoints: comma-delimited list of http(s)://hostname:port
Defaultnone

EtcdKeyFile

AttributeValue
KeyEtcdKeyFile
Description

When using the etcdv3 datastore driver, path to TLS private key file to use when connecting to etcd. If the key file is specified, the other TLS parameters are mandatory.

SchemaPath to file, which must exist
Defaultnone

EtcdScheme

AttributeValue
KeyEtcdScheme
Description

EtcdAddr: when using the etcdv3 datastore driver, the URL scheme to use. If EtcdEndpoints is also specified, it takes precedence.

SchemaOne of: http, https (case insensitive)
Defaulthttp

FelixHostname

AttributeValue
KeyFelixHostname
Description

The name of this node, used to identify resources in the datastore that belong to this node. Auto-detected from the node's hostname if not provided.

SchemaString matching regex ^[a-zA-Z0-9_.-]+$
Defaultnone

TyphaAddr

AttributeValue
KeyTyphaAddr
Description

If set, tells Felix to connect to Typha at the given address and port. Overrides TyphaK8sServiceName.

SchemaString matching regex ^[^:/]+:\d+$
Defaultnone

TyphaCAFile

AttributeValue
KeyTyphaCAFile
Description

Path to the TLS CA file to use when communicating with Typha. If this parameter is specified, the other TLS parameters must also be specified.

SchemaPath to file, which must exist
Defaultnone

TyphaCN

AttributeValue
KeyTyphaCN
Description

Common name to use when authenticating to Typha over TLS. If any TLS parameters are specified then one of TyphaCN and TyphaURISAN must be set.

SchemaString
Defaultnone

TyphaCertFile

AttributeValue
KeyTyphaCertFile
Description

Path to the TLS certificate to use when communicating with Typha. If this parameter is specified, the other TLS parameters must also be specified.

SchemaPath to file, which must exist
Defaultnone

TyphaK8sNamespace

AttributeValue
KeyTyphaK8sNamespace
Description

Namespace to look in when looking for Typha's service (see TyphaK8sServiceName).

SchemaString
Defaultkube-system

TyphaK8sServiceName

AttributeValue
KeyTyphaK8sServiceName
Description

If set, tells Felix to connect to Typha by looking up the Endpoints of the given Kubernetes Service in namespace specified by TyphaK8sNamespace.

SchemaString
Defaultnone

TyphaKeyFile

AttributeValue
KeyTyphaKeyFile
Description

Path to the TLS private key to use when communicating with Typha. If this parameter is specified, the other TLS parameters must also be specified.

SchemaPath to file, which must exist
Defaultnone

TyphaReadTimeout

AttributeValue
KeyTyphaReadTimeout
Description

Read timeout when reading from the Typha connection. If typha sends no data for this long, Felix will exit and restart. (Note that Typha sends regular pings so traffic is always expected.)

SchemaSeconds (floating point)
Default30

TyphaURISAN

AttributeValue
KeyTyphaURISAN
Description

URI SAN to use when authenticating to Typha over TLS. If any TLS parameters are specified then one of TyphaCN and TyphaURISAN must be set.

SchemaString
Defaultnone

TyphaWriteTimeout

AttributeValue
KeyTyphaWriteTimeout
Description

Write timeout when writing data to Typha.

SchemaSeconds (floating point)
Default10

Process: Feature detection/overrides

FeatureDetectOverride

AttributeValue
KeyFeatureDetectOverride
Description

Used to override feature detection based on auto-detected platform capabilities. Values are specified in a comma separated list with no spaces, example; "SNATFullyRandom=true,MASQFullyRandom=false,RestoreSupportsLock=". A value of "true" or "false" will force enable/disable feature, empty or omitted values fall back to auto-detection.

SchemaComma-delimited list of key=value pairs
Defaultnone

FeatureGates

AttributeValue
KeyFeatureGates
Description

Used to enable or disable tech-preview Calico features. Values are specified in a comma separated list with no spaces, example; "BPFConnectTimeLoadBalancingWorkaround=enabled,XyZ=false". This is used to enable features that are not fully production ready.

SchemaComma-delimited list of key=value pairs
Defaultnone

Process: Go runtime

GoGCThreshold

AttributeValue
KeyGoGCThreshold
Description

Sets the Go runtime's garbage collection threshold. I.e. the percentage that the heap is allowed to grow before garbage collection is triggered. In general, doubling the value halves the CPU time spent doing GC, but it also doubles peak GC memory overhead. A special value of -1 can be used to disable GC entirely; this should only be used in conjunction with the GoMemoryLimitMB setting.

This setting is overridden by the GOGC environment variable.

SchemaInteger: [-1,263-1]
Default40

GoMaxProcs

AttributeValue
KeyGoMaxProcs
Description

Sets the maximum number of CPUs that the Go runtime will use concurrently. A value of -1 means "use the system default"; typically the number of real CPUs on the system.

this setting is overridden by the GOMAXPROCS environment variable.

SchemaInteger: [-1,263-1]
Default-1

GoMemoryLimitMB

AttributeValue
KeyGoMemoryLimitMB
Description

Sets a (soft) memory limit for the Go runtime in MB. The Go runtime will try to keep its memory usage under the limit by triggering GC as needed. To avoid thrashing, it will exceed the limit if GC starts to take more than 50% of the process's CPU time. A value of -1 disables the memory limit.

Note that the memory limit, if used, must be considerably less than any hard resource limit set at the container or pod level. This is because felix is not the only process that must run in the container or pod.

This setting is overridden by the GOMEMLIMIT environment variable.

SchemaInteger: [-1,263-1]
Default-1

Process: Health port and timeouts

HealthEnabled

AttributeValue
KeyHealthEnabled
Description

If set to true, enables Felix's health port, which provides readiness and liveness endpoints.

SchemaBoolean: true, 1, yes, y, t accepted as True; false, 0, no, n, f accepted (case insensitively) as False.
Defaultfalse

HealthHost

AttributeValue
KeyHealthHost
Description

The host that the health server should bind to.

SchemaString matching regex ^[a-zA-Z0-9:._+-]{1,64}$
Defaultlocalhost

HealthPort

AttributeValue
KeyHealthPort
Description

The TCP port that the health server should bind to.

SchemaInteger: [0,65535]
Default9099

HealthTimeoutOverrides

AttributeValue
KeyHealthTimeoutOverrides
Description

Allows the internal watchdog timeouts of individual subcomponents to be overridden. This is useful for working around "false positive" liveness timeouts that can occur in particularly stressful workloads or if CPU is constrained. For a list of active subcomponents, see Felix's logs.

SchemaComma-delimited list of <key>=<duration> pairs, where durations use Go's standard format (e.g. 1s, 1m, 1h3m2s)
Defaultnone

Process: Logging

LogActionRateLimit

AttributeValue
KeyLogActionRateLimit
Description

Sets the rate of hitting a Log action. The value must be in the format "N/unit", where N is a number and unit is one of: second, minute, hour, or day. For example: "10/second" or "100/hour".

SchemaString matching regex ^([1-9]\d{0,3}/(?:second|minute|hour|day))?$
Defaultnone

LogActionRateLimitBurst

AttributeValue
KeyLogActionRateLimitBurst
Description

Sets the rate limit burst of hitting a Log action when LogActionRateLimit is enabled.

SchemaInteger: [0,263-1], [9999,263-1]
Default5

LogDebugFilenameRegex

AttributeValue
KeyLogDebugFilenameRegex
Description

Controls which source code files have their Debug log output included in the logs. Only logs from files with names that match the given regular expression are included. The filter only applies to Debug level logs.

SchemaRegular expression
Defaultnone

LogFilePath

AttributeValue
KeyLogFilePath
Description

The full path to the Felix log. Set to none to disable file logging.

SchemaPath to file
Default/var/log/calico/felix.log

LogPrefix

AttributeValue
KeyLogPrefix
Description

The log prefix that Felix uses when rendering LOG rules. It is possible to use the following specifiers to include extra information in the log prefix. - %t: Tier name. - %k: Kind (short names). - %n: Policy or profile name. - %p: Policy or profile name (namespace/name for namespaced kinds or just name for non namespaced kinds). Calico includes ": " characters at the end of the generated log prefix. Note that iptables shows up to 29 characters for the log prefix and nftables up to 127 characters. Extra characters are truncated.

SchemaString
Defaultcalico-packet

LogSeverityFile

AttributeValue
KeyLogSeverityFile
Description

The log severity above which logs are sent to the log file.

SchemaOne of: DEBUG, ERROR, FATAL, INFO, TRACE, WARNING (case insensitive)
DefaultINFO

LogSeverityScreen

AttributeValue
KeyLogSeverityScreen
Description

The log severity above which logs are sent to the stdout.

SchemaOne of: DEBUG, ERROR, FATAL, INFO, TRACE, WARNING (case insensitive)
DefaultINFO

LogSeveritySys

AttributeValue
KeyLogSeveritySys
Description

The log severity above which logs are sent to the syslog. Set to None for no logging to syslog.

SchemaOne of: DEBUG, ERROR, FATAL, INFO, TRACE, WARNING (case insensitive)
DefaultINFO

Process: Prometheus metrics

PrometheusGoMetricsEnabled

AttributeValue
KeyPrometheusGoMetricsEnabled
Description

Disables Go runtime metrics collection, which the Prometheus client does by default, when set to false. This reduces the number of metrics reported, reducing Prometheus load.

SchemaBoolean: true, 1, yes, y, t accepted as True; false, 0, no, n, f accepted (case insensitively) as False.
Defaulttrue

PrometheusMetricsEnabled

AttributeValue
KeyPrometheusMetricsEnabled
Description

Enables the Prometheus metrics server in Felix if set to true.

SchemaBoolean: true, 1, yes, y, t accepted as True; false, 0, no, n, f accepted (case insensitively) as False.
Defaultfalse

PrometheusMetricsHost

AttributeValue
KeyPrometheusMetricsHost
Description

The host that the Prometheus metrics server should bind to.

SchemaString matching regex ^[a-zA-Z0-9:._+-]{1,64}$
Defaultnone

PrometheusMetricsPort

AttributeValue
KeyPrometheusMetricsPort
Description

The TCP port that the Prometheus metrics server should bind to.

SchemaInteger: [0,65535]
Default9091

PrometheusProcessMetricsEnabled

AttributeValue
KeyPrometheusProcessMetricsEnabled
Description

Disables process metrics collection, which the Prometheus client does by default, when set to false. This reduces the number of metrics reported, reducing Prometheus load.

SchemaBoolean: true, 1, yes, y, t accepted as True; false, 0, no, n, f accepted (case insensitively) as False.
Defaulttrue

PrometheusWireGuardMetricsEnabled

AttributeValue
KeyPrometheusWireGuardMetricsEnabled
Description

Disables WireGuard metrics collection, which the Prometheus client does by default, when set to false. This reduces the number of metrics reported, reducing Prometheus load.

SchemaBoolean: true, 1, yes, y, t accepted as True; false, 0, no, n, f accepted (case insensitively) as False.
Defaulttrue

Data plane: Common

No matching group found for 'Dataplane: Common'.

Data plane: iptables

No matching group found for 'Dataplane: iptables'.

Data plane: nftables

No matching group found for 'Dataplane: nftables'.

Data plane: eBPF

No matching group found for 'Dataplane: eBPF'.

Data plane: Windows

No matching group found for 'Dataplane: Windows'.

Data plane: OpenStack support

No matching group found for 'Dataplane: OpenStack support'.

Data plane: XDP acceleration for iptables data plane

No matching group found for 'Dataplane: XDP acceleration for iptables dataplane'.

Overlay: VXLAN overlay

VXLANEnabled

AttributeValue
KeyVXLANEnabled
Description

Overrides whether Felix should create the VXLAN tunnel device for IPv4 VXLAN networking. Optional as Felix determines this based on the existing IP pools.

SchemaBoolean: true, 1, yes, y, t accepted as True; false, 0, no, n, f accepted (case insensitively) as False.
Defaultnone

VXLANMTU

AttributeValue
KeyVXLANMTU
Description

The MTU to set on the IPv4 VXLAN tunnel device. Optional as Felix auto-detects the MTU based on the MTU of the host's interfaces.

SchemaInteger
Default0

VXLANMTUV6

AttributeValue
KeyVXLANMTUV6
Description

The MTU to set on the IPv6 VXLAN tunnel device. Optional as Felix auto-detects the MTU based on the MTU of the host's interfaces.

SchemaInteger
Default0

VXLANPort

AttributeValue
KeyVXLANPort
Description

The UDP port number to use for VXLAN traffic.

SchemaInteger
Default4789

VXLANVNI

AttributeValue
KeyVXLANVNI
Description

The VXLAN VNI to use for VXLAN traffic. You may need to change this if the default value is in use on your system.

SchemaInteger
Default4096

Overlay: IP-in-IP

IpInIpEnabled

AttributeValue
KeyIpInIpEnabled
Description

Overrides whether Felix should configure an IPIP interface on the host. Optional as Felix determines this based on the existing IP pools.

SchemaBoolean: true, 1, yes, y, t accepted as True; false, 0, no, n, f accepted (case insensitively) as False.
Defaultnone

IpInIpMtu

AttributeValue
KeyIpInIpMtu
Description

Controls the MTU to set on the IPIP tunnel device. Optional as Felix auto-detects the MTU based on the MTU of the host's interfaces.

SchemaInteger
Default0

Overlay: WireGuard

WireguardEnabled

AttributeValue
KeyWireguardEnabled
Description

Controls whether Wireguard is enabled for IPv4 (encapsulating IPv4 traffic over an IPv4 underlay network).

SchemaBoolean: true, 1, yes, y, t accepted as True; false, 0, no, n, f accepted (case insensitively) as False.
Defaultfalse

WireguardEnabledV6

AttributeValue
KeyWireguardEnabledV6
Description

Controls whether Wireguard is enabled for IPv6 (encapsulating IPv6 traffic over an IPv6 underlay network).

SchemaBoolean: true, 1, yes, y, t accepted as True; false, 0, no, n, f accepted (case insensitively) as False.
Defaultfalse

WireguardHostEncryptionEnabled

AttributeValue
KeyWireguardHostEncryptionEnabled
Description

Controls whether Wireguard host-to-host encryption is enabled.

SchemaBoolean: true, 1, yes, y, t accepted as True; false, 0, no, n, f accepted (case insensitively) as False.
Defaultfalse

WireguardInterfaceName

AttributeValue
KeyWireguardInterfaceName
Description

Specifies the name to use for the IPv4 Wireguard interface.

SchemaString matching regex ^[a-zA-Z0-9:._+-]{1,15}$
Defaultwireguard.cali

WireguardInterfaceNameV6

AttributeValue
KeyWireguardInterfaceNameV6
Description

Specifies the name to use for the IPv6 Wireguard interface.

SchemaString matching regex ^[a-zA-Z0-9:._+-]{1,15}$
Defaultwg-v6.cali

WireguardListeningPort

AttributeValue
KeyWireguardListeningPort
Description

Controls the listening port used by IPv4 Wireguard.

SchemaInteger
Default51820

WireguardListeningPortV6

AttributeValue
KeyWireguardListeningPortV6
Description

Controls the listening port used by IPv6 Wireguard.

SchemaInteger
Default51821

WireguardMTU

AttributeValue
KeyWireguardMTU
Description

Controls the MTU on the IPv4 Wireguard interface. See Configuring MTU.

SchemaInteger
Default0

WireguardMTUV6

AttributeValue
KeyWireguardMTUV6
Description

Controls the MTU on the IPv6 Wireguard interface. See Configuring MTU.

SchemaInteger
Default0

WireguardPersistentKeepAlive

AttributeValue
KeyWireguardPersistentKeepAlive
Description

Controls Wireguard PersistentKeepalive option. Set 0 to disable.

SchemaSeconds (floating point)
Default0 (0s)

WireguardRoutingRulePriority

AttributeValue
KeyWireguardRoutingRulePriority
Description

Controls the priority value to use for the Wireguard routing rule.

SchemaInteger
Default99

WireguardThreadingEnabled

AttributeValue
KeyWireguardThreadingEnabled
Description

Controls whether Wireguard has Threaded NAPI enabled. This increases the maximum number of packets a Wireguard interface can process. Consider threaded NAPI only if you have high packets per second workloads that are causing dropping packets due to a saturated softirq CPU core. There is a [known issue](https://lore.kernel.org/netdev/CALrw=nEoT2emQ0OAYCjM1d_6Xe_kNLSZ6dhjb5FxrLFYh4kozA@mail.gmail.com/T/) with this setting that may cause NAPI to get stuck holding the global rtnl_mutex when a peer is removed. Workaround: Make sure your Linux kernel [includes this patch](https://github.com/torvalds/linux/commit/56364c910691f6d10ba88c964c9041b9ab777bd6) to unwedge NAPI.

SchemaBoolean: true, 1, yes, y, t accepted as True; false, 0, no, n, f accepted (case insensitively) as False.
Defaultfalse

AWS integration

AWSSrcDstCheck

AttributeValue
KeyAWSSrcDstCheck
Description

Controls whether Felix will try to change the "source/dest check" setting on the EC2 instance on which it is running. A value of "Disable" will try to disable the source/dest check. Disabling the check allows for sending workload traffic without encapsulation within the same AWS subnet.

SchemaOne of: Disable, DoNothing, Enable (case insensitive)
DefaultDoNothing

Debug/test-only (generally unsupported)

DebugBPFCgroupV2

AttributeValue
KeyDebugBPFCgroupV2
Description

Controls the cgroup v2 path that we apply the connect-time load balancer to. Most distros are configured for cgroup v1, which prevents all but the root cgroup v2 from working so this is only useful for development right now.

SchemaString
Defaultnone

DebugCPUProfilePath

AttributeValue
KeyDebugCPUProfilePath
Description

Unsupported diagnostic setting, used when testing Felix. Not exposed in FelixConfiguration.

SchemaPath to file
Default/tmp/felix-cpu-<timestamp>.pprof

DebugDisableLogDropping

AttributeValue
KeyDebugDisableLogDropping
Description

Disables the dropping of log messages when the log buffer is full. This can significantly impact performance if log write-out is a bottleneck.

SchemaBoolean: true, 1, yes, y, t accepted as True; false, 0, no, n, f accepted (case insensitively) as False.
Defaultfalse

DebugHost

AttributeValue
KeyDebugHost
Description

The host IP or hostname to bind the debug port to. Only used if DebugPort is set.

SchemaString matching regex ^[a-zA-Z0-9:._+-]{1,64}$
Defaultlocalhost

DebugMemoryProfilePath

AttributeValue
KeyDebugMemoryProfilePath
Description

The path to write the memory profile to when triggered by signal.

SchemaPath to file
Defaultnone

DebugPanicAfter

AttributeValue
KeyDebugPanicAfter
Description

Unsupported diagnostic setting, used when testing Felix. Not exposed in FelixConfiguration.

SchemaSeconds (floating point)
Default0

DebugPort

AttributeValue
KeyDebugPort
Description

If set, enables Felix's debug HTTP port, which allows memory and CPU profiles to be retrieved. The debug port is not secure, it should not be exposed to the internet.

SchemaInteger: [0,65535]
Defaultnone

DebugSimulateCalcGraphHangAfter

AttributeValue
KeyDebugSimulateCalcGraphHangAfter
Description

Used to simulate a hang in the calculation graph after the specified duration. This is useful in tests of the watchdog system only!

SchemaSeconds (floating point)
Default0 (0s)

DebugSimulateDataRace

AttributeValue
KeyDebugSimulateDataRace
Description

Unsupported diagnostic setting, used when testing Felix. Not exposed in FelixConfiguration.

SchemaBoolean: true, 1, yes, y, t accepted as True; false, 0, no, n, f accepted (case insensitively) as False.
Defaultfalse

DebugSimulateDataplaneApplyDelay

AttributeValue
KeyDebugSimulateDataplaneApplyDelay
Description

Adds an artificial delay to every dataplane operation. This is useful for simulating a heavily loaded system for test purposes only.

SchemaSeconds (floating point)
Default0 (0s)

DebugSimulateDataplaneHangAfter

AttributeValue
KeyDebugSimulateDataplaneHangAfter
Description

Used to simulate a hang in the dataplane after the specified duration. This is useful in tests of the watchdog system only!

SchemaSeconds (floating point)
Default0 (0s)

Usage reporting

UsageReportingEnabled

AttributeValue
KeyUsageReportingEnabled
Description

Reports anonymous Calico version number and cluster size to projectcalico.org. Logs warnings returned by the usage server. For example, if a significant security vulnerability has been discovered in the version of Calico being used.

SchemaBoolean: true, 1, yes, y, t accepted as True; false, 0, no, n, f accepted (case insensitively) as False.
Defaulttrue

UsageReportingInitialDelaySecs

AttributeValue
KeyUsageReportingInitialDelaySecs
Description

Controls the minimum delay before Felix makes a report.

SchemaSeconds (floating point)
Default300 (5m0s)

UsageReportingIntervalSecs

AttributeValue
KeyUsageReportingIntervalSecs
Description

Controls the interval at which Felix makes reports.

SchemaSeconds (floating point)
Default86400 (24h0m0s)

Environment variables

The highest priority of configuration is that read from environment variables. To set a configuration parameter via an environment variable, set the environment variable formed by taking FELIX_ and appending the uppercase form of the variable name. For example, to set the etcd address, set the environment variable FELIX_ETCDADDR. Other examples include FELIX_ETCDSCHEME, FELIX_ETCDKEYFILE, FELIX_ETCDCERTFILE, FELIX_ETCDCAFILE, FELIX_FELIXHOSTNAME, FELIX_LOGFILEPATH and FELIX_METADATAADDR.

note

To set a parameter to an empty value using an environment variable, assign an empty string to it (e.g., FELIX_FAILSAFEINBOUNDHOSTPORTS="").

Configuration file

On startup, Felix reads an ini-style configuration file. The path to this file defaults to /etc/calico/felix.cfg but can be overridden using the -c or --config-file options on the command line. If the file exists, then it is read (ignoring section names) and all parameters are set from it.

In OpenStack, we recommend putting all configuration into configuration files, since the etcd database is transient (and may be recreated by the OpenStack plugin in certain error cases). However, in a Docker environment the use of environment variables or etcd is often more convenient.

Datastore

Felix also reads configuration parameters from the datastore. It supports a global setting and a per-host override.

  1. Get the current felixconfig settings.

    calicoctl get felixconfig default -o yaml --export > felix.yaml
  2. Modify logFilePath to your intended path, e.g. "/tmp/felix.log"

    vim felix.yaml
    tip

    For a global change set name to "default". For a node-specific change: set name to node.<nodename>, e.g. "node.Calico-node-1"

  3. Replace the current felixconfig settings

    calicoctl replace -f felix.yaml

For more information, see Felix Configuration Resource.