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

Avoid reconciling cluster-wide resources in odiglet #1355

Merged
merged 19 commits into from
Jul 18, 2024

Conversation

edeNFed
Copy link
Contributor

@edeNFed edeNFed commented Jul 15, 2024

No description provided.

@edeNFed edeNFed force-pushed the improve-odiglet-memory branch 2 times, most recently from 8a80e77 to 1d618a3 Compare July 17, 2024 10:42
@edeNFed edeNFed force-pushed the improve-odiglet-memory branch from f1ab300 to 254bd2b Compare July 18, 2024 05:09
@edeNFed edeNFed merged commit df842bc into odigos-io:main Jul 18, 2024
12 checks passed
damemi added a commit that referenced this pull request Jan 31, 2025
OpenShift seems to enable
[OwnerReferencesPermissionEnforcement](https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#ownerreferencespermissionenforcement)
by default, which gives errors like this when setting OwnerReferences:

```
2025-01-29T19:42:38Z	ERROR	Reconciler error	{"controller": "startlangdetection-source", "controllerGroup": "odigos.io", "controllerKind": "Source", "Source": {"name":"source-xsbv2","namespace":"test-project"}, "namespace": "test-project", "name": "source-xsbv2", "reconcileID": "c36405f6-40bb-4eb0-9d5d-fe4bc7802994", "error": "instrumentationconfigs.odigos.io \"deployment-inventory\" is forbidden: cannot set blockOwnerDeletion if an ownerReference refers to a resource you can't set finalizers on: , <nil>"}
```

This basically means wherever we update an ownerreference with
`BlockOwnerDeletion: true` (which is set by the controller-runtime
helpers), we also need permission to update the finalizers for whatever
we're making the owner.

I found this in these places:

* When the autoscaler creates a collector configmap, the owner of the
ConfigMap is the CollectorsGroups. So we need to be able to update
`collectorsgroups/finalizers`
* When the Instrumentor creates an InstrumentationConfig, the owner of
the InstrumentationConfig is the workload. So we need finalizers for
deployments,statefulsets,and daemonsets
* When the odiglet creates an InstrumentationInstance, the owner of the
InstrumentationInstance is also the workload. Same as above

This also adds the SELinux volume mount from
#1131 to the Odiglet init
container added in #1355, along
with making the init container privileged and adding logging for when
the SELinux commands aren't found (this was failing silently)

This also updates the `--openshift` flag to automatically use the
`*-ubi9` images. If no `--image-prefix` is set, the images will be
pulled from `registry.connect.redhat.com/odigos`.
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.

3 participants