Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure conntrack cache table size #280

Merged
merged 3 commits into from
Jun 25, 2024
Merged

Conversation

jayanthvn
Copy link
Contributor

Issue #, if available: n/a

Description of changes: Provide a mechanism to increase conntrack cache size to match kernel conntrack table size

Note, this configuration should be made on new nodes before enabling network policy or if network policy is already enabled this would need a reload of the nodes. Dynamic update of conntrack map size would lead to traffic disruption hence we won't support it now..

5: lru_hash  flags 0x0
        key 20B  value 1B  max_entries 524288  memlock 50335744B
        
    --enable-ipv6=false
      --enable-network-policy=true
      --enable-cloudwatch-logs=false
      --enable-policy-event-logs=false
      --metrics-bind-addr=:8162
      --health-probe-bind-addr=:8163
      --conntrack-cache-cleanup-period=300
      --conntrack-cache-table-size=524288
      
Type : 9 ID : 5
Keysize 20 Valuesize 1 MaxEntries 524288
========================================================================================      

We also have a floor and ceil for the configuration -

{"level":"info","ts":"2024-06-20T21:52:13.365Z","logger":"setup","caller":"workspace/main.go:149","msg":"Invalid conntrack cache table size, should be between 32K and 1024K"}{"level":"error","ts":"2024-06-20T21:52:13.365Z","logger":"setup","caller":"workspace/main.go:87","msg":"Controller flags validation failed"}

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

main.go Outdated Show resolved Hide resolved
@jayanthvn
Copy link
Contributor Author

PR updated..

@achevuru achevuru merged commit da05900 into aws:main Jun 25, 2024
4 checks passed

Network Policy agent maintains a local conntrack cache. This configuration (in seconds) will determine how fast the local conntrack cache should be cleaned up from stale/expired entries. Based on the time interval set, network policy agent checks every entry in the local conntrack cache with kernel conntrack table and determine if the entry has to be deleted.

#### `conntrack-table-cache-size` (from v1.1.3+)
Copy link

@younsl younsl Jul 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jayanthvn There's a typo in README.md.

It should be --conntrack-cache-table-size, not --conntrack-table-cache-size to avoid falling into CrashLoopBackOff status.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, will fix this up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants