-
Notifications
You must be signed in to change notification settings - Fork 72
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
Skip injection for host network pods #48
base: master
Are you sure you want to change the base?
Conversation
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.
👍
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, this looks great! Also, props on unit tests :)
pkg/server/webhook.go
Outdated
@@ -531,6 +531,14 @@ func (whsvr *WebhookServer) mutate(req *v1beta1.AdmissionRequest) *v1beta1.Admis | |||
} | |||
} | |||
|
|||
if injectionConfig.SkipHostNetwork && pod.Spec.HostNetwork { | |||
glog.Infof("Injection skipped by SkipHostNetwork") |
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.
[nit] maybe a more expressive message like "injection skipped due to pod using HostNetwork, and SkipHostNetwork is enabled for this sidecar"?
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 for your review! I've pushed a new commit which prints readable skipping reason, as well as the ns/name of the pod and the name of the sidecar config.
What and why?
Provide the ability to skip the injection for host network pods.
Some sidecars will run
ip rule
,ip route
andiptables
to manipulate traffic to/from the sidecar. This might be dangerous if the pod is runninghostNetwork
. It would be great if the injector configuration can be configured to skip the injection for host network pods, just like Istio.Testing Steps
make test
)Reviewers
Required reviewers:
@byxorna
Request reviews from other people you want to review this PR in the "Reviewers" section on the right.