-
Notifications
You must be signed in to change notification settings - Fork 208
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
cOdiglet to use criwrapper to create ic #2015
cOdiglet to use criwrapper to create ic #2015
Conversation
298dd4b
to
613ebf4
Compare
7311ce9
to
b2978f7
Compare
runtimeDetailsByContainer: | ||
description: Capture Runtime Details for the workloads that this CR | ||
applies to. | ||
items: | ||
properties: | ||
containerName: | ||
type: string | ||
criErrorMessage: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isnt status a better place for error messages instead of spec?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
potentially could be some error on specific container, we will have to verify this before instrumenting a container from the webhook
k8sutils/pkg/cri/criwrapper.go
Outdated
for _, endpoint := range defaultRuntimeEndpoints { | ||
rc.Logger.Info("Attempting to connect to CRI runtime", "endpoint", endpoint) | ||
|
||
rc.conn, err = grpc.NewClient( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure this is actually trying to connect and not just creating a client?
Few thoughts:
- As only one of the default Endpoints will respond - maybe worth putting a timeout when opening a connection as some of them will just time out so we can bail quickly
- I think the CRI implementation is part of the container id in Kubernetes maybe we can use that (for example getting the container id of the current Odiglet Pod) and connector only to the right one instead of trying all the options
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I Warp it up as a Connect() - The function’s primary purpose is to connect to the CRI runtime, which it achieves by establishing and validating a gRPC connection.
I change the logic so it will try to find the unix domain socket in the FS so we wont need to iterate over them and try to connect to each one of them
} | ||
|
||
// Check if status is already set | ||
if len(currentConfig.Status.RuntimeDetailsByContainer) != 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not update always? This means only the first Odiglet that runs this wins, so we will not update the value if the user changed the docker image?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
correct, it wont work with cases where user changed the value exists in Dockerfile.
we design this solution with this gap in mind
71831ff
to
1c14d62
Compare
odiglet/pkg/kube/runtime_details/instrumentationconfigs_controller.go
Outdated
Show resolved
Hide resolved
…ting over multiple pods
ca8cee9
to
05e1f53
Compare
975c7f3
to
c679274
Compare
abdb8d1
to
717dfb7
Compare
7acfbac
to
bd9bf89
Compare
bb3f5ef
to
80737f1
Compare
No description provided.