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
Makefile: new target kind-debug to debug cilium operator & agent in kind cluster #23898
Makefile: new target kind-debug to debug cilium operator & agent in kind cluster #23898
Conversation
793021a
to
0d7b5e9
Compare
0d7b5e9
to
b755893
Compare
/test |
b755893
to
c82cb75
Compare
runtime container images were outdated /test |
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.
Nice work, thanks! I have a couple of questions about the details in the operator images where ideally we could reduce the amount of duplicate logic. Then there's one more discussion point I'm not sure about the resolution yet but where it may help to have additional input from the developer community.
ci-verifier required but still not triggered automatically in case of missing datapath changes /ci-verifier |
/test-1.16-4.19 |
4f80fbf
to
03ce875
Compare
rebased to master to fix conflicts with updated go 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.
Just some minor nits but the latest version looks good overall. I'm just not 100% sure about how to ensure these changes end up in the canonical builder images and how we can ensure all dependent images are synced up properly.
(I also didn't manually test this myself)
03ce875
to
a68d32d
Compare
a68d32d
to
f9de268
Compare
This commit adds the debug target for debugging the cilium operator within a k8s kind cluster. Signed-off-by: Marco Hofstetter <marco.hofstetter@isovalent.com>
This commit adds the debug target for debugging the cilium operator within a k8s kind cluster. Signed-off-by: Marco Hofstetter <marco.hofstetter@isovalent.com>
This commit adds the possibility to configure the debug port as environment variable DEBUG_PORT. It still defaults to 2345. This adds the possibility to use the debug-wrapper for the cilium operator which needs to expose the debugger on a different port than the agent. Signed-off-by: Marco Hofstetter <marco.hofstetter@isovalent.com>
This commit adds a new make target kind-debug which builds & deploys the cilium agent & operator in a local kind cluster for debugging with delve. Signed-off-by: Marco Hofstetter <marco.hofstetter@isovalent.com>
Signed-off-by: Marco Hofstetter <marco.hofstetter@isovalent.com>
With this commit, the operator debug port gets exposed on every kind node. In addition, the operator pod gets pinned to node kind-worker (via a nodeSelector on the hostname) which eases debuggability. This is possible due to the default podAntiAffinity, which ensures, that only one operator pod is running on one k8s node. Signed-off-by: Marco Hofstetter <marco.hofstetter@isovalent.com>
This commit introduces a new docker target debug which provides the possibility to build a cilium operator image which includes the debug-wrapper. Signed-off-by: Marco Hofstetter <marco.hofstetter@isovalent.com>
…inue By passing the environment variable DEBUG_CONTINUE=true to the make target, the devle flag --continue is set. This way, the cilium agent & operator don't wait for an attached debugger. Without this change, it might gets a tedious action to attach the debugger to all pods. Signed-off-by: Marco Hofstetter <marco.hofstetter@isovalent.com>
Delve should be go installed with CGO=0 in the cilium builder image. This enables to use the binary in images based upon scratch (e.g. cilium operator) Signed-off-by: Marco Hofstetter <marco.hofstetter@isovalent.com>
the debug wrapper go binary should be built and put into the builder image alongside installing the delve binary. Signed-off-by: Marco Hofstetter <marco.hofstetter@isovalent.com>
the debug-wrapper based on bash has been replaced with a statically linked go binary which is also usable in images not having bash on its PATH. Signed-off-by: Marco Hofstetter <marco.hofstetter@isovalent.com>
f9de268
to
4c6f2a4
Compare
By replacing the bash-based debug-wrapper with a statically linked go binary - the debug image of the operator can base upon the release stage which doesn't include bash (scratch). Signed-off-by: Marco Hofstetter <marco.hofstetter@isovalent.com>
By default, the debugger continues at startup. If this is undesired, the environment variable DEBUG_HOLD=true can be set to build the image with the delve flag --continue=false. Signed-off-by: Marco Hofstetter <marco.hofstetter@isovalent.com>
4c6f2a4
to
7cdc47b
Compare
Signed-off-by: Marco Hofstetter <marco.hofstetter@isovalent.com>
/test |
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.
LGTM thanks!
not automatically triggered / reported /ci-verifier |
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.
Thanks!
# Typical image bulids will stop above at the 'release' target, but | ||
# developers follow this Dockerfile to the end. Starting from a release | ||
# image, install delve debugger and wrap the cilium-operator binary calls | ||
# with a script that automatically provisions the debugger on a |
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.
Super nit:
# with a script that automatically provisions the debugger on a | |
# with the statically linked debug-wrapper binary that automatically provisions the debugger on a |
Only worth addressing in case there are other change requests.
A new make target
kind-debug
has been added. In addition tomake kind-debug-agent
it adds the possibility to debug the cilium operator beside the agents.It follows the same ideas which has been introduced for the cilium agent in #21108
To allow easy remote-debugging of the operator, the following points has been addressed:
--continue
to remove the need to attach a debugger to all instances. (deactivate by setting environment variableDEBUG_HOLD=true make kind-debug
)