github.com/tigera/api@v0.0.0-20240320170621-278e89a8c5fb/pkg/apis/projectcalico/v3/felixconfig.go (about) 1 // Copyright (c) 2017-2022 Tigera, Inc. All rights reserved. 2 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 package v3 16 17 import ( 18 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 19 20 "github.com/tigera/api/pkg/lib/numorstring" 21 ) 22 23 // +genclient:nonNamespaced 24 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 25 26 // FelixConfigurationList contains a list of FelixConfiguration object. 27 type FelixConfigurationList struct { 28 metav1.TypeMeta `json:",inline"` 29 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 30 31 Items []FelixConfiguration `json:"items" protobuf:"bytes,2,rep,name=items"` 32 } 33 34 // +genclient 35 // +genclient:nonNamespaced 36 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 37 38 type FelixConfiguration struct { 39 metav1.TypeMeta `json:",inline"` 40 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 41 42 Spec FelixConfigurationSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` 43 } 44 45 type IptablesBackend string 46 47 const ( 48 KindFelixConfiguration = "FelixConfiguration" 49 KindFelixConfigurationList = "FelixConfigurationList" 50 IptablesBackendLegacy = "Legacy" 51 IptablesBackendNFTables = "NFT" 52 IptablesBackendAuto = "Auto" 53 ) 54 55 // +kubebuilder:validation:Enum=DoNothing;Enable;Disable 56 type AWSSrcDstCheckOption string 57 58 const ( 59 AWSSrcDstCheckOptionDoNothing AWSSrcDstCheckOption = "DoNothing" 60 AWSSrcDstCheckOptionEnable AWSSrcDstCheckOption = "Enable" 61 AWSSrcDstCheckOptionDisable AWSSrcDstCheckOption = "Disable" 62 ) 63 64 const ( 65 AWSSecondaryIPEnabled = "Enabled" 66 AWSSecondaryIPDisabled = "Disabled" 67 AWSSecondaryIPEnabledENIPerWorkload = "EnabledENIPerWorkload" 68 ) 69 70 // +kubebuilder:validation:Enum=NoDelay;DelayDeniedPacket;DelayDNSResponse 71 type DNSPolicyMode string 72 73 const ( 74 DNSPolicyModeNoDelay DNSPolicyMode = "NoDelay" 75 DNSPolicyModeDelayDeniedPacket DNSPolicyMode = "DelayDeniedPacket" 76 DNSPolicyModeDelayDNSResponse DNSPolicyMode = "DelayDNSResponse" 77 ) 78 79 // +kubebuilder:validation:Enum=Enabled;Disabled 80 type FloatingIPType string 81 82 const ( 83 FloatingIPsEnabled FloatingIPType = "Enabled" 84 FloatingIPsDisabled FloatingIPType = "Disabled" 85 ) 86 87 // +kubebuilder:validation:Enum=Enabled;Disabled 88 type WindowsManageFirewallRulesMode string 89 90 const ( 91 WindowsManageFirewallRulesEnabled WindowsManageFirewallRulesMode = "Enabled" 92 WindowsManageFirewallRulesDisabled WindowsManageFirewallRulesMode = "Disabled" 93 ) 94 95 type BPFHostNetworkedNATType string 96 97 const ( 98 BPFHostNetworkedNATEnabled BPFHostNetworkedNATType = "Enabled" 99 BPFHostNetworkedNATDisabled BPFHostNetworkedNATType = "Disabled" 100 ) 101 102 // +kubebuilder:validation:Enum=TCP;Enabled;Disabled 103 type BPFConnectTimeLBType string 104 105 const ( 106 BPFConnectTimeLBTCP BPFConnectTimeLBType = "TCP" 107 BPFConnectTimeLBEnabled BPFConnectTimeLBType = "Enabled" 108 BPFConnectTimeLBDisabled BPFConnectTimeLBType = "Disabled" 109 ) 110 111 // FelixConfigurationSpec contains the values of the Felix configuration. 112 type FelixConfigurationSpec struct { 113 // UseInternalDataplaneDriver, if true, Felix will use its internal dataplane programming logic. If false, it 114 // will launch an external dataplane driver and communicate with it over protobuf. 115 UseInternalDataplaneDriver *bool `json:"useInternalDataplaneDriver,omitempty"` 116 // DataplaneDriver filename of the external dataplane driver to use. Only used if UseInternalDataplaneDriver 117 // is set to false. 118 DataplaneDriver string `json:"dataplaneDriver,omitempty"` 119 120 // DataplaneWatchdogTimeout is the readiness/liveness timeout used for Felix's (internal) dataplane driver. 121 // Increase this value if you experience spurious non-ready or non-live events when Felix is under heavy load. 122 // Decrease the value to get felix to report non-live or non-ready more quickly. [Default: 90s] 123 // 124 // Deprecated: replaced by the generic HealthTimeoutOverrides. 125 DataplaneWatchdogTimeout *metav1.Duration `json:"dataplaneWatchdogTimeout,omitempty" configv1timescale:"seconds"` 126 127 // IPv6Support controls whether Felix enables support for IPv6 (if supported by the in-use dataplane). 128 IPv6Support *bool `json:"ipv6Support,omitempty" confignamev1:"Ipv6Support"` 129 130 // RouteRefreshInterval is the period at which Felix re-checks the routes 131 // in the dataplane to ensure that no other process has accidentally broken Calico's rules. 132 // Set to 0 to disable route refresh. [Default: 90s] 133 // +kubebuilder:validation:Type=string 134 // +kubebuilder:validation:Pattern=`^([0-9]+(\\.[0-9]+)?(ms|s|m|h))*$` 135 RouteRefreshInterval *metav1.Duration `json:"routeRefreshInterval,omitempty" configv1timescale:"seconds"` 136 // InterfaceRefreshInterval is the period at which Felix rescans local interfaces to verify their state. 137 // The rescan can be disabled by setting the interval to 0. 138 // +kubebuilder:validation:Type=string 139 // +kubebuilder:validation:Pattern=`^([0-9]+(\\.[0-9]+)?(ms|s|m|h))*$` 140 InterfaceRefreshInterval *metav1.Duration `json:"interfaceRefreshInterval,omitempty" configv1timescale:"seconds"` 141 // IptablesRefreshInterval is the period at which Felix re-checks the IP sets 142 // in the dataplane to ensure that no other process has accidentally broken Calico's rules. 143 // Set to 0 to disable IP sets refresh. Note: the default for this value is lower than the 144 // other refresh intervals as a workaround for a Linux kernel bug that was fixed in kernel 145 // version 4.11. If you are using v4.11 or greater you may want to set this to, a higher value 146 // to reduce Felix CPU usage. [Default: 10s] 147 // +kubebuilder:validation:Type=string 148 // +kubebuilder:validation:Pattern=`^([0-9]+(\\.[0-9]+)?(ms|s|m|h))*$` 149 IptablesRefreshInterval *metav1.Duration `json:"iptablesRefreshInterval,omitempty" configv1timescale:"seconds"` 150 // IptablesPostWriteCheckInterval is the period after Felix has done a write 151 // to the dataplane that it schedules an extra read back in order to check the write was not 152 // clobbered by another process. This should only occur if another application on the system 153 // doesn't respect the iptables lock. [Default: 1s] 154 // +kubebuilder:validation:Type=string 155 // +kubebuilder:validation:Pattern=`^([0-9]+(\\.[0-9]+)?(ms|s|m|h))*$` 156 IptablesPostWriteCheckInterval *metav1.Duration `json:"iptablesPostWriteCheckInterval,omitempty" configv1timescale:"seconds" confignamev1:"IptablesPostWriteCheckIntervalSecs"` 157 // IptablesLockFilePath is the location of the iptables lock file. You may need to change this 158 // if the lock file is not in its standard location (for example if you have mapped it into Felix's 159 // container at a different path). [Default: /run/xtables.lock] 160 IptablesLockFilePath string `json:"iptablesLockFilePath,omitempty"` 161 // IptablesLockTimeout is the time that Felix will wait for the iptables lock, 162 // or 0, to disable. To use this feature, Felix must share the iptables lock file with all other 163 // processes that also take the lock. When running Felix inside a container, this requires the 164 // /run directory of the host to be mounted into the calico/node or calico/felix container. 165 // [Default: 0s disabled] 166 // +kubebuilder:validation:Type=string 167 // +kubebuilder:validation:Pattern=`^([0-9]+(\\.[0-9]+)?(ms|s|m|h))*$` 168 IptablesLockTimeout *metav1.Duration `json:"iptablesLockTimeout,omitempty" configv1timescale:"seconds" confignamev1:"IptablesLockTimeoutSecs"` 169 // IptablesLockProbeInterval is the time that Felix will wait between 170 // attempts to acquire the iptables lock if it is not available. Lower values make Felix more 171 // responsive when the lock is contended, but use more CPU. [Default: 50ms] 172 // +kubebuilder:validation:Type=string 173 // +kubebuilder:validation:Pattern=`^([0-9]+(\\.[0-9]+)?(ms|s|m|h))*$` 174 IptablesLockProbeInterval *metav1.Duration `json:"iptablesLockProbeInterval,omitempty" configv1timescale:"milliseconds" confignamev1:"IptablesLockProbeIntervalMillis"` 175 // FeatureDetectOverride is used to override feature detection based on auto-detected platform 176 // capabilities. Values are specified in a comma separated list with no spaces, example; 177 // "SNATFullyRandom=true,MASQFullyRandom=false,RestoreSupportsLock=". "true" or "false" will 178 // force the feature, empty or omitted values are auto-detected. 179 // +kubebuilder:validation:Pattern=`^([a-zA-Z0-9-_]+=(true|false|),)*([a-zA-Z0-9-_]+=(true|false|))?$` 180 FeatureDetectOverride string `json:"featureDetectOverride,omitempty" validate:"omitempty,keyValueList"` 181 // FeatureGates is used to enable or disable tech-preview Calico features. 182 // Values are specified in a comma separated list with no spaces, example; 183 // "BPFConnectTimeLoadBalancingWorkaround=enabled,XyZ=false". This is 184 // used to enable features that are not fully production ready. 185 // +kubebuilder:validation:Pattern=`^([a-zA-Z0-9-_]+=([^=]+),)*([a-zA-Z0-9-_]+=([^=]+))?$` 186 FeatureGates string `json:"featureGates,omitempty" validate:"omitempty,keyValueList"` 187 // IpsetsRefreshInterval is the period at which Felix re-checks all iptables 188 // state to ensure that no other process has accidentally broken Calico's rules. Set to 0 to 189 // disable iptables refresh. [Default: 90s] 190 // +kubebuilder:validation:Type=string 191 // +kubebuilder:validation:Pattern=`^([0-9]+(\\.[0-9]+)?(ms|s|m|h))*$` 192 IpsetsRefreshInterval *metav1.Duration `json:"ipsetsRefreshInterval,omitempty" configv1timescale:"seconds"` 193 MaxIpsetSize *int `json:"maxIpsetSize,omitempty"` 194 // IptablesBackend specifies which backend of iptables will be used. The default is Auto. 195 // +kubebuilder:validation:Type=string 196 // +kubebuilder:validation:Pattern=`^(?i)(Auto|FelixConfiguration|FelixConfigurationList|Legacy|NFT)?$` 197 IptablesBackend *IptablesBackend `json:"iptablesBackend,omitempty" validate:"omitempty,iptablesBackend"` 198 199 // XDPRefreshInterval is the period at which Felix re-checks all XDP state to ensure that no 200 // other process has accidentally broken Calico's BPF maps or attached programs. Set to 0 to 201 // disable XDP refresh. [Default: 90s] 202 // +kubebuilder:validation:Type=string 203 // +kubebuilder:validation:Pattern=`^([0-9]+(\\.[0-9]+)?(ms|s|m|h))*$` 204 XDPRefreshInterval *metav1.Duration `json:"xdpRefreshInterval,omitempty" configv1timescale:"seconds"` 205 206 // +kubebuilder:validation:Type=string 207 // +kubebuilder:validation:Pattern=`^([0-9]+(\\.[0-9]+)?(ms|s|m|h))*$` 208 NetlinkTimeout *metav1.Duration `json:"netlinkTimeout,omitempty" configv1timescale:"seconds" confignamev1:"NetlinkTimeoutSecs"` 209 210 // MetadataAddr is the IP address or domain name of the server that can answer VM queries for 211 // cloud-init metadata. In OpenStack, this corresponds to the machine running nova-api (or in 212 // Ubuntu, nova-api-metadata). A value of none (case-insensitive) means that Felix should not 213 // set up any NAT rule for the metadata path. [Default: 127.0.0.1] 214 MetadataAddr string `json:"metadataAddr,omitempty"` 215 // MetadataPort is the port of the metadata server. This, combined with global.MetadataAddr (if 216 // not 'None'), is used to set up a NAT rule, from 169.254.169.254:80 to MetadataAddr:MetadataPort. 217 // In most cases this should not need to be changed [Default: 8775]. 218 MetadataPort *int `json:"metadataPort,omitempty"` 219 220 // OpenstackRegion is the name of the region that a particular Felix belongs to. In a multi-region 221 // Calico/OpenStack deployment, this must be configured somehow for each Felix (here in the datamodel, 222 // or in felix.cfg or the environment on each compute node), and must match the [calico] 223 // openstack_region value configured in neutron.conf on each node. [Default: Empty] 224 OpenstackRegion string `json:"openstackRegion,omitempty"` 225 226 // InterfacePrefix is the interface name prefix that identifies workload endpoints and so distinguishes 227 // them from host endpoint interfaces. Note: in environments other than bare metal, the orchestrators 228 // configure this appropriately. For example our Kubernetes and Docker integrations set the 'cali' value, 229 // and our OpenStack integration sets the 'tap' value. [Default: cali] 230 InterfacePrefix string `json:"interfacePrefix,omitempty"` 231 // InterfaceExclude is a comma-separated list of interfaces that Felix should exclude when monitoring for host 232 // endpoints. The default value ensures that Felix ignores Kubernetes' IPVS dummy interface, which is used 233 // internally by kube-proxy. If you want to exclude multiple interface names using a single value, the list 234 // supports regular expressions. For regular expressions you must wrap the value with '/'. For example 235 // having values '/^kube/,veth1' will exclude all interfaces that begin with 'kube' and also the interface 236 // 'veth1'. [Default: kube-ipvs0] 237 InterfaceExclude string `json:"interfaceExclude,omitempty"` 238 239 // ChainInsertMode controls whether Felix hooks the kernel's top-level iptables chains by inserting a rule 240 // at the top of the chain or by appending a rule at the bottom. insert is the safe default since it prevents 241 // Calico's rules from being bypassed. If you switch to append mode, be sure that the other rules in the chains 242 // signal acceptance by falling through to the Calico rules, otherwise the Calico policy will be bypassed. 243 // [Default: insert] 244 // +kubebuilder:validation:Pattern=`^(?i)(insert|append)?$` 245 ChainInsertMode string `json:"chainInsertMode,omitempty"` 246 // DefaultEndpointToHostAction controls what happens to traffic that goes from a workload endpoint to the host 247 // itself (after the traffic hits the endpoint egress policy). By default Calico blocks traffic from workload 248 // endpoints to the host itself with an iptables "DROP" action. If you want to allow some or all traffic from 249 // endpoint to host, set this parameter to RETURN or ACCEPT. Use RETURN if you have your own rules in the iptables 250 // "INPUT" chain; Calico will insert its rules at the top of that chain, then "RETURN" packets to the "INPUT" chain 251 // once it has completed processing workload endpoint egress policy. Use ACCEPT to unconditionally accept packets 252 // from workloads after processing workload endpoint egress policy. [Default: Drop] 253 // +kubebuilder:validation:Pattern=`^(?i)(Drop|Accept|Return)?$` 254 DefaultEndpointToHostAction string `json:"defaultEndpointToHostAction,omitempty" validate:"omitempty,dropAcceptReturn"` 255 // +kubebuilder:validation:Pattern=`^(?i)(Accept|Return)?$` 256 IptablesFilterAllowAction string `json:"iptablesFilterAllowAction,omitempty" validate:"omitempty,acceptReturn"` 257 // +kubebuilder:validation:Pattern=`^(?i)(Accept|Return)?$` 258 IptablesMangleAllowAction string `json:"iptablesMangleAllowAction,omitempty" validate:"omitempty,acceptReturn"` 259 // IptablesFilterDenyAction controls what happens to traffic that is denied by network policy. By default Calico blocks traffic 260 // with an iptables "DROP" action. If you want to use "REJECT" action instead you can configure it in here. 261 // +kubebuilder:validation:Pattern=`^(?i)(Drop|Reject)?$` 262 IptablesFilterDenyAction string `json:"iptablesFilterDenyAction,omitempty" validate:"omitempty,dropReject"` 263 // LogPrefix is the log prefix that Felix uses when rendering LOG rules. [Default: calico-packet] 264 LogPrefix string `json:"logPrefix,omitempty"` 265 266 // LogDropActionOverride specifies whether or not to include the DropActionOverride in the logs when it is triggered. 267 LogDropActionOverride *bool `json:"logDropActionOverride,omitempty"` 268 269 // LogFilePath is the full path to the Felix log. Set to none to disable file logging. [Default: /var/log/calico/felix.log] 270 LogFilePath string `json:"logFilePath,omitempty"` 271 272 // LogSeverityFile is the log severity above which logs are sent to the log file. [Default: Info] 273 // +kubebuilder:validation:Pattern=`^(?i)(Debug|Info|Warning|Error|Fatal)?$` 274 LogSeverityFile string `json:"logSeverityFile,omitempty" validate:"omitempty,logLevel"` 275 // LogSeverityScreen is the log severity above which logs are sent to the stdout. [Default: Info] 276 // +kubebuilder:validation:Pattern=`^(?i)(Debug|Info|Warning|Error|Fatal)?$` 277 LogSeverityScreen string `json:"logSeverityScreen,omitempty" validate:"omitempty,logLevel"` 278 // LogSeveritySys is the log severity above which logs are sent to the syslog. Set to None for no logging to syslog. 279 // [Default: Info] 280 // +kubebuilder:validation:Pattern=`^(?i)(Debug|Info|Warning|Error|Fatal)?$` 281 LogSeveritySys string `json:"logSeveritySys,omitempty" validate:"omitempty,logLevel"` 282 // LogDebugFilenameRegex controls which source code files have their Debug log output included in the logs. 283 // Only logs from files with names that match the given regular expression are included. The filter only applies 284 // to Debug level logs. 285 LogDebugFilenameRegex string `json:"logDebugFilenameRegex,omitempty" validate:"omitempty,regexp"` 286 287 // IPIPEnabled overrides whether Felix should configure an IPIP interface on the host. Optional as Felix determines this based on the existing IP pools. [Default: nil (unset)] 288 IPIPEnabled *bool `json:"ipipEnabled,omitempty" confignamev1:"IpInIpEnabled"` 289 // IPIPMTU is the MTU to set on the tunnel device. See Configuring MTU [Default: 1440] 290 IPIPMTU *int `json:"ipipMTU,omitempty" confignamev1:"IpInIpMtu"` 291 292 // VXLANEnabled overrides whether Felix should create the VXLAN tunnel device for IPv4 VXLAN networking. Optional as Felix determines this based on the existing IP pools. [Default: nil (unset)] 293 VXLANEnabled *bool `json:"vxlanEnabled,omitempty" confignamev1:"VXLANEnabled"` 294 // VXLANMTU is the MTU to set on the IPv4 VXLAN tunnel device. See Configuring MTU [Default: 1410] 295 VXLANMTU *int `json:"vxlanMTU,omitempty"` 296 // VXLANMTUV6 is the MTU to set on the IPv6 VXLAN tunnel device. See Configuring MTU [Default: 1390] 297 VXLANMTUV6 *int `json:"vxlanMTUV6,omitempty"` 298 VXLANPort *int `json:"vxlanPort,omitempty"` 299 VXLANVNI *int `json:"vxlanVNI,omitempty"` 300 301 // AllowVXLANPacketsFromWorkloads controls whether Felix will add a rule to drop VXLAN encapsulated traffic 302 // from workloads [Default: false] 303 // +optional 304 AllowVXLANPacketsFromWorkloads *bool `json:"allowVXLANPacketsFromWorkloads,omitempty"` 305 // AllowIPIPPacketsFromWorkloads controls whether Felix will add a rule to drop IPIP encapsulated traffic 306 // from workloads [Default: false] 307 // +optional 308 AllowIPIPPacketsFromWorkloads *bool `json:"allowIPIPPacketsFromWorkloads,omitempty"` 309 310 // ReportingInterval is the interval at which Felix reports its status into the datastore or 0 to disable. 311 // Must be non-zero in OpenStack deployments. [Default: 30s] 312 // +kubebuilder:validation:Type=string 313 // +kubebuilder:validation:Pattern=`^([0-9]+(\\.[0-9]+)?(ms|s|m|h))*$` 314 ReportingInterval *metav1.Duration `json:"reportingInterval,omitempty" configv1timescale:"seconds" confignamev1:"ReportingIntervalSecs"` 315 // ReportingTTL is the time-to-live setting for process-wide status reports. [Default: 90s] 316 // +kubebuilder:validation:Type=string 317 // +kubebuilder:validation:Pattern=`^([0-9]+(\\.[0-9]+)?(ms|s|m|h))*$` 318 ReportingTTL *metav1.Duration `json:"reportingTTL,omitempty" configv1timescale:"seconds" confignamev1:"ReportingTTLSecs"` 319 320 EndpointReportingEnabled *bool `json:"endpointReportingEnabled,omitempty"` 321 // +kubebuilder:validation:Type=string 322 // +kubebuilder:validation:Pattern=`^([0-9]+(\\.[0-9]+)?(ms|s|m|h))*$` 323 EndpointReportingDelay *metav1.Duration `json:"endpointReportingDelay,omitempty" configv1timescale:"seconds" confignamev1:"EndpointReportingDelaySecs"` 324 325 // IptablesMarkMask is the mask that Felix selects its IPTables Mark bits from. Should be a 32 bit hexadecimal 326 // number with at least 8 bits set, none of which clash with any other mark bits in use on the system. 327 // [Default: 0xffff0000] 328 IptablesMarkMask *uint32 `json:"iptablesMarkMask,omitempty"` 329 330 DisableConntrackInvalidCheck *bool `json:"disableConntrackInvalidCheck,omitempty"` 331 332 HealthEnabled *bool `json:"healthEnabled,omitempty"` 333 HealthHost *string `json:"healthHost,omitempty"` 334 HealthPort *int `json:"healthPort,omitempty"` 335 // HealthTimeoutOverrides allows the internal watchdog timeouts of individual subcomponents to be 336 // overridden. This is useful for working around "false positive" liveness timeouts that can occur 337 // in particularly stressful workloads or if CPU is constrained. For a list of active 338 // subcomponents, see Felix's logs. 339 HealthTimeoutOverrides []HealthTimeoutOverride `json:"healthTimeoutOverrides,omitempty" validate:"omitempty,dive"` 340 341 // PrometheusMetricsEnabled enables the Prometheus metrics server in Felix if set to true. [Default: false] 342 PrometheusMetricsEnabled *bool `json:"prometheusMetricsEnabled,omitempty"` 343 // PrometheusMetricsHost is the host that the Prometheus metrics server should bind to. [Default: empty] 344 PrometheusMetricsHost string `json:"prometheusMetricsHost,omitempty" validate:"omitempty,prometheusHost"` 345 // PrometheusMetricsPort is the TCP port that the Prometheus metrics server should bind to. [Default: 9091] 346 PrometheusMetricsPort *int `json:"prometheusMetricsPort,omitempty"` 347 // PrometheusGoMetricsEnabled disables Go runtime metrics collection, which the Prometheus client does by default, when 348 // set to false. This reduces the number of metrics reported, reducing Prometheus load. [Default: true] 349 PrometheusGoMetricsEnabled *bool `json:"prometheusGoMetricsEnabled,omitempty"` 350 // PrometheusProcessMetricsEnabled disables process metrics collection, which the Prometheus client does by default, when 351 // set to false. This reduces the number of metrics reported, reducing Prometheus load. [Default: true] 352 PrometheusProcessMetricsEnabled *bool `json:"prometheusProcessMetricsEnabled,omitempty"` 353 // PrometheusWireGuardMetricsEnabled disables wireguard metrics collection, which the Prometheus client does by default, when 354 // set to false. This reduces the number of metrics reported, reducing Prometheus load. [Default: true] 355 PrometheusWireGuardMetricsEnabled *bool `json:"prometheusWireGuardMetricsEnabled,omitempty"` 356 // TLS credentials for this port. 357 PrometheusMetricsCertFile string `json:"prometheusMetricsCertFile,omitempty"` 358 PrometheusMetricsKeyFile string `json:"prometheusMetricsKeyFile,omitempty"` 359 PrometheusMetricsCAFile string `json:"prometheusMetricsCAFile,omitempty"` 360 361 // FailsafeInboundHostPorts is a list of UDP/TCP ports and CIDRs that Felix will allow incoming traffic to host endpoints 362 // on irrespective of the security policy. This is useful to avoid accidentally cutting off a host with incorrect configuration. 363 // For back-compatibility, if the protocol is not specified, it defaults to "tcp". If a CIDR is not specified, it will allow 364 // traffic from all addresses. To disable all inbound host ports, use the value none. The default value allows ssh access 365 // and DHCP. 366 // [Default: tcp:22, udp:68, tcp:179, tcp:2379, tcp:2380, tcp:6443, tcp:6666, tcp:6667] 367 FailsafeInboundHostPorts *[]ProtoPort `json:"failsafeInboundHostPorts,omitempty"` 368 // FailsafeOutboundHostPorts is a list of UDP/TCP ports and CIDRs that Felix will allow outgoing traffic from host endpoints 369 // to irrespective of the security policy. This is useful to avoid accidentally cutting off a host with incorrect configuration. 370 // For back-compatibility, if the protocol is not specified, it defaults to "tcp". If a CIDR is not specified, it will allow 371 // traffic from all addresses. To disable all outbound host ports, use the value none. The default value opens etcd's standard 372 // ports to ensure that Felix does not get cut off from etcd as well as allowing DHCP and DNS. 373 // [Default: tcp:179, tcp:2379, tcp:2380, tcp:6443, tcp:6666, tcp:6667, udp:53, udp:67] 374 FailsafeOutboundHostPorts *[]ProtoPort `json:"failsafeOutboundHostPorts,omitempty"` 375 376 // KubeMasqueradeBit should be set to the same value as --iptables-masquerade-bit of kube-proxy 377 // when TPROXY is used. The default is the same as kube-proxy default thus only needs a change 378 // if kube-proxy is using a non-standard setting. Must be within the range of 0-31. [Default: 14] 379 KubeMasqueradeBit *int `json:"kubeMasqueradeBit,omitempty" validate:"omitempty,gte=0,lte=31"` 380 381 // KubeNodePortRanges holds list of port ranges used for service node ports. Only used if felix detects kube-proxy running in ipvs mode. 382 // Felix uses these ranges to separate host and workload traffic. [Default: 30000:32767]. 383 KubeNodePortRanges *[]numorstring.Port `json:"kubeNodePortRanges,omitempty" validate:"omitempty,dive"` 384 385 // PolicySyncPathPrefix is used to by Felix to communicate policy changes to external services, 386 // like Application layer policy. [Default: Empty] 387 PolicySyncPathPrefix string `json:"policySyncPathPrefix,omitempty"` 388 389 // UsageReportingEnabled reports anonymous Calico version number and cluster size to projectcalico.org. Logs warnings returned by the usage 390 // server. For example, if a significant security vulnerability has been discovered in the version of Calico being used. [Default: true] 391 UsageReportingEnabled *bool `json:"usageReportingEnabled,omitempty"` 392 // UsageReportingInitialDelay controls the minimum delay before Felix makes a report. [Default: 300s] 393 // +kubebuilder:validation:Type=string 394 // +kubebuilder:validation:Pattern=`^([0-9]+(\\.[0-9]+)?(ms|s|m|h))*$` 395 UsageReportingInitialDelay *metav1.Duration `json:"usageReportingInitialDelay,omitempty" configv1timescale:"seconds" confignamev1:"UsageReportingInitialDelaySecs"` 396 // UsageReportingInterval controls the interval at which Felix makes reports. [Default: 86400s] 397 // +kubebuilder:validation:Type=string 398 // +kubebuilder:validation:Pattern=`^([0-9]+(\\.[0-9]+)?(ms|s|m|h))*$` 399 UsageReportingInterval *metav1.Duration `json:"usageReportingInterval,omitempty" configv1timescale:"seconds" confignamev1:"UsageReportingIntervalSecs"` 400 401 // NATPortRange specifies the range of ports that is used for port mapping when doing outgoing NAT. When unset the default behavior of the 402 // network stack is used. 403 NATPortRange *numorstring.Port `json:"natPortRange,omitempty"` 404 405 // NATOutgoingAddress specifies an address to use when performing source NAT for traffic in a natOutgoing pool that 406 // is leaving the network. By default the address used is an address on the interface the traffic is leaving on 407 // (ie it uses the iptables MASQUERADE target) 408 NATOutgoingAddress string `json:"natOutgoingAddress,omitempty"` 409 410 // This is the IPv4 source address to use on programmed device routes. By default the source address is left blank, 411 // leaving the kernel to choose the source address used. 412 DeviceRouteSourceAddress string `json:"deviceRouteSourceAddress,omitempty"` 413 414 // This is the IPv6 source address to use on programmed device routes. By default the source address is left blank, 415 // leaving the kernel to choose the source address used. 416 DeviceRouteSourceAddressIPv6 string `json:"deviceRouteSourceAddressIPv6,omitempty"` 417 418 // This defines the route protocol added to programmed device routes, by default this will be RTPROT_BOOT 419 // when left blank. 420 DeviceRouteProtocol *int `json:"deviceRouteProtocol,omitempty"` 421 // Whether or not to remove device routes that have not been programmed by Felix. Disabling this will allow external 422 // applications to also add device routes. This is enabled by default which means we will remove externally added routes. 423 RemoveExternalRoutes *bool `json:"removeExternalRoutes,omitempty"` 424 425 // ExternalNodesCIDRList is a list of CIDR's of external-non-calico-nodes which may source tunnel traffic and have 426 // the tunneled traffic be accepted at calico nodes. 427 ExternalNodesCIDRList *[]string `json:"externalNodesList,omitempty"` 428 429 NfNetlinkBufSize string `json:"nfNetlinkBufSize,omitempty"` 430 StatsDumpFilePath string `json:"statsDumpFilePath,omitempty"` 431 432 // Felix Denied Packet Metrics configuration parameters. 433 PrometheusReporterEnabled *bool `json:"prometheusReporterEnabled,omitempty"` 434 PrometheusReporterPort *int `json:"prometheusReporterPort,omitempty"` 435 PrometheusReporterCertFile string `json:"prometheusReporterCertFile,omitempty"` 436 PrometheusReporterKeyFile string `json:"prometheusReporterKeyFile,omitempty"` 437 PrometheusReporterCAFile string `json:"prometheusReporterCAFile,omitempty"` 438 DeletedMetricsRetentionSecs *int `json:"deletedMetricsRetentionSecs,omitempty"` 439 440 // DropActionOverride overrides the Drop action in Felix, optionally changing the behavior to Accept, and optionally adding Log. 441 // Possible values are Drop, LogAndDrop, Accept, LogAndAccept. [Default: Drop] 442 // +kubebuilder:validation:Pattern=`^(?i)(Drop|LogAndDrop|Accept|LogAndAccept)?$` 443 DropActionOverride string `json:"dropActionOverride,omitempty" validate:"omitempty,dropActionOverride"` 444 445 DebugMemoryProfilePath string `json:"debugMemoryProfilePath,omitempty"` 446 DebugDisableLogDropping *bool `json:"debugDisableLogDropping,omitempty"` 447 // +kubebuilder:validation:Type=string 448 // +kubebuilder:validation:Pattern=`^([0-9]+(\\.[0-9]+)?(ms|s|m|h))*$` 449 DebugSimulateCalcGraphHangAfter *metav1.Duration `json:"debugSimulateCalcGraphHangAfter,omitempty" configv1timescale:"seconds"` 450 // +kubebuilder:validation:Type=string 451 // +kubebuilder:validation:Pattern=`^([0-9]+(\\.[0-9]+)?(ms|s|m|h))*$` 452 DebugSimulateDataplaneHangAfter *metav1.Duration `json:"debugSimulateDataplaneHangAfter,omitempty" configv1timescale:"seconds"` 453 // DebugHost is the host IP or hostname to bind the debug port to. Only used 454 // if DebugPort is set. [Default:localhost] 455 DebugHost *string `json:"debugHost,omitempty"` 456 // DebugPort if set, enables Felix's debug HTTP port, which allows memory and CPU profiles 457 // to be retrieved. The debug port is not secure, it should not be exposed to the internet. 458 DebugPort *int `json:"debugPort,omitempty" validate:"omitempty,gte=0,lte=65535"` 459 460 IptablesNATOutgoingInterfaceFilter string `json:"iptablesNATOutgoingInterfaceFilter,omitempty" validate:"omitempty,ifaceFilter"` 461 462 // SidecarAccelerationEnabled enables experimental sidecar acceleration [Default: false] 463 SidecarAccelerationEnabled *bool `json:"sidecarAccelerationEnabled,omitempty"` 464 465 // XDPEnabled enables XDP acceleration for suitable untracked incoming deny rules. [Default: true] 466 XDPEnabled *bool `json:"xdpEnabled,omitempty" confignamev1:"XDPEnabled"` 467 468 // GenericXDPEnabled enables Generic XDP so network cards that don't support XDP offload or driver 469 // modes can use XDP. This is not recommended since it doesn't provide better performance than 470 // iptables. [Default: false] 471 GenericXDPEnabled *bool `json:"genericXDPEnabled,omitempty" confignamev1:"GenericXDPEnabled"` 472 473 // BPFEnabled, if enabled Felix will use the BPF dataplane. [Default: false] 474 BPFEnabled *bool `json:"bpfEnabled,omitempty" validate:"omitempty"` 475 // BPFDisableUnprivileged, if enabled, Felix sets the kernel.unprivileged_bpf_disabled sysctl to disable 476 // unprivileged use of BPF. This ensures that unprivileged users cannot access Calico's BPF maps and 477 // cannot insert their own BPF programs to interfere with Calico's. [Default: true] 478 BPFDisableUnprivileged *bool `json:"bpfDisableUnprivileged,omitempty" validate:"omitempty"` 479 // BPFLogLevel controls the log level of the BPF programs when in BPF dataplane mode. One of "Off", "Info", or 480 // "Debug". The logs are emitted to the BPF trace pipe, accessible with the command `tc exec bpf debug`. 481 // [Default: Off]. 482 // +optional 483 // +kubebuilder:validation:Pattern=`^(?i)(Off|Info|Debug)?$` 484 BPFLogLevel string `json:"bpfLogLevel,omitempty" validate:"omitempty,bpfLogLevel"` 485 // BPFLogFilters is a map of key=values where the value is 486 // a pcap filter expression and the key is an interface name with 'all' 487 // denoting all interfaces, 'weps' all workload endpoints and 'heps' all host 488 // endpoints. 489 // 490 // When specified as an env var, it accepts a comma-separated list of 491 // key=values. 492 // [Default: unset - means all debug logs are emitted] 493 // +optional 494 BPFLogFilters *map[string]string `json:"bpfLogFilters,omitempty" validate:"omitempty,bpfLogFilters"` 495 // BPFCTLBLogFilter specifies, what is logged by connect time load balancer when BPFLogLevel is 496 // debug. Currently has to be specified as 'all' when BPFLogFilters is set 497 // to see CTLB logs. 498 // [Default: unset - means logs are emitted when BPFLogLevel id debug and BPFLogFilters not set.] 499 // +optional 500 BPFCTLBLogFilter string `json:"bpfCTLBLogFilter,omitempty" validate:"omitempty"` 501 // BPFDataIfacePattern is a regular expression that controls which interfaces Felix should attach BPF programs to 502 // in order to catch traffic to/from the network. This needs to match the interfaces that Calico workload traffic 503 // flows over as well as any interfaces that handle incoming traffic to nodeports and services from outside the 504 // cluster. It should not match the workload interfaces (usually named cali...). 505 BPFDataIfacePattern string `json:"bpfDataIfacePattern,omitempty" validate:"omitempty,regexp"` 506 // BPFL3IfacePattern is a regular expression that allows to list tunnel devices like wireguard or vxlan (i.e., L3 devices) 507 // in addition to BPFDataIfacePattern. That is, tunnel interfaces not created by Calico, that Calico workload traffic flows 508 // over as well as any interfaces that handle incoming traffic to nodeports and services from outside the cluster. 509 BPFL3IfacePattern string `json:"bpfL3IfacePattern,omitempty" validate:"omitempty,regexp"` 510 // BPFConnectTimeLoadBalancingEnabled when in BPF mode, controls whether Felix installs the connection-time load 511 // balancer. The connect-time load balancer is required for the host to be able to reach Kubernetes services 512 // and it improves the performance of pod-to-service connections. The only reason to disable it is for debugging 513 // purposes. This will be deprecated. Use BPFConnectTimeLoadBalancing [Default: true] 514 BPFConnectTimeLoadBalancingEnabled *bool `json:"bpfConnectTimeLoadBalancingEnabled,omitempty" validate:"omitempty"` 515 // BPFConnectTimeLoadBalancing when in BPF mode, controls whether Felix installs the connect-time load 516 // balancer. The connect-time load balancer is required for the host to be able to reach Kubernetes services 517 // and it improves the performance of pod-to-service connections.When set to TCP, connect time load balancing 518 // is available only for services with TCP ports. [Default: TCP] 519 BPFConnectTimeLoadBalancing *BPFConnectTimeLBType `json:"bpfConnectTimeLoadBalancing,omitempty" validate:"omitempty,oneof=TCP Enabled Disabled"` 520 // BPFHostNetworkedNATWithoutCTLB when in BPF mode, controls whether Felix does a NAT without CTLB. This along with BPFConnectTimeLoadBalancing 521 // determines the CTLB behavior. [Default: Enabled] 522 BPFHostNetworkedNATWithoutCTLB *BPFHostNetworkedNATType `json:"bpfHostNetworkedNATWithoutCTLB,omitempty" validate:"omitempty,oneof=Enabled Disabled"` 523 // BPFExternalServiceMode in BPF mode, controls how connections from outside the cluster to services (node ports 524 // and cluster IPs) are forwarded to remote workloads. If set to "Tunnel" then both request and response traffic 525 // is tunneled to the remote node. If set to "DSR", the request traffic is tunneled but the response traffic 526 // is sent directly from the remote node. In "DSR" mode, the remote node appears to use the IP of the ingress 527 // node; this requires a permissive L2 network. [Default: Tunnel] 528 // +kubebuilder:validation:Pattern=`^(?i)(Tunnel|DSR)?$` 529 BPFExternalServiceMode string `json:"bpfExternalServiceMode,omitempty" validate:"omitempty,bpfServiceMode"` 530 // BPFDSROptoutCIDRs is a list of CIDRs which are excluded from DSR. That is, clients 531 // in those CIDRs will accesses nodeports as if BPFExternalServiceMode was set to 532 // Tunnel. 533 BPFDSROptoutCIDRs *[]string `json:"bpfDSROptoutCIDRs,omitempty" validate:"omitempty,cidrs"` 534 // BPFExtToServiceConnmark in BPF mode, control a 32bit mark that is set on connections from an 535 // external client to a local service. This mark allows us to control how packets of that 536 // connection are routed within the host and how is routing interpreted by RPF check. [Default: 0] 537 BPFExtToServiceConnmark *int `json:"bpfExtToServiceConnmark,omitempty" validate:"omitempty,gte=0,lte=4294967295"` 538 // BPFKubeProxyIptablesCleanupEnabled, if enabled in BPF mode, Felix will proactively clean up the upstream 539 // Kubernetes kube-proxy's iptables chains. Should only be enabled if kube-proxy is not running. [Default: true] 540 BPFKubeProxyIptablesCleanupEnabled *bool `json:"bpfKubeProxyIptablesCleanupEnabled,omitempty" validate:"omitempty"` 541 // BPFKubeProxyMinSyncPeriod, in BPF mode, controls the minimum time between updates to the dataplane for Felix's 542 // embedded kube-proxy. Lower values give reduced set-up latency. Higher values reduce Felix CPU usage by 543 // batching up more work. [Default: 1s] 544 // +kubebuilder:validation:Type=string 545 // +kubebuilder:validation:Pattern=`^([0-9]+(\\.[0-9]+)?(ms|s|m|h))*$` 546 BPFKubeProxyMinSyncPeriod *metav1.Duration `json:"bpfKubeProxyMinSyncPeriod,omitempty" validate:"omitempty" configv1timescale:"seconds"` 547 // BPFKubeProxyEndpointSlicesEnabled is deprecated and has no effect. BPF 548 // kube-proxy always accepts endpoint slices. This option will be removed in 549 // the next release. 550 BPFKubeProxyEndpointSlicesEnabled *bool `json:"bpfKubeProxyEndpointSlicesEnabled,omitempty" validate:"omitempty"` 551 // BPFPSNATPorts sets the range from which we randomly pick a port if there is a source port 552 // collision. This should be within the ephemeral range as defined by RFC 6056 (1024–65535) and 553 // preferably outside the ephemeral ranges used by common operating systems. Linux uses 554 // 32768–60999, while others mostly use the IANA defined range 49152–65535. It is not necessarily 555 // a problem if this range overlaps with the operating systems. Both ends of the range are 556 // inclusive. [Default: 20000:29999] 557 BPFPSNATPorts *numorstring.Port `json:"bpfPSNATPorts,omitempty"` 558 // BPFMapSizeNATFrontend sets the size for nat front end map. 559 // FrontendMap should be large enough to hold an entry for each nodeport, 560 // external IP and each port in each service. 561 BPFMapSizeNATFrontend *int `json:"bpfMapSizeNATFrontend,omitempty"` 562 // BPFMapSizeNATBackend sets the size for nat back end map. 563 // This is the total number of endpoints. This is mostly 564 // more than the size of the number of services. 565 BPFMapSizeNATBackend *int `json:"bpfMapSizeNATBackend,omitempty"` 566 BPFMapSizeNATAffinity *int `json:"bpfMapSizeNATAffinity,omitempty"` 567 // BPFMapSizeRoute sets the size for the routes map. The routes map should be large enough 568 // to hold one entry per workload and a handful of entries per host (enough to cover its own IPs and 569 // tunnel IPs). 570 BPFMapSizeRoute *int `json:"bpfMapSizeRoute,omitempty"` 571 // BPFMapSizeConntrack sets the size for the conntrack map. This map must be large enough to hold 572 // an entry for each active connection. Warning: changing the size of the conntrack map can cause disruption. 573 BPFMapSizeConntrack *int `json:"bpfMapSizeConntrack,omitempty"` 574 // BPFMapSizeIPSets sets the size for ipsets map. The IP sets map must be large enough to hold an entry 575 // for each endpoint matched by every selector in the source/destination matches in network policy. Selectors 576 // such as "all()" can result in large numbers of entries (one entry per endpoint in that case). 577 BPFMapSizeIPSets *int `json:"bpfMapSizeIPSets,omitempty"` 578 // BPFMapSizeIfState sets the size for ifstate map. The ifstate map must be large enough to hold an entry 579 // for each device (host + workloads) on a host. 580 BPFMapSizeIfState *int `json:"bpfMapSizeIfState,omitempty"` 581 // BPFHostConntrackBypass Controls whether to bypass Linux conntrack in BPF mode for 582 // workloads and services. [Default: true - bypass Linux conntrack] 583 BPFHostConntrackBypass *bool `json:"bpfHostConntrackBypass,omitempty"` 584 // BPFEnforceRPF enforce strict RPF on all host interfaces with BPF programs regardless of 585 // what is the per-interfaces or global setting. Possible values are Disabled, Strict 586 // or Loose. [Default: Loose] 587 // +kubebuilder:validation:Pattern=`^(?i)(Disabled|Strict|Loose)?$` 588 BPFEnforceRPF string `json:"bpfEnforceRPF,omitempty"` 589 // BPFPolicyDebugEnabled when true, Felix records detailed information 590 // about the BPF policy programs, which can be examined with the calico-bpf command-line tool. 591 BPFPolicyDebugEnabled *bool `json:"bpfPolicyDebugEnabled,omitempty"` 592 // BPFForceTrackPacketsFromIfaces in BPF mode, forces traffic from these interfaces 593 // to skip Calico's iptables NOTRACK rule, allowing traffic from those interfaces to be 594 // tracked by Linux conntrack. Should only be used for interfaces that are not used for 595 // the Calico fabric. For example, a docker bridge device for non-Calico-networked 596 // containers. [Default: docker+] 597 BPFForceTrackPacketsFromIfaces *[]string `json:"bpfForceTrackPacketsFromIfaces,omitempty" validate:"omitempty,ifaceFilterSlice"` 598 // BPFDisableGROForIfaces is a regular expression that controls which interfaces Felix should disable the 599 // Generic Receive Offload [GRO] option. It should not match the workload interfaces (usually named cali...). 600 BPFDisableGROForIfaces string `json:"bpfDisableGROForIfaces,omitempty" validate:"omitempty,regexp"` 601 // BPFExcludeCIDRsFromNAT is a list of CIDRs that are to be excluded from NAT 602 // resolution so that host can handle them. A typical usecase is node local 603 // DNS cache. 604 BPFExcludeCIDRsFromNAT *[]string `json:"bpfExcludeCIDRsFromNAT,omitempty" validate:"omitempty,cidrs"` 605 606 SyslogReporterNetwork string `json:"syslogReporterNetwork,omitempty"` 607 SyslogReporterAddress string `json:"syslogReporterAddress,omitempty"` 608 609 // IPSecMode controls which mode IPSec is operating on. 610 // Default value means IPSec is not enabled. [Default: ""] 611 IPSecMode string `json:"ipsecMode,omitempty" validate:"omitempty,ipsecMode"` 612 // IPSecAllowUnsecuredTraffic controls whether non-IPsec traffic is allowed in addition to IPsec traffic. Enabling this 613 // negates the anti-spoofing protections of IPsec but it is useful when migrating to/from IPsec. [Default: false] 614 IPSecAllowUnsecuredTraffic *bool `json:"ipsecAllowUnsecuredTraffic,omitempty"` 615 // IPSecIKEAlgorithm sets IPSec IKE algorithm. Default is NIST suite B recommendation. [Default: aes128gcm16-prfsha256-ecp256] 616 IPSecIKEAlgorithm string `json:"ipsecIKEAlgorithm,omitempty"` 617 // IPSecESAlgorithm sets IPSec ESP algorithm. Default is NIST suite B recommendation. [Default: aes128gcm16-ecp256] 618 IPSecESPAlgorithm string `json:"ipsecESPAlgorithm,omitempty"` 619 // IPSecLogLevel controls log level for IPSec components. Set to None for no logging. 620 // A generic log level terminology is used [None, Notice, Info, Debug, Verbose]. 621 // [Default: Info] 622 // +kubebuilder:validation:Pattern=`^(?i)(None|Notice|Info|Debug|Verbose)?$` 623 IPSecLogLevel string `json:"ipsecLogLevel,omitempty" validate:"omitempty,ipsecLogLevel"` 624 // IPSecPolicyRefreshInterval is the interval at which Felix will check the kernel's IPsec policy tables and 625 // repair any inconsistencies. [Default: 600s] 626 // +kubebuilder:validation:Type=string 627 // +kubebuilder:validation:Pattern=`^([0-9]+(\\.[0-9]+)?(ms|s|m|h))*$` 628 IPSecPolicyRefreshInterval *metav1.Duration `json:"ipsecPolicyRefreshInterval,omitempty" configv1timescale:"seconds"` 629 630 // FlowLogsFlushInterval configures the interval at which Felix exports flow logs. 631 // +kubebuilder:validation:Type=string 632 // +kubebuilder:validation:Pattern=`^([0-9]+(\\.[0-9]+)?(ms|s|m|h))*$` 633 FlowLogsFlushInterval *metav1.Duration `json:"flowLogsFlushInterval,omitempty" configv1timescale:"seconds"` 634 // FlowLogsEnableHostEndpoint enables Flow logs reporting for HostEndpoints. 635 FlowLogsEnableHostEndpoint *bool `json:"flowLogsEnableHostEndpoint,omitempty"` 636 // FlowLogsEnableNetworkSets enables Flow logs reporting for GlobalNetworkSets. 637 FlowLogsEnableNetworkSets *bool `json:"flowLogsEnableNetworkSets,omitempty"` 638 // FlowLogsMaxOriginalIPsIncluded specifies the number of unique IP addresses (if relevant) that should be included in Flow logs. 639 FlowLogsMaxOriginalIPsIncluded *int `json:"flowLogsMaxOriginalIPsIncluded,omitempty"` 640 // FlowLogsCollectProcessInfo, if enabled Felix will load the kprobe BPF programs to collect process info. [Default: false] 641 FlowLogsCollectProcessInfo *bool `json:"flowLogsCollectProcessInfo,omitempty" validate:"omitempty"` 642 // FlowLogsCollectTcpStats enables flow logs reporting TCP socket stats 643 FlowLogsCollectTcpStats *bool `json:"flowLogsCollectTcpStats,omitempty" validate:"omitempty"` 644 // When FlowLogsCollectProcessPath and FlowLogsCollectProcessInfo are 645 // both enabled, each flow log will include information about the process 646 // that is sending or receiving the packets in that flow: the 647 // `process_name` field will contain the full path of the process 648 // executable, and the `process_args` field will have the arguments with 649 // which the executable was invoked. Process information will not be 650 // reported for connections which use raw sockets. 651 FlowLogsCollectProcessPath *bool `json:"flowLogsCollectProcessPath,omitempty" validate:"omitempty"` 652 // When FlowLogsCollectorDebugTrace is set to true, enables the logs in the collector to be 653 // printed in their entirety. 654 FlowLogsCollectorDebugTrace *bool `json:"flowLogsCollectorDebugTrace,omitempty"` 655 // FlowLogsDestDomainsByClient is used to configure if the source IP is used in the mapping of top 656 // level destination domains. [Default: true] 657 FlowLogsDestDomainsByClient *bool `json:"flowLogsDestDomainsByClient,omitempty"` 658 // FlowLogsFileEnabled when set to true, enables logging flow logs to a file. If false no flow logging to file will occur. 659 FlowLogsFileEnabled *bool `json:"flowLogsFileEnabled,omitempty"` 660 // FlowLogsFileMaxFiles sets the number of log files to keep. 661 FlowLogsFileMaxFiles *int `json:"flowLogsFileMaxFiles,omitempty"` 662 // FlowLogsFileMaxFileSizeMB sets the max size in MB of flow logs files before rotation. 663 FlowLogsFileMaxFileSizeMB *int `json:"flowLogsFileMaxFileSizeMB,omitempty"` 664 // FlowLogsFileDirectory sets the directory where flow logs files are stored. 665 FlowLogsFileDirectory *string `json:"flowLogsFileDirectory,omitempty"` 666 // FlowLogsFileIncludeLabels is used to configure if endpoint labels are included in a Flow log entry written to file. 667 FlowLogsFileIncludeLabels *bool `json:"flowLogsFileIncludeLabels,omitempty"` 668 // FlowLogsFileIncludePolicies is used to configure if policy information are included in a Flow log entry written to file. 669 FlowLogsFileIncludePolicies *bool `json:"flowLogsFileIncludePolicies,omitempty"` 670 // FlowLogsFileIncludeService is used to configure if the destination service is included in a Flow log entry written to file. 671 // The service information can only be included if the flow was explicitly determined to be directed at the service (e.g. 672 // when the pre-DNAT destination corresponds to the service ClusterIP and port). 673 FlowLogsFileIncludeService *bool `json:"flowLogsFileIncludeService,omitempty"` 674 // FlowLogsFileAggregationKindForAllowed is used to choose the type of aggregation for flow log entries created for 675 // allowed connections. [Default: 2 - pod prefix name based aggregation]. 676 // Accepted values are 0, 1 and 2. 677 // 0 - No aggregation. 678 // 1 - Source port based aggregation. 679 // 2 - Pod prefix name based aggreagation. 680 // +kubebuilder:validation:Enum=0;1;2 681 FlowLogsFileAggregationKindForAllowed *int `json:"flowLogsFileAggregationKindForAllowed,omitempty" validate:"omitempty,flowLogAggregationKind"` 682 // FlowLogsFileAggregationKindForDenied is used to choose the type of aggregation for flow log entries created for 683 // denied connections. [Default: 1 - source port based aggregation]. 684 // Accepted values are 0, 1 and 2. 685 // 0 - No aggregation. 686 // 1 - Source port based aggregation. 687 // 2 - Pod prefix name based aggregation. 688 // 3 - No destination ports based aggregation. 689 // +kubebuilder:validation:Enum=0;1;2;3 690 FlowLogsFileAggregationKindForDenied *int `json:"flowLogsFileAggregationKindForDenied,omitempty" validate:"omitempty,flowLogAggregationKind"` 691 // FlowLogsFileEnabledForAllowed is used to enable/disable flow logs entries created for allowed connections. Default is true. 692 // This parameter only takes effect when FlowLogsFileReporterEnabled is set to true. 693 FlowLogsFileEnabledForAllowed *bool `json:"flowLogsFileEnabledForAllowed,omitempty"` 694 // FlowLogsFileEnabledForDenied is used to enable/disable flow logs entries created for denied flows. Default is true. 695 // This parameter only takes effect when FlowLogsFileReporterEnabled is set to true. 696 FlowLogsFileEnabledForDenied *bool `json:"flowLogsFileEnabledForDenied,omitempty"` 697 // FlowLogsDynamicAggregationEnabled is used to enable/disable dynamically changing aggregation levels. Default is true. 698 FlowLogsDynamicAggregationEnabled *bool `json:"flowLogsDynamicAggregationEnabled,omitempty"` 699 // FlowLogsPositionFilePath is used specify the position of the external pipeline that reads flow logs. Default is /var/log/calico/flows.log.pos. 700 // This parameter only takes effect when FlowLogsDynamicAggregationEnabled is set to true. 701 FlowLogsPositionFilePath *string `json:"flowLogsPositionFilePath,omitempty"` 702 // FlowLogsAggregationThresholdBytes is used specify how far behind the external pipeline that reads flow logs can be. Default is 8192 bytes. 703 // This parameter only takes effect when FlowLogsDynamicAggregationEnabled is set to true. 704 FlowLogsAggregationThresholdBytes *int `json:"flowLogsAggregationThresholdBytes,omitempty"` 705 // FlowLogsFilePerFlowProcessLimit, is used to specify the maximum number of flow log entries with distinct process information 706 // beyond which process information will be aggregated. [Default: 2] 707 FlowLogsFilePerFlowProcessLimit *int `json:"flowLogsFilePerFlowProcessLimit,omitempty" validate:"omitempty"` 708 // FlowLogsFilePerFlowProcessArgsLimit is used to specify the maximum number of distinct process args that will appear in the flowLogs. 709 // Default value is 5 710 FlowLogsFilePerFlowProcessArgsLimit *int `json:"flowLogsFilePerFlowProcessArgsLimit,omitempty" validate:"omitempty"` 711 // FlowLogsFileNatOutgoingPortLimit is used to specify the maximum number of distinct post SNAT ports that will appear 712 // in the flowLogs. Default value is 3 713 FlowLogsFileNatOutgoingPortLimit *int `json:"flowLogsFileNatOutgoingPortLimit,omitempty" validate:"omitempty"` 714 // FlowLogsFileDomainsLimit is used to configure the number of (destination) domains to include in the flow log. 715 // These are not included for workload or host endpoint destinations. 716 // [Default: 5] 717 FlowLogsFileDomainsLimit *int `json:"flowLogsFileDomainsLimit,omitempty" validate:"omitempty"` 718 719 // WindowsFlowLogsFileDirectory sets the directory where flow logs files are stored on Windows nodes. [Default: "c:\\TigeraCalico\\flowlogs"]. 720 WindowsFlowLogsFileDirectory string `json:"windowsFlowLogsFileDirectory,omitempty"` 721 // WindowsFlowLogsPositionFilePath is used to specify the position of the external pipeline that reads flow logs on Windows nodes. 722 // [Default: "c:\\TigeraCalico\\flowlogs\\flows.log.pos"]. 723 // This parameter only takes effect when FlowLogsDynamicAggregationEnabled is set to true. 724 WindowsFlowLogsPositionFilePath string `json:"windowsFlowLogsPositionFilePath,omitempty"` 725 // WindowsStatsDumpFilePath is used to specify the path of the stats dump file on Windows nodes. [Default: "c:\\TigeraCalico\\stats\\dump"] 726 WindowsStatsDumpFilePath string `json:"windowsStatsDumpFilePath,omitempty"` 727 // The name of the file that Felix uses to preserve learnt DNS information when restarting. [Default: 728 // "c:\\TigeraCalico\\felix-dns-cache.txt"]. 729 WindowsDNSCacheFile string `json:"windowsDnsCacheFile,omitempty"` 730 // Extra time to keep IPs and alias names that are learnt from DNS, in addition to each name 731 // or IP's advertised TTL. The default value is 120s which is same as the default value of 732 // ServicePointManager.DnsRefreshTimeout on .net framework. [Default: 120s]. 733 // +kubebuilder:validation:Type=string 734 // +kubebuilder:validation:Pattern=`^([0-9]+(\\.[0-9]+)?(ms|s|m|h))*$` 735 WindowsDNSExtraTTL *metav1.Duration `json:"windowsDnsExtraTTL,omitempty" configv1timescale:"seconds"` 736 737 // The DNS servers that Felix should trust. Each entry here must be `<ip>[:<port>]` - indicating an 738 // explicit DNS server IP - or `k8s-service:[<namespace>/]<name>[:port]` - indicating a Kubernetes DNS 739 // service. `<port>` defaults to the first service port, or 53 for an IP, and `<namespace>` to 740 // `kube-system`. An IPv6 address with a port must use the square brackets convention, for example 741 // `[fd00:83a6::12]:5353`.Note that Felix (calico-node) will need RBAC permission to read the details of 742 // each service specified by a `k8s-service:...` form. [Default: "k8s-service:kube-dns"]. 743 DNSTrustedServers *[]string `json:"dnsTrustedServers,omitempty" validate:"omitempty,dive,ipOrK8sService"` 744 // The name of the file that Felix uses to preserve learnt DNS information when restarting. [Default: 745 // "/var/run/calico/felix-dns-cache.txt"]. 746 DNSCacheFile string `json:"dnsCacheFile,omitempty"` 747 // The periodic interval at which Felix saves learnt DNS information to the cache file. [Default: 748 // 60s]. 749 // +kubebuilder:validation:Type=string 750 // +kubebuilder:validation:Pattern=`^([0-9]+(\\.[0-9]+)?(ms|s|m|h))*$` 751 DNSCacheSaveInterval *metav1.Duration `json:"dnsCacheSaveInterval,omitempty" configv1timescale:"seconds"` 752 // An arbitrary number that can be changed, at runtime, to tell Felix to discard all its 753 // learnt DNS information. [Default: 0]. 754 DNSCacheEpoch *int `json:"dnsCacheEpoch,omitempty"` 755 // Extra time to keep IPs and alias names that are learnt from DNS, in addition to each name 756 // or IP's advertised TTL. [Default: 0s]. 757 // +kubebuilder:validation:Type=string 758 // +kubebuilder:validation:Pattern=`^([0-9]+(\\.[0-9]+)?(ms|s|m|h))*$` 759 DNSExtraTTL *metav1.Duration `json:"dnsExtraTTL,omitempty" configv1timescale:"seconds"` 760 761 // DNSLogsFlushInterval configures the interval at which Felix exports DNS logs. 762 // [Default: 300s] 763 // +kubebuilder:validation:Type=string 764 // +kubebuilder:validation:Pattern=`^([0-9]+(\\.[0-9]+)?(ms|s|m|h))*$` 765 DNSLogsFlushInterval *metav1.Duration `json:"dnsLogsFlushInterval,omitempty" configv1timescale:"seconds"` 766 // DNSLogsFileEnabled controls logging DNS logs to a file. If false no DNS logging to file will occur. 767 // [Default: false] 768 DNSLogsFileEnabled *bool `json:"dnsLogsFileEnabled,omitempty"` 769 // DNSLogsFileMaxFiles sets the number of DNS log files to keep. 770 // [Default: 5] 771 DNSLogsFileMaxFiles *int `json:"dnsLogsFileMaxFiles,omitempty"` 772 // DNSLogsFileMaxFileSizeMB sets the max size in MB of DNS log files before rotation. 773 // [Default: 100] 774 DNSLogsFileMaxFileSizeMB *int `json:"dnsLogsFileMaxFileSizeMB,omitempty"` 775 // DNSLogsFileDirectory sets the directory where DNS log files are stored. 776 // [Default: /var/log/calico/dnslogs] 777 DNSLogsFileDirectory *string `json:"dnsLogsFileDirectory,omitempty"` 778 // DNSLogsFileIncludeLabels is used to configure if endpoint labels are included in a DNS log entry written to file. 779 // [Default: true] 780 DNSLogsFileIncludeLabels *bool `json:"dnsLogsFileIncludeLabels,omitempty"` 781 // DNSLogsFileAggregationKind is used to choose the type of aggregation for DNS log entries. 782 // [Default: 1 - client name prefix aggregation]. 783 // Accepted values are 0 and 1. 784 // 0 - No aggregation. 785 // 1 - Aggregate over clients with the same name prefix. 786 // +kubebuilder:validation:Enum=0;1 787 DNSLogsFileAggregationKind *int `json:"dnsLogsFileAggregationKind,omitempty" validate:"omitempty,dnsAggregationKind"` 788 // Limit on the number of DNS logs that can be emitted within each flush interval. When 789 // this limit has been reached, Felix counts the number of unloggable DNS responses within 790 // the flush interval, and emits a WARNING log with that count at the same time as it 791 // flushes the buffered DNS logs. [Default: 0, meaning no limit] 792 DNSLogsFilePerNodeLimit *int `json:"dnsLogsFilePerNodeLimit,omitempty"` 793 // DNSLogsLatency indicates to include measurements of DNS request/response latency in each DNS log. 794 // [Default: true] 795 DNSLogsLatency *bool `json:"dnsLogsLatency,omitempty"` 796 // DNSPolicyMode specifies how DNS policy programming will be handled. 797 // DelayDeniedPacket - Felix delays any denied packet that traversed a policy that included egress domain matches, 798 // but did not match. The packet is released after a fixed time, or after the destination IP address was programmed. 799 // DelayDNSResponse - Felix delays any DNS response until related IPSets are programmed. This introduces some 800 // latency to all DNS packets (even when no IPSet programming is required), but it ensures policy hit statistics 801 // are accurate. This is the recommended setting when you are making use of staged policies or policy rule hit 802 // statistics. 803 // NoDelay - Felix does not introduce any delay to the packets. DNS rules may not have been programmed by the time 804 // the first packet traverses the policy rules. Client applications need to handle reconnection attempts if initial 805 // connection attempts fail. This may be problematic for some applications or for very low DNS TTLs. 806 // 807 // On Windows, or when using the eBPF dataplane, this setting is ignored and "NoDelay" is always used. 808 // 809 // [Default: DelayDeniedPacket] 810 DNSPolicyMode *DNSPolicyMode `json:"dnsPolicyMode,omitempty" validate:"omitempty,oneof=NoDelay DelayDeniedPacket DelayDNSResponse"` 811 // DNSPolicyNfqueueID is the NFQUEUE ID to use for DNS Policy re-evaluation when the domains IP hasn't been programmed 812 // to ipsets yet. Used when DNSPolicyMode is DelayDeniedPacket. [Default: 100] 813 DNSPolicyNfqueueID *int `json:"dnsPolicyNfqueueID,omitempty" validate:"omitempty,gte=0,lte=65535"` 814 // DNSPolicyNfqueueID is the size of the NFQUEUE for DNS policy re-evaluation. This is the maximum number of denied 815 // packets that may be queued up pending re-evaluation. 816 // Used when DNSPolicyMode is DelayDeniedPacket. [Default: 100] 817 DNSPolicyNfqueueSize *int `json:"dnsPolicyNfqueueSize,omitempty" validate:"omitempty,gte=0,lte=65535"` 818 // DNSPacketsNfqueueID is the NFQUEUE ID to use for capturing DNS packets to ensure programming IPSets occurs before 819 // the response is released. Used when DNSPolicyMode is DelayDNSResponse. [Default: 101] 820 DNSPacketsNfqueueID *int `json:"dnsPacketsNfqueueID,omitempty" validate:"omitempty,gte=0,lte=65535"` 821 // DNSPacketsNfqueueSize is the size of the NFQUEUE for captured DNS packets. This is the maximum number of DNS 822 // packets that may be queued awaiting programming in the dataplane. Used when DNSPolicyMode is DelayDNSResponse. 823 // [Default: 100] 824 DNSPacketsNfqueueSize *int `json:"dnsPacketsNfqueueSize,omitempty" validate:"omitempty,gte=0,lte=65535"` 825 // DNSPacketsNfqueueMaxHoldDuration is the max length of time to hold on to a DNS response while waiting for the 826 // the dataplane to be programmed. Used when DNSPolicyMode is DelayDNSResponse. 827 // [Default: 3s] 828 // +kubebuilder:validation:Type=string 829 // +kubebuilder:validation:Pattern=`^([0-9]+(\\.[0-9]+)?(ms|s|m|h))*$` 830 DNSPacketsNfqueueMaxHoldDuration *metav1.Duration `json:"dnsPacketsNfqueueMaxHoldDuration,omitempty"` 831 832 // L7LogsFlushInterval configures the interval at which Felix exports L7 logs. 833 // [Default: 300s] 834 // +kubebuilder:validation:Type=string 835 // +kubebuilder:validation:Pattern=`^([0-9]+(\\.[0-9]+)?(ms|s|m|h))*$` 836 L7LogsFlushInterval *metav1.Duration `json:"l7LogsFlushInterval,omitempty" configv1timescale:"seconds"` 837 // L7LogsFileEnabled controls logging L7 logs to a file. If false no L7 logging to file will occur. 838 // [Default: true] 839 L7LogsFileEnabled *bool `json:"l7LogsFileEnabled,omitempty"` 840 // L7LogsFileMaxFiles sets the number of L7 log files to keep. 841 // [Default: 5] 842 L7LogsFileMaxFiles *int `json:"l7LogsFileMaxFiles,omitempty"` 843 // L7LogsFileMaxFileSizeMB sets the max size in MB of L7 log files before rotation. 844 // [Default: 100] 845 L7LogsFileMaxFileSizeMB *int `json:"l7LogsFileMaxFileSizeMB,omitempty"` 846 // L7LogsFileDirectory sets the directory where L7 log files are stored. 847 // [Default: /var/log/calico/l7logs] 848 L7LogsFileDirectory *string `json:"l7LogsFileDirectory,omitempty"` 849 // L7LogsFileAggregationHTTPHeaderInfo is used to choose the type of aggregation for HTTP header data on L7 log entries. 850 // [Default: ExcludeL7HTTPHeaderInfo - http header info removal]. 851 // Accepted values are IncludeL7HTTPHeaderInfo and ExcludeL7HTTPHeaderInfo. 852 // IncludeL7HTTPHeaderInfo - Include HTTP header data in the logs. 853 // ExcludeL7HTTPHeaderInfo - Aggregate over all other fields ignoring the user agent and log type. 854 // +kubebuilder:validation:Pattern=`^(?i)(IncludeL7HTTPHeaderInfo|ExcludeL7HTTPHeaderInfo)?$` 855 L7LogsFileAggregationHTTPHeaderInfo *string `json:"l7LogsFileAggregationHTTPHeaderInfo,omitempty" validate:"omitempty,l7HTTPHeaderAggregation"` 856 // L7LogsFileAggregationHTTPMethod is used to choose the type of aggregation for the HTTP request method on L7 log entries. 857 // [Default: IncludeL7HTTPMethod - include the HTTP method]. 858 // Accepted values are IncludeL7HTTPMethod and ExcludeL7HTTPMethod. 859 // IncludeL7HTTPMethod - Include HTTP method in the logs. 860 // ExcludeL7HTTPMethod - Aggregate over all other fields ignoring the HTTP method. 861 // +kubebuilder:validation:Pattern=`^(?i)(IncludeL7HTTPMethod|ExcludeL7HTTPMethod)?$` 862 L7LogsFileAggregationHTTPMethod *string `json:"l7LogsFileAggregationHTTPMethod,omitempty" validate:"omitempty,l7HTTPMethodAggregation"` 863 // L7LogsFileAggregationServiceInfo is used to choose the type of aggregation for the service data on L7 log entries. 864 // [Default: IncludeL7ServiceInfo - include service data]. 865 // Accepted values are IncludeL7ServiceInfo and ExcludeL7ServiceInfo. 866 // IncludeL7ServiceInfo - Include service data in the logs. 867 // ExcludeL7ServiceInfo - Aggregate over all other fields ignoring the service name, namespace, and port. 868 // +kubebuilder:validation:Pattern=`^(?i)(IncludeL7ServiceInfo|ExcludeL7ServiceInfo)?$` 869 L7LogsFileAggregationServiceInfo *string `json:"l7LogsFileAggregationServiceInfo,omitempty" validate:"omitempty,l7ServiceAggregation"` 870 // L7LogsFileAggregationDestinationInfo is used to choose the type of aggregation for the destination metadata on L7 log entries. 871 // [Default: IncludeL7DestinationInfo - include destination metadata]. 872 // Accepted values are IncludeL7DestinationInfo and ExcludeL7DestinationInfo. 873 // IncludeL7DestinationInfo - Include destination metadata in the logs. 874 // ExcludeL7DestinationInfo - Aggregate over all other fields ignoring the destination aggregated name, namespace, and type. 875 // +kubebuilder:validation:Pattern=`^(?i)(IncludeL7DestinationInfo|ExcludeL7DestinationInfo)?$` 876 L7LogsFileAggregationDestinationInfo *string `json:"l7LogsFileAggregationDestinationInfo,omitempty" validate:"omitempty,l7DestinationAggregation"` 877 // L7LogsFileAggregationExcludeSourceInfo is used to choose the type of aggregation for the source metadata on L7 log entries. 878 // [Default: IncludeL7SourceInfoNoPort - include all source metadata except for the source port]. 879 // Accepted values are IncludeL7SourceInfo, IncludeL7SourceInfoNoPort, and ExcludeL7SourceInfo. 880 // IncludeL7SourceInfo - Include source metadata in the logs. 881 // IncludeL7SourceInfoNoPort - Include source metadata in the logs excluding the source port. 882 // ExcludeL7SourceInfo - Aggregate over all other fields ignoring the source aggregated name, namespace, and type. 883 // +kubebuilder:validation:Pattern=`^(?i)(IncludeL7SourceInfo|IncludeL7SourceInfoNoPort|ExcludeL7SourceInfo)?$` 884 L7LogsFileAggregationSourceInfo *string `json:"l7LogsFileAggregationSourceInfo,omitempty" validate:"omitempty,l7SourceAggregation"` 885 // L7LogsFileAggregationResponseCode is used to choose the type of aggregation for the response code on L7 log entries. 886 // [Default: IncludeL7ResponseCode - include the response code]. 887 // Accepted values are IncludeL7ResponseCode and ExcludeL7ResponseCode. 888 // IncludeL7ResponseCode - Include the response code in the logs. 889 // ExcludeL7ResponseCode - Aggregate over all other fields ignoring the response code. 890 // +kubebuilder:validation:Pattern=`^(?i)(IncludeL7ResponseCode|ExcludeL7ResponseCode)?$` 891 L7LogsFileAggregationResponseCode *string `json:"l7LogsFileAggregationResponseCode,omitempty" validate:"omitempty,l7ResponseCodeAggregation"` 892 // L7LogsFileAggregationTrimURL is used to choose the type of aggregation for the url on L7 log entries. 893 // [Default: IncludeL7FullURL - include the full URL up to however many path components are allowed by L7LogsFileAggregationNumURLPath]. 894 // Accepted values: 895 // IncludeL7FullURL - Include the full URL up to however many path components are allowed by L7LogsFileAggregationNumURLPath. 896 // TrimURLQuery - Aggregate over all other fields ignoring the query parameters on the URL. 897 // TrimURLQueryAndPath - Aggregate over all other fields and the base URL only. 898 // ExcludeL7URL - Aggregate over all other fields ignoring the URL entirely. 899 // +kubebuilder:validation:Pattern=`^(?i)(IncludeL7FullURL|TrimURLQuery|TrimURLQueryAndPath|ExcludeL7URL)?$` 900 L7LogsFileAggregationTrimURL *string `json:"l7LogsFileAggregationTrimURL,omitempty" validate:"omitempty,l7URLAggregation"` 901 // L7LogsFileAggregationNumURLPath is used to choose the number of components in the url path to display. 902 // This allows for the url to be truncated in case parts of the path provide no value. Setting this value 903 // to negative will allow all parts of the path to be displayed. 904 // [Default: 5]. 905 L7LogsFileAggregationNumURLPath *int `json:"l7LogsFileAggregationNumURLPath,omitempty"` 906 // Limit on the length of the URL collected in L7 logs. When a URL length reaches this limit 907 // it is sliced off, and the sliced URL is sent to log storage. [Default: 250] 908 L7LogsFileAggregationURLCharLimit *int `json:"l7LogsFileAggregationURLCharLimit,omitempty"` 909 // Limit on the number of L7 logs that can be emitted within each flush interval. When 910 // this limit has been reached, Felix counts the number of unloggable L7 responses within 911 // the flush interval, and emits a WARNING log with that count at the same time as it 912 // flushes the buffered L7 logs. A value of 0 means no limit. [Default: 1500] 913 L7LogsFilePerNodeLimit *int `json:"l7LogsFilePerNodeLimit,omitempty"` 914 915 // WindowsNetworkName specifies which Windows HNS networks Felix should operate on. The default is to match 916 // networks that start with "calico". Supports regular expression syntax. 917 WindowsNetworkName *string `json:"windowsNetworkName,omitempty"` 918 919 // RouteSource configures where Felix gets its routing information. 920 // - WorkloadIPs: use workload endpoints to construct routes. 921 // - CalicoIPAM: the default - use IPAM data to construct routes. 922 // +kubebuilder:validation:Pattern=`^(?i)(WorkloadIPs|CalicoIPAM)?$` 923 RouteSource string `json:"routeSource,omitempty" validate:"omitempty,routeSource"` 924 925 // Calico programs additional Linux route tables for various purposes. 926 // RouteTableRanges specifies a set of table index ranges that Calico should use. 927 // Deprecates`RouteTableRange`, overrides `RouteTableRange`. 928 RouteTableRanges *RouteTableRanges `json:"routeTableRanges,omitempty" validate:"omitempty,dive"` 929 930 // Deprecated in favor of RouteTableRanges. 931 // Calico programs additional Linux route tables for various purposes. 932 // RouteTableRange specifies the indices of the route tables that Calico should use. 933 RouteTableRange *RouteTableRange `json:"routeTableRange,omitempty" validate:"omitempty"` 934 935 // EgressIPSupport defines three different support modes for egress IP function. [Default: Disabled] 936 // - Disabled: Egress IP function is disabled. 937 // - EnabledPerNamespace: Egress IP function is enabled and can be configured on a per-namespace basis; 938 // per-pod egress annotations are ignored. 939 // - EnabledPerNamespaceOrPerPod: Egress IP function is enabled and can be configured per-namespace or per-pod, 940 // with per-pod egress annotations overriding namespace annotations. 941 // +kubebuilder:validation:Pattern=`^(?i)(Disabled|EnabledPerNamespace|EnabledPerNamespaceOrPerPod)?$` 942 EgressIPSupport string `json:"egressIPSupport,omitempty" validate:"omitempty,oneof=Disabled EnabledPerNamespace EnabledPerNamespaceOrPerPod"` 943 // EgressIPVXLANPort is the port number of vxlan tunnel device for egress traffic. [Default: 4790] 944 EgressIPVXLANPort *int `json:"egressIPVXLANPort,omitempty"` 945 // EgressIPVXLANVNI is the VNI ID of vxlan tunnel device for egress traffic. [Default: 4097] 946 EgressIPVXLANVNI *int `json:"egressIPVXLANVNI,omitempty"` 947 // EgressIPRoutingRulePriority controls the priority value to use for the egress IP routing rule. [Default: 100] 948 EgressIPRoutingRulePriority *int `json:"egressIPRoutingRulePriority,omitempty" validate:"omitempty,gt=0,lt=32766"` 949 // EgressGatewayPollInterval is the interval at which Felix will poll remote egress gateways to check their 950 // health. Only Egress Gateways with a named "health" port will be polled in this way. Egress Gateways that 951 // fail the health check will be taken our of use as if they have been deleted. 952 // +kubebuilder:validation:Type=string 953 // +kubebuilder:validation:Pattern=`^([0-9]+(\\.[0-9]+)?(ms|s|m|h))*$` 954 EgressGatewayPollInterval *metav1.Duration `json:"egressGatewayPollInterval,omitempty" configv1timescale:"seconds"` 955 // EgressGatewayPollFailureCount is the minimum number of poll failures before a remote Egress Gateway is considered 956 // to have failed. 957 EgressGatewayPollFailureCount *int `json:"egressGatewayPollFailureCount,omitempty" validate:"omitempty,gt=0"` 958 959 // RouteSyncDisabled will disable all operations performed on the route table. Set to true to 960 // run in network-policy mode only. 961 RouteSyncDisabled *bool `json:"routeSyncDisabled,omitempty"` 962 963 // ExternalNetworkSupport defines two different support modes for external network function. [Default: Disabled] 964 // - Disabled: External network function is disabled. 965 // - Enabled: External network function is enabled. 966 // +kubebuilder:validation:Pattern=`^(?i)(Disabled|Enabled)?$` 967 ExternalNetworkSupport string `json:"externalNetworkSupport,omitempty" validate:"omitempty,oneof=Disabled Enabled"` 968 // ExternalNetworkRoutingRulePriority controls the priority value to use for the external network routing rule. [Default: 102] 969 ExternalNetworkRoutingRulePriority *int `json:"externalNetworkRoutingRulePriority,omitempty" validate:"omitempty,gt=0,lt=32766"` 970 971 // WireguardEnabled controls whether Wireguard is enabled for IPv4 (encapsulating IPv4 traffic over an IPv4 underlay network). [Default: false] 972 WireguardEnabled *bool `json:"wireguardEnabled,omitempty"` 973 // WireguardEnabledV6 controls whether Wireguard is enabled for IPv6 (encapsulating IPv6 traffic over an IPv6 underlay network). [Default: false] 974 WireguardEnabledV6 *bool `json:"wireguardEnabledV6,omitempty"` 975 // WireguardListeningPort controls the listening port used by IPv4 Wireguard. [Default: 51820] 976 WireguardListeningPort *int `json:"wireguardListeningPort,omitempty" validate:"omitempty,gt=0,lte=65535"` 977 // WireguardListeningPortV6 controls the listening port used by IPv6 Wireguard. [Default: 51821] 978 WireguardListeningPortV6 *int `json:"wireguardListeningPortV6,omitempty" validate:"omitempty,gt=0,lte=65535"` 979 // WireguardRoutingRulePriority controls the priority value to use for the Wireguard routing rule. [Default: 99] 980 WireguardRoutingRulePriority *int `json:"wireguardRoutingRulePriority,omitempty" validate:"omitempty,gt=0,lt=32766"` 981 // WireguardInterfaceName specifies the name to use for the IPv4 Wireguard interface. [Default: wireguard.cali] 982 WireguardInterfaceName string `json:"wireguardInterfaceName,omitempty" validate:"omitempty,interface"` 983 // WireguardInterfaceNameV6 specifies the name to use for the IPv6 Wireguard interface. [Default: wg-v6.cali] 984 WireguardInterfaceNameV6 string `json:"wireguardInterfaceNameV6,omitempty" validate:"omitempty,interface"` 985 // WireguardMTU controls the MTU on the IPv4 Wireguard interface. See Configuring MTU [Default: 1440] 986 WireguardMTU *int `json:"wireguardMTU,omitempty"` 987 // WireguardMTUV6 controls the MTU on the IPv6 Wireguard interface. See Configuring MTU [Default: 1420] 988 WireguardMTUV6 *int `json:"wireguardMTUV6,omitempty"` 989 // WireguardHostEncryptionEnabled controls whether Wireguard host-to-host encryption is enabled. [Default: false] 990 WireguardHostEncryptionEnabled *bool `json:"wireguardHostEncryptionEnabled,omitempty"` 991 // WireguardKeepAlive controls Wireguard PersistentKeepalive option. Set 0 to disable. [Default: 0] 992 // +kubebuilder:validation:Type=string 993 // +kubebuilder:validation:Pattern=`^([0-9]+(\\.[0-9]+)?(ms|s|m|h))*$` 994 WireguardPersistentKeepAlive *metav1.Duration `json:"wireguardKeepAlive,omitempty"` 995 996 // +kubebuilder:validation:MinLength=1 997 // CaptureDir controls directory to store file capture. [Default: /var/log/calico/pcap] 998 CaptureDir *string `json:"captureDir,omitempty" validate:"omitempty,gt=0"` 999 1000 // +kubebuilder:validation:Minimum=1 1001 // CaptureMaxSizeBytes controls the max size of a file capture. [Default: 10000000] 1002 CaptureMaxSizeBytes *int `json:"captureMaxSizeBytes,omitempty" validate:"omitempty,gt=0"` 1003 1004 // +kubebuilder:validation:Minimum=1 1005 // CaptureRotationSeconds controls the time rotation of a packet capture. [Default: 3600] 1006 CaptureRotationSeconds *int `json:"captureRotationSeconds,omitempty" validate:"omitempty,gt=0"` 1007 1008 // +kubebuilder:validation:Minimum=1 1009 // CaptureMaxFiles controls number of rotated capture file to keep. [Default: 2] 1010 CaptureMaxFiles *int `json:"captureMaxFiles,omitempty" validate:"omitempty,gt=0"` 1011 1012 // Set source-destination-check on AWS EC2 instances. Accepted value must be one of "DoNothing", "Enable" or "Disable". 1013 // [Default: DoNothing] 1014 AWSSrcDstCheck *AWSSrcDstCheckOption `json:"awsSrcDstCheck,omitempty" validate:"omitempty,oneof=DoNothing Enable Disable"` 1015 // AWSSecondaryIPSupport controls whether Felix will try to provision AWS secondary ENIs for 1016 // workloads that have IPs from IP pools that are configured with an AWS subnet ID. If the field is set to 1017 // "EnabledENIPerWorkload" then each workload with an AWS-backed IP will be assigned its own secondary ENI. 1018 // If set to "Enabled" then each workload with an AWS-backed IP pool will be allocated a secondary IP address 1019 // on a secondary ENI; this mode requires additional IP pools to be provisioned for the host to claim IPs for 1020 // the primary IP of the secondary ENIs. Accepted value must be one of "Enabled", "EnabledENIPerWorkload" or 1021 // "Disabled". [Default: Disabled] 1022 // +kubebuilder:validation:Pattern=`^(?i)(Enabled|EnabledENIPerWorkload|Disabled)?$` 1023 AWSSecondaryIPSupport string `json:"awsSecondaryIPSupport,omitempty" validate:"omitempty,oneof=Enabled EnabledENIPerWorkload Disabled"` 1024 // AWSSecondaryIPRoutingRulePriority controls the priority that Felix will use for routing rules when programming 1025 // them for AWS Secondary IP support. [Default: 101] 1026 AWSSecondaryIPRoutingRulePriority *int `json:"awsSecondaryIPRoutingRulePriority,omitempty" validate:"omitempty,gte=0,lte=4294967295"` 1027 // AWSRequestTimeout is the timeout on AWS API requests. [Default: 30s] 1028 // +kubebuilder:validation:Type=string 1029 // +kubebuilder:validation:Pattern=`^([0-9]+(\\.[0-9]+)?(ms|s|m|h))*$` 1030 AWSRequestTimeout *metav1.Duration `json:"awsRequestTimeout,omitempty" configv1timescale:"seconds"` 1031 1032 // When service IP advertisement is enabled, prevent routing loops to service IPs that are 1033 // not in use, by dropping or rejecting packets that do not get DNAT'd by kube-proxy. 1034 // Unless set to "Disabled", in which case such routing loops continue to be allowed. 1035 // [Default: Drop] 1036 // +kubebuilder:validation:Pattern=`^(?i)(Drop|Reject|Disabled)?$` 1037 ServiceLoopPrevention string `json:"serviceLoopPrevention,omitempty" validate:"omitempty,oneof=Drop Reject Disabled"` 1038 1039 // WorkloadSourceSpoofing controls whether pods can use the allowedSourcePrefixes annotation to send traffic with a source IP 1040 // address that is not theirs. This is disabled by default. When set to "Any", pods can request any prefix. 1041 // +kubebuilder:validation:Pattern=`^(?i)(Disabled|Any)?$` 1042 WorkloadSourceSpoofing string `json:"workloadSourceSpoofing,omitempty" validate:"omitempty,oneof=Disabled Any"` 1043 1044 // MTUIfacePattern is a regular expression that controls which interfaces Felix should scan in order 1045 // to calculate the host's MTU. 1046 // This should not match workload interfaces (usually named cali...). 1047 // +optional 1048 MTUIfacePattern string `json:"mtuIfacePattern,omitempty" validate:"omitempty,regexp"` 1049 1050 // TPROXYMode sets whether traffic is directed through a transparent proxy 1051 // for further processing or not and how is the proxying done. 1052 // [Default: Disabled] 1053 // +kubebuilder:validation:Pattern=`^(?i)(Disabled|Enabled|EnabledAllServices)?$` 1054 TPROXYMode string `json:"tproxyMode,omitempty" validate:"omitempty,oneof=Disabled Enabled EnabledAllServices"` 1055 // TPROXYPort sets to which port proxied traffic should be redirected. 1056 // [Default: 16001] 1057 TPROXYPort *int `json:"tproxyPort,omitempty" validate:"omitempty,gt=0,lte=65535"` 1058 // TPROXYUpstreamConnMark tells Felix which mark is used by the proxy for its upstream 1059 // connections so that Felix can program the dataplane correctly. [Default: 0x17] 1060 TPROXYUpstreamConnMark *uint32 `json:"tproxyUpstreamConnMark,omitempty" validate:"omitempty,gt=0"` 1061 1062 // FloatingIPs configures whether or not Felix will program non-OpenStack floating IP addresses. (OpenStack-derived 1063 // floating IPs are always programmed, regardless of this setting.) 1064 // 1065 // +optional 1066 FloatingIPs *FloatingIPType `json:"floatingIPs,omitempty" validate:"omitempty"` 1067 1068 // WindowsManageFirewallRules configures whether or not Felix will program Windows Firewall rules. (to allow inbound access to its own metrics ports) [Default: Disabled] 1069 // +optional 1070 WindowsManageFirewallRules *WindowsManageFirewallRulesMode `json:"windowsManageFirewallRules,omitempty" validate:"omitempty,oneof=Enabled Disabled"` 1071 } 1072 1073 type HealthTimeoutOverride struct { 1074 Name string `json:"name"` 1075 Timeout metav1.Duration `json:"timeout"` 1076 } 1077 1078 type RouteTableRange struct { 1079 Min int `json:"min"` 1080 Max int `json:"max"` 1081 } 1082 1083 type RouteTableIDRange struct { 1084 Min int `json:"min"` 1085 Max int `json:"max"` 1086 } 1087 1088 type RouteTableRanges []RouteTableIDRange 1089 1090 func (r RouteTableRanges) NumDesignatedTables() int { 1091 var len int = 0 1092 for _, rng := range r { 1093 len += (rng.Max - rng.Min) + 1 // add one, since range is inclusive 1094 } 1095 1096 return len 1097 } 1098 1099 // ProtoPort is combination of protocol, port, and CIDR. Protocol and port must be specified. 1100 type ProtoPort struct { 1101 Protocol string `json:"protocol"` 1102 Port uint16 `json:"port"` 1103 // +optional 1104 Net string `json:"net"` 1105 } 1106 1107 // New FelixConfiguration creates a new (zeroed) FelixConfiguration struct with the TypeMetadata 1108 // initialized to the current version. 1109 func NewFelixConfiguration() *FelixConfiguration { 1110 return &FelixConfiguration{ 1111 TypeMeta: metav1.TypeMeta{ 1112 Kind: KindFelixConfiguration, 1113 APIVersion: GroupVersionCurrent, 1114 }, 1115 } 1116 }