Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions vertical-pod-autoscaler/docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ resource recommendations, this ensures that all Pods with a matching VPA object
recreate them after eviction. Furthermore, it avoids misconfigurations that happened in the past when label selectors
were specified manually.

> [!WARNING]
> VPA can only manage Pods that are directly owned by the targeted Custom Resource. It does not support indirect ownership (e.g., targeting a resource that owns another controller, which in turn owns the Pods).
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also mentioned that we are currently working to find a solution?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really want to make promises about the future, I'd rather just say how it is.
If anyone is interested, they can go looking at issues


### How can I use Prometheus as a history provider for the VPA recommender

Configure your Prometheus to get metrics from cadvisor. Make sure that the metrics from the cadvisor have the label `job=kubernetes-cadvisor`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ func simpleControllerFetcher() *controllerFetcher {
f.informersMap = make(map[wellKnownController]cache.SharedIndexInformer)
f.scaleSubresourceCacheStorage = newControllerCacheStorage(time.Second, time.Minute, 0.1)
versioned := map[string][]metav1.APIResource{
"Foo": {{Kind: "Foo", Name: "bah", Group: "foo"}, {Kind: "Scale", Name: "iCanScale", Group: "foo"}},
"Foo": {
{Kind: "NotScalingResource", Name: "iCanNotScale", Group: "foo"},
{Kind: "ScalingResource", Name: "iCanScale", Group: "foo"},
},
Comment on lines +62 to +65
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this :)

}
fakeMapper := []*restmapper.APIGroupResources{
{
Expand All @@ -76,8 +79,8 @@ func simpleControllerFetcher() *controllerFetcher {
scaleNamespacer := &scalefake.FakeScaleClient{}
f.scaleNamespacer = scaleNamespacer

// return not found if if tries to find the scale subresource on bah
scaleNamespacer.AddReactor("get", "bah", func(action core.Action) (handled bool, ret runtime.Object, err error) {
// return not found if it tries to find the scale subresource on iCanNotScale
scaleNamespacer.AddReactor("get", "iCanNotScale", func(action core.Action) (handled bool, ret runtime.Object, err error) {
groupResource := schema.GroupResource{}
err = apierrors.NewNotFound(groupResource, "Foo")
return true, nil, err
Expand Down Expand Up @@ -330,14 +333,14 @@ func TestControllerFetcher(t *testing.T) {
{
APIVersion: "Foo/Foo",
Controller: &trueVar,
Kind: "Foo",
Name: "bah",
Kind: "NotScalingResource",
Name: "iCanNotScale",
},
},
},
}},
expectedKey: &ControllerKeyWithAPIVersion{ControllerKey: ControllerKey{
Name: testDeployment, Kind: "Deployment", Namespace: testNamespace}}, // Parent does not support scale subresource so should return itself"
Name: testDeployment, Kind: "Deployment", Namespace: testNamespace}}, // Parent does not support scale subresource so should return itself
expectedError: nil,
},
{
Expand All @@ -356,14 +359,14 @@ func TestControllerFetcher(t *testing.T) {
{
APIVersion: "Foo/Foo",
Controller: &trueVar,
Kind: "Scale",
Kind: "ScalingResource",
Name: "iCanScale",
},
},
},
}},
expectedKey: &ControllerKeyWithAPIVersion{ControllerKey: ControllerKey{
Name: "iCanScale", Kind: "Scale", Namespace: testNamespace}, ApiVersion: "Foo/Foo"}, // Parent supports scale subresource"
Name: "iCanScale", Kind: "ScalingResource", Namespace: testNamespace}, ApiVersion: "Foo/Foo"}, // Parent supports scale subresource so it is returned
expectedError: nil,
},
{
Expand Down Expand Up @@ -395,7 +398,7 @@ func TestControllerFetcher(t *testing.T) {
name: "custom resource with no scale subresource",
key: &ControllerKeyWithAPIVersion{
ApiVersion: "Foo/Foo", ControllerKey: ControllerKey{
Name: "bah", Kind: "Foo", Namespace: testNamespace},
Name: "iCanNotScale", Kind: "NotScalingResource", Namespace: testNamespace},
},
objects: []runtime.Object{},
expectedKey: nil, // Pod owner does not support scale subresource so should return nil"
Expand Down