Standalone mode for OpAMP k8s bridge#4986
Conversation
50b5f7b to
3464209
Compare
E2E Test Results 34 files 259 suites 2h 16m 34s ⏱️ Results for commit 057f69d. ♻️ This comment has been updated with latest results. |
3259be0 to
57e3079
Compare
|
The failing VULN does not affect us. It only affect plugin installs when running docker as a daemon which we do not. We only use it indirectly as an API. more details: GHSA-pxq6-2prw-chj9 Patching is not as simple as docker has deprecated the github.com/docker/docker package and replaced it with multiple smaller packages in github.com/moby/moby/*; and we don't use the docker package directly. The call path is: So each one of those packages will need to migrate to moby to pick up the security patch. I suggest we ignore this vuln as it is essentially a false positive for us and upgrading to a fixed moby version means waiting on close to a dozen OSS packages to do it. migration details: https://github.com/moby/moby/releases/tag/docker-v29.0.0 |
2e90995 to
f2c5727
Compare
|
this is top on my review list, thank you very much for the contribution here and apologies for the delay, i was on PTO. |
9cbc35f to
054483e
Compare
jaronoff97
left a comment
There was a problem hiding this comment.
some requested changes, but overall i would like to see some better test coverage as well as some more thought around the code boundaries. definitely in favor of this, but there's a few open questions I'd like to hear more about.
| case 2: | ||
| return newKubeResourceKey(s[0], s[1]), nil | ||
| case 3: | ||
| return newKubeResourceKeyWithKind(s[1], s[2], s[0]), nil |
There was a problem hiding this comment.
we should validate what kind can be as i would imagine we should only accept cases where kind is either configmap or otelcol
There was a problem hiding this comment.
I think there are other cases for health check on pods, etc that don't have a kind. Proxy mode might also accept identifiers without it but I'm not sure. We do checks on config sent from the server and don't accept anything other than the supported types. So I think we should be ok but happy to add it.
There was a problem hiding this comment.
I implemented it but it made things more complicated for no strong benefits. I think resource key can stay agnostic and bridge mode can validate what it passes in.
|
|
||
| // triggerRollout patches the pod template of each workload in the list with a | ||
| // restart annotation, causing a rolling restart. | ||
| func (c *Client) triggerRollout(ctx context.Context, namespace string, workloads []string) error { |
There was a problem hiding this comment.
like above, i do think we should validate that we have permissions to do this in main
There was a problem hiding this comment.
What is the goal here? Is it to fail fast and report this early or to avoid making these calls if we don't have the permissions? Rollout is an optional feature and users might not even enable it. Even if we do check for permissions, we'd have to do it in all namespaces as any configmap in any namespace could be marked to be managed by the user.
|
Addressed some things. Will add more e2e tests. |
edc4894 to
fec3816
Compare
0612642 to
1180faf
Compare
Introduces a new standalone mode that allows managing collector config from a remote server without requiring Operator CRDs. Adds the standalone client, a plain collector instance type, Kubernetes RBAC and deployment manifests, and a --mode flag to select between operator (default) and standalone at startup.
Description:
This PR implements a basic standlone mode for the OpAMP bridge that works directly on collector configmap(s) instead of operator CRDs. It does not depend on the operator. The ConfigApplier interface almost already satisfies everything we need with some minor tweaks. The change is mostly a new implementation of the ConfigApplier interface that works directly with configmaps.
It watches configmaps with a specific label and reports them to the OpAMP server. Users can then remotely manage that config from the server.
Link to tracking Issue(s):
How to review:
internal/agent&internal/operatorpackages moves things around a bit to allow the new standalone mode to implement the existing Config Applier interface. No new features or changes to existing features in these packages.internal/standalonecontains all of the new feature code. It implements a standalone client and an implementation of the ConfigApplier interface.config/standalone-bridgecontains the k8s manifests used to deploy the bridge in standlone mode.Testing:
Documentation:
Run the bridge with mode flag set to standlone to run in standlone mode.
Add the following label to a configmap you want to manage with the bridge.
Now bridge will report this config to the OpAMP server and server can push updates back. Bridge will trigger a rollign restart after applying config.