-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: rename plugin to vpa-recommendation
Related to kubernetes-sigs/krew-index#1923
- Loading branch information
Showing
14 changed files
with
150 additions
and
95 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 |
---|---|---|
|
@@ -53,4 +53,4 @@ coverage.txt | |
|
||
# Build | ||
dist/ | ||
kubectl-commitment | ||
./kubectl-vpa-recommendation |
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,43 +1,55 @@ | ||
apiVersion: krew.googlecontainertools.github.com/v1alpha2 | ||
kind: Plugin | ||
metadata: | ||
name: commitment | ||
name: vpa-recommendation | ||
spec: | ||
version: {{ .TagName }} | ||
homepage: https://github.com/wI2L/kubectl-commitment | ||
shortDescription: Compare VerticalPodAutoscaler recommendations to actual resources requests | ||
homepage: https://github.com/wI2L/kubectl-vpa-recommendation | ||
shortDescription: Compare VPA recommendations to actual resources requests | ||
description: | | ||
This plugin prints a table that show the percentage increase/decrease | ||
of the selected VerticalPodAutoscaler recommendations compared to the | ||
targeted controller's pod resource requests. | ||
caveats: | | ||
The plugin recognizes only some well-known controllers such as: | ||
- CronJob | ||
- DaemonSet | ||
- Deployment | ||
- Job | ||
- ReplicaSet | ||
- ReplicationController | ||
- StatefulSet | ||
The autoscaling.k8s.io/v1 API is required for the plugin to work: | ||
https://github.com/kubernetes/autoscaler/tree/master/vertical-pod-autoscaler | ||
platforms: | ||
- selector: | ||
matchLabels: | ||
os: darwin | ||
arch: amd64 | ||
{{addURIAndSha "https://github.com/wI2L/kubectl-commitment/releases/download/{{ .TagName }}/kubectl-commitment_darwin_amd64.tar.gz" .TagName }} | ||
bin: kubectl-commitment | ||
- selector: | ||
matchLabels: | ||
os: darwin | ||
arch: arm64 | ||
{{addURIAndSha "https://github.com/wI2L/kubectl-commitment/releases/download/{{ .TagName }}/kubectl-commitment_darwin_arm64.tar.gz" .TagName }} | ||
bin: kubectl-commitment | ||
- selector: | ||
matchLabels: | ||
os: linux | ||
arch: amd64 | ||
{{addURIAndSha "https://github.com/wI2L/kubectl-commitment/releases/download/{{ .TagName }}/kubectl-commitment_linux_amd64.tar.gz" .TagName }} | ||
bin: kubectl-commitment | ||
- selector: | ||
matchLabels: | ||
os: linux | ||
arch: arm64 | ||
{{addURIAndSha "https://github.com/wI2L/kubectl-commitment/releases/download/{{ .TagName }}/kubectl-commitment_linux_arm64.tar.gz" .TagName }} | ||
bin: kubectl-commitment | ||
- selector: | ||
matchLabels: | ||
os: windows | ||
arch: amd64 | ||
{{addURIAndSha "https://github.com/wI2L/kubectl-commitment/releases/download/{{ .TagName }}/kubectl-commitment_windows_amd64.zip" .TagName }} | ||
bin: kubectl-commitment.exe | ||
- selector: | ||
matchLabels: | ||
os: darwin | ||
arch: amd64 | ||
{{addURIAndSha "https://github.com/wI2L/kubectl-vpa-recommendation/releases/download/{{ .TagName }}/kubectl-vpa-recommendation_{{ .TagName }}_darwin_amd64.tar.gz" .TagName }} | ||
bin: kubectl-vpa-recommendation | ||
- selector: | ||
matchLabels: | ||
os: darwin | ||
arch: arm64 | ||
{{addURIAndSha "https://github.com/wI2L/kubectl-vpa-recommendation/releases/download/{{ .TagName }}/kubectl-vpa-recommendation_{{ .TagName }}_darwin_arm64.tar.gz" .TagName }} | ||
bin: kubectl-vpa-recommendation | ||
- selector: | ||
matchLabels: | ||
os: linux | ||
arch: amd64 | ||
{{addURIAndSha "https://github.com/wI2L/kubectl-vpa-recommendation/releases/download/{{ .TagName }}/kubectl-vpa-recommendation_{{ .TagName }}_linux_amd64.tar.gz" .TagName }} | ||
bin: kubectl-vpa-recommendation | ||
- selector: | ||
matchLabels: | ||
os: linux | ||
arch: arm64 | ||
{{addURIAndSha "https://github.com/wI2L/kubectl-vpa-recommendation/releases/download/{{ .TagName }}/kubectl-vpa-recommendation_{{ .TagName }}_linux_arm64.tar.gz" .TagName }} | ||
bin: kubectl-vpa-recommendation | ||
- selector: | ||
matchLabels: | ||
os: windows | ||
arch: amd64 | ||
{{addURIAndSha "https://github.com/wI2L/kubectl-vpa-recommendation/releases/download/{{ .TagName }}/kubectl-vpa-recommendation_{{ .TagName }}_windows_amd64.zip" .TagName }} | ||
bin: kubectl-vpa-recommendation.exe |
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,10 +1,10 @@ | ||
# kubectl commitment | ||
# `kubectl vpa-recommendation` | ||
|
||
<p align="left"> | ||
<a href="https://github.com/wI2L/kubectl-commitment/actions"><img src="https://github.com/wI2L/kubectl-commitment/workflows/ci/badge.svg"></a> | ||
<a href="https://goreportcard.com/report/github.com/wI2L/kubectl-commitment"><img src="https://goreportcard.com/badge/github.com/wI2L/kubectl-commitment"></a> | ||
<a href="https://github.com/wI2L/kubectl-commitment/releases"><img src="https://img.shields.io/github/v/tag/wI2L/kubectl-commitment?color=blueviolet&label=release&sort=semver"></a> | ||
<img src="https://codecov.io/gh/wI2L/kubectl-commitment/branch/master/graph/badge.svg?token=UTD8CW2ZS2"/> | ||
<a href="https://github.com/wI2L/kubectl-vpa-recommendation/actions"><img src="https://github.com/wI2L/kubectl-vpa-recommendation/workflows/ci/badge.svg"></a> | ||
<a href="https://goreportcard.com/report/github.com/wI2L/kubectl-vpa-recommendation"><img src="https://goreportcard.com/badge/github.com/wI2L/kubectl-vpa-recommendation"></a> | ||
<a href="https://github.com/wI2L/kubectl-vpa-recommendation/releases"><img src="https://img.shields.io/github/v/tag/wI2L/kubectl-vpa-recommendation?color=blueviolet&label=release&sort=semver"></a> | ||
<img src="https://codecov.io/gh/wI2L/kubectl-vpa-recommendation/branch/master/graph/badge.svg?token=UTD8CW2ZS2"/> | ||
<a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg"></a> | ||
</p> | ||
|
||
|
@@ -14,23 +14,30 @@ The plugin is compatible with Kubernetes servers starting from version 1.16, whi | |
|
||
## Installation | ||
|
||
### With [Krew](https://krew.sigs.k8s.io/) | ||
|
||
```shell | ||
$ kubectl krew install vpa-recommendation | ||
$ kubectl vpa-recommendation --help | ||
``` | ||
|
||
### Manual download | ||
|
||
Head to the [releases](https://github.com/wI2L/kubectl-commitment/releases) page to download an existing release for your OS/arch, and add the path to the binary to your `$PATH`. | ||
Head to the [releases](https://github.com/wI2L/kubectl-vpa-recommendation/releases) page to download an existing release for your OS/arch, and add the path to the binary to your `$PATH`. | ||
|
||
### Build from source | ||
|
||
:warning: `kubectl-commitment` requires [Go 1.17+](https://golang.org/doc/install) to build. | ||
:warning: `kubectl-vpa-recommendation` requires [Go 1.17+](https://golang.org/doc/install) to build. | ||
|
||
To build the plugin yourself from the source, use the following commands: | ||
|
||
```shell | ||
$ git clone [email protected]:wI2L/kubectl-commitment.git | ||
$ cd kubectl-commitment | ||
$ git clone [email protected]:wI2L/kubectl-vpa-recommendation.git | ||
$ cd kubectl-vpa-recommendation | ||
$ make build | ||
``` | ||
|
||
It creates a single binary file for the host machine platform/architecture in the `dist/` folder. Move it somewhere within your `$PATH`, such as `$GOPATH/bin`. You can then invoke it directly (`kubectl-commitment`), or via `kubectl` (`kubectl commitment`). | ||
It creates a single binary file for the host machine platform/architecture in the `dist/` folder. Move it somewhere within your `$PATH`, such as `$GOPATH/bin`. You can then invoke it directly (`kubectl-vpa-recommendation`), or via `kubectl` (`kubectl vpa-recommendation`). | ||
|
||
## Usage | ||
|
||
|
@@ -63,12 +70,12 @@ Apart from the flags defined by the [`genericclioptions`](https://pkg.go.dev/k8s | |
To view the full list of available options, use the following command: | ||
|
||
```shell | ||
$ kubectl commitment --help | ||
$ kubectl vpa-recommendation --help | ||
``` | ||
|
||
## Limitations | ||
|
||
- Unlike the [official VPA recommender](https://github.com/kubernetes/autoscaler/blob/master/vertical-pod-autoscaler/pkg/recommender/README.md), which is fully generic and handle any kind of "scalable" resources, the plugin only recognize the *well-known* controllers such as: `CronJob`, `DaemonSet`, `Deployment`, `Job`, `ReplicaSet`, `ReplicationController`, `StatefulSet`. | ||
- Unlike the [official VPA recommender](https://github.com/kubernetes/autoscaler/blob/master/vertical-pod-autoscaler/pkg/recommender/README.md), which is fully generic and handle any kind of "scalable" resources, the plugin recognize only some *well-known* controllers such as: `CronJob`, `DaemonSet`, `Deployment`, `Job`, `ReplicaSet`, `ReplicationController`, `StatefulSet`. | ||
|
||
## License | ||
|
||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module github.com/wI2L/kubectl-commitment | ||
module github.com/wI2L/kubectl-vpa-recommendation | ||
|
||
go 1.17 | ||
|
||
|
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
Oops, something went wrong.