Git Product home page Git Product logo

k8s-autoscaling-mirror's Introduction

k8s-autoscaling-mirror

Mirror of k8s.gcr.io/autoscaling/.

DockerHub Badge

gcr.io docker hub
k8s.gcr.io/autoscaling/vpa-updater:0.9.2 zhangsean/vpa-updater:0.9.2
k8s.gcr.io/autoscaling/vpa-recommender:0.9.2 zhangsean/vpa-recommender:0.9.2
k8s.gcr.io/autoscaling/vpa-admission-controller:0.9.2 zhangsean/vpa-admission-controller:0.9.2

Usage

Prerequisites

  • kubectl should be connected to the cluster you want to install VPA in.
  • The metrics server must be deployed in your cluster. Read more about Metrics Server.
  • If you already have another version of VPA installed in your cluster, you have to tear down the existing installation first with:
./hack/vpa-down.sh

Install

# Set env REGISTRY and TAG
export REGISTRY=zhangsean
export TAG=0.9.2
# Get autoscaling scripts
git clone https://github.com/kubernetes/autoscaler.git
cd vertical-pod-autoscaler
# To print YAML contents with all resources that would be understood by kubectl diff|apply|... commands, you can use
./hack/vpa-process-yamls.sh print
# To install VPA
./hack/vpa-up.sh
# Check if all system components are running:
kubectl --namespace=kube-system get pods|grep vpa
# The above command should list 3 pods (recommender, updater and admission-controller) all in state Running.
# Check if the system components log any errors. For each of the pods returned by the previous command do:
kubectl --namespace=kube-system logs [pod name]| grep -e '^E[0-9]\{4\}'
# Check that the VPA Custom Resource Definition was created:
kubectl get customresourcedefinition|grep verticalpodautoscalers

Quick start

A simple way to check if Vertical Pod Autoscaler is fully operational in your cluster is to create a sample deployment and a corresponding VPA config:

kubectl create -f examples/hamster.yaml

Example VPA configuration:

apiVersion: autoscaling.k8s.io/v1
kind: VerticalPodAutoscaler
metadata:
  name: my-app-vpa
spec:
  targetRef:
    apiVersion: "apps/v1"
    kind:       Deployment
    name:       my-app
  updatePolicy:
    updateMode: "Auto"

To see VPA config and current recommended resource requests run:

kubectl describe vpa my-app-vpa

Tear down

Note that if you stop running VPA in your cluster, the resource requests for the pods already modified by VPA will not change

Tear down VPA components:

./hack/vpa-down.sh

Goldilocks

By using the kubernetes vertical-pod-autoscaler in recommendation mode, we can see a suggestion for resource requests on each of our apps. This tool creates a VPA for each deployment in a namespace and then queries them for information.

Installation

helm repo add fairwinds-stable https://charts.fairwinds.com/stable
helm install goldilocks --namespace kube-system fairwinds-stable/goldilocks
# check pods status
kubectl get po -n kube-system | grep goldilocks

# Enable goldilocks VPA in namespace kube-system
kubectl label ns kube-system goldilocks.fairwinds.com/enabled=true
# After that you will see VPA objects in that namespace.
kubectl get vpa -n kube-system
# Get VPA recommended for nginx-ingress-controller
kubectl describe vpa -n kube-system nginx-ingress-controller

Viewing the Dashboard

The default installation creates a ClusterIP service for the dashboard. You can access via ingress:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: goldilocks-dashboard
  namespace: kube-system
spec:
  rules:
  - host: goldilocks.example.com
    http:
      paths:
      - backend:
          serviceName: goldilocks-dashboard
          servicePort: 8080

Then open your browser to http://goldilocks.example.com

Once your VPAs are in place, you'll see recommendations appear in the Goldilocks dashboard:

Goldilocks Screenshot

More info

k8s-autoscaling-mirror's People

Contributors

zhangsean avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

ning1875

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.