🖊️
Notes
  • Notes
  • aws
    • CloudWatch
    • EKS
    • IAM
    • Key Management Service (KMS)
    • security
      • Attacks against AWS infrastructure
    • vpc
      • AWS Transit Gateway
  • azure
    • Azure AD
    • Azure CDN
    • DNS in Azure
    • Hub-spoke network topology
    • Identity and access management
    • Azure Landing zones
    • Storage
  • certifications
    • aws-sa-pro
    • Certified Kubernetes Administrator
  • containers
    • Examples
    • Linux Container Primitives
  • databases
    • Relational databases
  • gcp
    • IAM
  • git
    • Git
  • golang
    • Building Go projects
    • Concurrency
    • Project structure
  • infosec
    • SSH
    • SSL
  • Kubernetes
    • Admission Controllers
    • Autoscaling
    • Debugging
    • Multi-tenancy
    • Network Policies
    • Pod Priority
    • Pod Security Policies
    • Secrets
    • StatefulSet
    • additional-services
      • Debugging ArgoCD RBAC
      • open-policy-agent
  • misc
    • FFmpeg
    • PDFs
  • programming
    • Learning resources
    • concepts
      • Serialization
  • rabbitmq
    • Clustering and HA
    • Shovel plugin
  • shells
    • Bash
  • terraform
    • Moving resources between remote states
  • vim
    • Fzf (plugin)
    • Registers
    • Spell Check
  • linux
    • arch
      • Arch Linux installation
Powered by GitBook
On this page
  • In general
  • Kubernetes requests and limits
  • Kubernetes built-in components
  • Horizontal pod autoscaler (HPA)
  • Vertical pod autoscaler (VPA)
  • Cluster autoscaler (CA)
  • Resources
  1. Kubernetes

Autoscaling

In general

In general, autoscaling can be done on pod or node level in Kubernetes. In most cases, autoscaling is done on CPU or memory usage, or scheduling constraints. It can also be done on custom metrics and thresholds.

Kubernetes requests and limits

Kubernetes requests and limits associate with autoscaling in Kubernetes as they

  • requests

    • what the scheduler should carve out

  • limits

    • enforced at runtime (cgroup)

    • simplified, they are upper bound for resoure usage, making sure that pod does not consumere more resources than what's specified in limits

    • if request is not defined, value of limit is used in its place

Kubernetes built-in components

Horizontal pod autoscaler (HPA)

  • HPA is a controller and it will scale pods by adding new replicas

  • By default HPA will scale by CPU

  • Scaling should be set againt deployment, not replica set

  • For example: kubectl autoscale deployment $DEPLOYMENT --cpu-percent=50 --min=1 --max=10

Vertical pod autoscaler (VPA)

  • In general, VPA scales resources available to pods vertically, meaning pod will get for example more memory and CPU

  • TGIK episode 097 did not touch this extensively

Cluster autoscaler (CA)

  • As CA communicates with the API of a cloud provider, there are certain gotchas with the different cloud providers which should be taken into account when setting up CA

    • For example, currently CA can not handle ASGs which spans multiple AZs. Instead, it expects ASG per AZ

  • CA will scale nodes up if there are scheduling constraints due to lack of resources

Resources

PreviousAdmission ControllersNextDebugging

Last updated 5 years ago

TGI Kubernetes 097, , released 08th November 2018

https://www.youtube.com/watch?v=NY7pyRNrHzE