-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Fix issue for debug containers when using custom Docker registry #3873
Conversation
68c5a25
to
5c5efc9
Compare
Thanks @javaducky, looks pretty exhaustive! 🎉
It causes a panic, presumably because |
Awesome, thank you! I'll get that fixed and make sure to run those tests locally. Lots of angles with this ;) |
906dbb3
to
4392950
Compare
@alpeb I've corrected the |
Thanks @javaducky . Do you mind merging against master before we resume reviewing? |
5e5fbc8
to
079cd17
Compare
@alpeb, this should be good again given the rebase to latest master. |
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.
This is great work, @javaducky!
Just as a thought, what do you think about putting the debug sidecar image configuration in the Proxy config object rather than creating a new Debug config object? This is what we have done for the proxy-init container and I think it's reasonable to treat the Proxy config object as configuration for all injected sidecar containers.
@adleong thanks, I'm definitely having fun with this project! As for your suggestion, including the debug configuration options in the Having the separation from the proxy felt a bit cleaner to me, but I'm totally fine with including it in the As I mentioned, I'm fine either way and it's not a huge pain to change if one option is deemed preferable over another. Other than including @alpeb again, I'm unsure of who else should be asked to weigh their opinion. @grampelberg I'm guessing? Please let know! |
I chatted briefly with @alpeb and we think it makes sense to put this in the proxy config (i.e. option 2). |
Cool...not a problem! I should have those changes turned around pretty quick. |
fbd1aa7
to
c0a0954
Compare
Updated "Validation" section of PR given most recent usage change. |
c0a0954
to
e1efc88
Compare
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 @javaducky , this is even more solid 👍 Also thanks for the going the extra mile with the tests 😃
I've just got a couple of minor comments before approving 😉
4dc63ac
to
f62f4cb
Compare
@alpeb fyi, the tests are currently failing; presumably until https://github.com/linkerd/linkerd2/pull/3923/files is merged into master and rebased into this branch. I'll let you know once it should be safe to continue review. I'm currently building with these changes and will confirm they correct things. |
f62f4cb
to
4f08a49
Compare
…debug containers (linkerd#3851) This fix creates the following a new "debug" configuration section. This allows for more consistent usage as with proxyImage and proxyInitImage. Registry flag does not set registry for debug container linkerd#3851 Signed-off-by: Paul Balogh <javaducky@gmail.com>
…issue Signed-off-by: Paul Balogh <javaducky@gmail.com>
…n of configs Signed-off-by: Paul Balogh <javaducky@gmail.com>
Signed-off-by: Paul Balogh <javaducky@gmail.com>
…a new data.debug section Signed-off-by: Paul Balogh <javaducky@gmail.com>
Signed-off-by: Paul Balogh <javaducky@gmail.com>
…on inject Signed-off-by: Paul Balogh <javaducky@gmail.com>
…ride and correction to README Signed-off-by: Paul Balogh <javaducky@gmail.com>
Signed-off-by: Paul Balogh <javaducky@gmail.com>
Signed-off-by: Paul Balogh <javaducky@gmail.com>
d81da22
to
dac07b9
Compare
…date for README Signed-off-by: Paul Balogh <javaducky@gmail.com>
dac07b9
to
08005f7
Compare
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've spot checked the inject output and run integration tests on this branch and everything looks good to me!
Thanks for your hard work on this, @javaducky!
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.
Tests and spot check ran successfully for me as well.
LGTM!
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.
Looks good to me 👍 🥇
It is of note that grpc_server.go
(and its test file) were amended for the Config()
endpoint to return the install flags as well. That ended up not being used after all, but I think that's still a valuable fix to leave in 👍
Yeah, I forgot that I left that in after removing the lookup of install flags. |
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.
Had a look at the code, LGTM!
Thank you so much for working on this 💯
Subject
Fixes bug where override of Docker registry was not being applied to debug containers (#3851)
Problem
Overrides for Docker registry are not being applied to debug containers and provide no means to correct the image.
Solution
This update expands the
data.proxy
configuration section within the LinkerdConfigMap
to maintain the overridden image name for debug containers at install-time similar to handling of theproxy
andproxyInit
images.This change also enables the further override option of the registry for debug containers at inject-time given utilization of the
--registry
CLI option.Validation
Several new unit tests have been created to confirm functionality. In addition, the following workflows were run through:
Standard Workflow with Custom Registry
This workflow installs Linkerd control plane based upon a custom registry, then injecting the debug sidecar into a service.
bin/docker-build
docker tag gcr.io/linkerd-io/debug:git-a4ebecb6 javaducky.com/linkerd-io/debug:git-a4ebecb6
bin/linkerd install --registry=javaducky.com/linkerd-io | kubectl apply -f -
linkerd-config
ConfigMap now contains the debug image name, pull policy, and version within thedata.proxy
sectionkubectl -n emojivoto get deploy/voting -o yaml | bin/linkerd inject --enable-debug-sidecar - | kubectl apply -f -
kubectl -n emojivoto logs deploy/voting linkerd-debug -f
config.linkerd.io/enable-debug-sidecar
annotation, setting to “false”, should show that the pod will be recreated no longer running the debug container.Overriding the Custom Registry Override at Injection
This builds upon the “Standard Workflow with Custom Registry” by overriding the Docker registry utilized for the debug container at the time of injection.
--registry
option as inkubectl -n emojivoto get deploy/voting -o yaml | bin/linkerd inject --enable-debug-sidecar --registry=gcr.io/linkerd-io - | kubectl apply -f -
config.linkerd.io/debug-image
having the debug container from the new registry. Viewing the running pod should show that thelinkerd-debug
container was injected and running the correct image. Of note, the proxy and proxy-init images are still running the “original” override images.config.linkerd.io/enable-debug-sidecar
annotation setting to “false”, should show that the pod will be recreated no longer running the debug container.Standard Workflow with Default Registry
This workflow is the typical workflow which utilizes the standard Linkerd image registry.
bin/linkerd install --ignore-cluster | kubectl delete -f -
as described at https://linkerd.io/2/tasks/uninstall/curl -sL https://run.linkerd.io/emojivoto.yml | kubectl delete -f -
then reinstall usingcurl -sL https://run.linkerd.io/emojivoto.yml | kubectl apply -f -
bin/linkerd install | kubectl apply -f -
linkerd-config
ConfigMap references the default debug image ofgcr.io/linkerd-io/debug
within thedata.proxy
sectionkubectl -n emojivoto get deploy/voting -o yaml | bin/linkerd inject --enable-debug-sidecar - | kubectl apply -f -
kubectl -n emojivoto logs deploy/voting linkerd-debug -f
config.linkerd.io/enable-debug-sidecar
annotation, setting to “false”, should show that the pod will be recreated no longer running the debug container.Overriding the Default Registry at Injection
This workflow builds upon the “Standard Workflow with Default Registry” by overriding the Docker registry utilized for the debug container at the time of injection.
--registry
option as inkubectl -n emojivoto get deploy/voting -o yaml | bin/linkerd inject --enable-debug-sidecar --registry=javaducky.com/linkerd-io - | kubectl apply -f -
config.linkerd.io/debug-image
having the debug container from the new registry. Viewing the running pod should show that thelinkerd-debug
container was injected and running the correct image. Of note, the proxy and proxy-init images are still running the “original” override images.config.linkerd.io/enable-debug-sidecar
annotation setting to “false”, should show that the pod will be recreated no longer running the debug container.Fixes issue #3851
Signed-off-by: Paul Balogh javaducky@gmail.com