-
Notifications
You must be signed in to change notification settings - Fork 4.2k
VPA - Injected sidecar e2e test #2795
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
Conversation
/assign @bskiba |
536a16a
to
204dbe3
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 added some comments to the copied code that you can ignore since they are mostly copied.
Does this actually work with the run-e2e-tests.sh script? I remeber there were issues when I tried extracting the common libs from the v1 and v1beta2 dirs.
) | ||
|
||
const ( | ||
// TODO(krzysied): Update the image url when agnhost:2.10 |
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 comment does not parse in my head
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.
Also it is still relevant? I see 2.10 below.
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 guess something must have interrupted me and I finished the comment with different thought in my head 🤣
I updated the comment and moved it to the test case.
|
||
utils.DeployWebhookAndService(f, agnhostImage, context, servicePort, containerPort, sidecarParam) | ||
|
||
// Webhook must be placed after vpa webhook. Webhooks are registered alphabetically. |
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.
Is this really true that Webhooks are registered alphabetically?
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.
That is horrible, thanks for pointing this out to me.
|
||
// SetupServerCert setups up the server cert. For example, user apiservers and admission webhooks | ||
// can use the cert to prove their identify to the kube-apiserver | ||
func SetupServerCert(namespaceName, serviceName string) *certContext { |
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.
Since we only use it for Webhook, maybe name is SetupWebhookCert?
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.
Done.
I removed serviceName
parameter if we only use it for the specific webhook.
204dbe3
to
98fac1d
Compare
98fac1d
to
f6bbba9
Compare
|
||
ginkgo.By("Adding recommendation for " + sidecarName) | ||
|
||
vpa, err := getVpaClientSet(f).AutoscalingV1().VerticalPodAutoscalers(f.Namespace.Name). |
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 set recommendation up in the first place?
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 though it will be less code with creat + patch. It turned out to be not the greatest idea...
I moved the sidecar recommendation to the hamster vpa setup.
f6bbba9
to
a848665
Compare
a848665
to
eec8ecb
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bskiba The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
The test creates additional webhook that injects sidecar to hamster pods.
Injected sidecars should be in pod container spec, but should not be listed in
VpaObservedContainers
label. Injected sidecars should not cause eviction.ref #2726