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

WIP: Integrating the new k8s-metacollector + k8smeta plugin with falco 0.36.2 #598

Conversation

alacuku
Copy link
Member

@alacuku alacuku commented Jan 4, 2024

What type of PR is this?

Uncomment one (or more) /kind <> lines:

/kind bug

/kind cleanup

/kind design

/kind documentation

/kind failing-test

/kind feature

If this PR will release a new chart version please make sure to also uncomment the following line:

/kind chart-release

Any specific area of the project related to this PR?

Uncomment one (or more) /area <> lines:

/area falco-chart

/area falco-exporter-chart

/area falcosidekick-chart

/area event-generator-chart

/area k8s-metacollector

What this PR does / why we need it:

This PR updates the Falco charts to leverage the new k8s-metacollector and k8smeta plugin.

How to deploy:

# Clone the right branch.
git clone --branch kcl/falco-integrate-k8s-metacollector --single-branch https://github.com/alacuku/charts.git

# Change directory to Falco chart.
cd charts/charts/falco

# Build dependencies.
helm dependency build

# Install falco + k8smeta plugin and the k8s-metacollector in namespace falco.
helm install falco ./ -n falco --create-namespace --set tty=true

# Install falco + k8smeta plugin in namespace falco and the k8s-metacollector in namespace collector.
kubectl create namespace collector
helm install falco ./ 
    -n falco \
    --create-namespace \
    --set k8s-metacollector.namespaceOverride=collector \
    --set tty=true

Check that the pods are in place:

kubectl get pods -n falco

You should have something like (the number of Falco pods will depend on the number of your nodes):

NAME                                       READY   STATUS    RESTARTS   AGE
falco-dkntd                                2/2     Running   0          27m
falco-k8s-metacollector-674dc59c98-sblwv   1/1     Running   0          27m

NOTE: The new fields exported by the plugins start with prefix k8smeta. The container runtime engines still use the old prefix k8s. The majority of those fields will return <NA>. Please update your old fields to match the ones of the plugin.

Some implementation details of this PR:

The old kubernetes collector has been replaced by the k8smeta plugin. The k8s-metacollector chart has been added as a dependency to the Falco chart and is enabled by default. The Falco and falcoctl configurations are updated at deployment time by a custom helper. It does the following:

  • Adds the k8smeta plugin to the load_plugins list;
  • Adds the k8smeta plugin configuration to the plugins section;
  • Adds the plugin artifact type to the allowedTypes in the falcoctl configuration;
  • Adds the pluigin OCI references to the falcoctl install references.

Furthermore, all the resources needed by Falco to connect to the k8s api-server has been removed:

  • service account;
  • cluster role;
  • cluster role binding;
    Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Checklist

  • Chart Version bumped
  • Variables are documented in the README.md
  • CHANGELOG.md updated

The defualt mode to get kubernetes metadata is using the
k8s-metacollector and the k8smeta plugin. This commit
adds the required helpers and variables to enable the
k8s-metacollector by default.

Signed-off-by: Aldo Lacuku <[email protected]>
@poiana
Copy link
Contributor

poiana commented Jan 4, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: alacuku
Once this PR has been reviewed and has the lgtm label, please assign issif for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@poiana poiana requested review from bencer and leogr January 4, 2024 10:18
@poiana poiana added the size/XXL label Jan 4, 2024
@alacuku
Copy link
Member Author

alacuku commented Jan 4, 2024

/hold

The PR is only for testing the new k8s-metacollector and k8smeta plugin.

@alacuku alacuku changed the title Integrating the new k8s-metacollector + k8smeta plugin with falco 0.36.2 WIP: Integrating the new k8s-metacollector + k8smeta plugin with falco 0.36.2 Jan 9, 2024
@alacuku
Copy link
Member Author

alacuku commented Jan 30, 2024

/close

Not more relevant. See #601

@poiana poiana closed this Jan 30, 2024
@poiana
Copy link
Contributor

poiana commented Jan 30, 2024

@alacuku: Closed this PR.

In response to this:

/close

Not more relevant. See #601

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

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

Successfully merging this pull request may close these issues.

2 participants