forked from kubernetes/autoscaler
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'vertical-pod-autoscaler-1.0.0' into vpa-1.0.0
Vertical Pod Autoscaler release 1.0.0
- Loading branch information
Showing
2,077 changed files
with
345,388 additions
and
51,666 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,3 +28,5 @@ | |
Session.vim | ||
.netrwhist | ||
|
||
# Binary files | ||
bin/ |
61 changes: 61 additions & 0 deletions
61
addon-resizer/enhancements/5700-nanny-configuration-reload/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# KEP-5546: Automatic reload of nanny configuration when updated | ||
|
||
<!-- toc --> | ||
- [Summary](#summary) | ||
- [Goals](#goals) | ||
- [Non-Goals](#non-goals) | ||
- [Proposal](#proposal) | ||
- [Notes](#notes) | ||
- [Risks and Mitigations](#risks-and-mitigations) | ||
- [Design Details](#design-details) | ||
- [Test Plan](#test-plan) | ||
<!-- /toc --> | ||
|
||
Sure, here's the enhancement proposal in the requested format: | ||
|
||
## Summary | ||
- **Goals:** The goal of this enhancement is to improve the user experience for applying nanny configuration changes in the addon-resizer 1.8 when used with the metrics server. The proposed solution involves automatically reloading the nanny configuration whenever changes occur, eliminating the need for manual intervention and sidecar containers. | ||
- **Non-Goals:** This proposal does not aim to update the functional behavior of the addon-resizer. | ||
|
||
## Proposal | ||
The proposed solution involves updating the addon-resizer with the following steps: | ||
- Create a file system watcher using `fsnotify` under `utils/fswatcher` to watch nanny configurations' changes. It should run as a goroutine in the background. | ||
- Detect changes of the nanny configurations' file using the created `fswatcher` trigger the reloading process when configuration changes are detected. Events should be sent in a channel. | ||
- Re-execute the method responsible for building the NannyConfiguration `loadNannyConfiguration` to apply the updated configuration to the addon-resizer. | ||
- Proper error handling should be implemented to manage scenarios where the configuration file is temporarily inaccessible or if there are parsing errors in the configuration file. | ||
|
||
### Risks and Mitigations | ||
- There is a potential risk of filesystem-related issues causing the file watcher to malfunction. Proper testing and error handling should be implemented to handle such scenarios gracefully. | ||
- Errors in the configuration file could lead to unexpected behavior or crashes. The addon-resizer should handle parsing errors and fall back to the previous working configuration if necessary. | ||
|
||
## Design Details | ||
- Create a new package for the `fswatcher` under `utils/fswatcher`. It would contain the `fswatcher` struct and methods and unit-tests. | ||
- `FsWatcher` struct would look similar to this: | ||
```go | ||
type FsWatcher struct { | ||
*fsnotify.Watcher | ||
|
||
Events chan struct{} | ||
ratelimit time.Duration | ||
names []string | ||
paths map[string]struct{} | ||
} | ||
``` | ||
- Implement the following functions: | ||
- `CreateFsWatcher`: Instantiates a new `FsWatcher` and start watching on file system. | ||
- `initWatcher`: Initializes the `fsnotify` watcher and initialize the `paths` that would be watched. | ||
- `add`: Adds a new file to watch. | ||
- `reset`: Re-initializes the `FsWatcher`. | ||
- `watch`: watches for the configured files. | ||
- In the main function, we create a new `FsWatcher` and then we wait in an infinite loop to receive events indicating | ||
filesystem changes. Based on these changes, we re-execute `loadNannyConfiguration` function. | ||
|
||
> **Note:** The expected configuration file format is YAML. It has the same structure as the NannyConfiguration CRD. | ||
|
||
### Test Plan | ||
To ensure the proper functioning of the enhanced addon-resizer, the following test plan should be executed: | ||
1. **Unit Tests:** Write unit tests to validate the file watcher's functionality and ensure it triggers events when the configuration file changes. | ||
2. **Manual e2e Tests:** Deploy the addon-resizer with `BaseMemory` of `300Mi` and then we change the `BaseMemory` to `100Mi`. We should observer changes in the behavior of watched pod. | ||
[fsnotify]: https://github.com/fsnotify/fsnotify |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ | |
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
FROM golang:1.20 | ||
FROM golang:1.20.4 | ||
LABEL maintainer="Marcin Wielgus <[email protected]>" | ||
|
||
ENV GOPATH /gopath/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Copyright 2016 The Kubernetes Authors. All rights reserved | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
ARG BASEIMAGE=gcr.io/distroless/static:nonroot-s390x | ||
FROM $BASEIMAGE | ||
LABEL maintainer="Marcin Wielgus <[email protected]>" | ||
|
||
COPY cluster-autoscaler-s390x /cluster-autoscaler | ||
WORKDIR / | ||
CMD ["/cluster-autoscaler"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
approvers: | ||
- BigDarkClown | ||
- feiskyer | ||
- towca | ||
- x13n | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.