fix: add exercices on vpa (#26)

This commit is contained in:
Rémy-Christophe Schermesser 2019-05-21 11:06:49 +02:00 committed by GitHub
parent 94786096ab
commit a618a76282
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 42 additions and 4 deletions

View File

@ -75,11 +75,49 @@ VPA means `Vertical Pod Autoscaler`. It automatically find the right resources f
This feature is in beta, understand you can install it in your cluster but it's not integrate with the standard Kubernetes source code. This feature is in beta, understand you can install it in your cluster but it's not integrate with the standard Kubernetes source code.
If you are adventurous you can try it by: Testing the VPA requires some work. You need to have "metric-server" installed:
1. Install [metrics-server](https://github.com/kubernetes-incubator/metrics-server#deployment). ```sh
1. Install the [vpa](https://github.com/kubernetes/autoscaler/tree/master/vertical-pod-autoscaler). minikube addons enable metrics-server
1. Try the exemple from the [vpa github repo](https://github.com/kubernetes/autoscaler/tree/master/vertical-pod-autoscaler#test-your-installation) ```
1. Clone the [autoscaler](https://github.com/kubernetes/autoscaler) reposority:
```sh
git clone git@github.com:kubernetes/autoscaler.git
```
1. Install the [vpa](https://github.com/kubernetes/autoscaler/tree/master/vertical-pod-autoscaler):
```sh
cd vertical-pod-autoscaler && ./hack/vpa-up.sh
```
1. Try the exemple from the [vpa github repo](https://github.com/kubernetes/autoscaler/tree/master/vertical-pod-autoscaler#test-your-installation):
```sh
kubectl apply -f examples/hamster.yaml
```
Look at the file [hamster.yaml](https://github.com/kubernetes/autoscaler/tree/master/vertical-pod-autoscaler/examples). It contains the VPA definition:
```yaml
apiVersion: "autoscaling.k8s.io/v1beta2"
kind: VerticalPodAutoscaler
metadata:
name: hamster-vpa
spec:
targetRef:
apiVersion: "extensions/v1beta1"
kind: Deployment
name: hamster
```
The only interesting part is the `targetRef`. It's only which Kubernetes object the VPA will act on. Here the `Deployment` named `hamster`.
The second part is a regular deployment, that have undersized CPU `requests`.
After applying those manifest, look at the resources requests for the deployment.
## Exercices ## Exercices