Skip to content

Kubernetes pod autoscaler based on queue size in AWS SQS

Notifications You must be signed in to change notification settings

iflix/k8s-sqs-autoscaler

This branch is up to date with mbatchkarov/k8s-sqs-autoscaler:djm.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

4b9161d · Dec 11, 2018

History

17 Commits
Nov 8, 2018
Dec 11, 2018
Dec 11, 2018
Aug 19, 2018
Jul 23, 2018
Dec 11, 2018
Aug 19, 2018
Dec 11, 2018
Jul 23, 2018
Dec 11, 2018
Dec 11, 2018

Repository files navigation

k8s-sqs-autoscaler

Kubernetes pod autoscaler based on queue size in AWS SQS

Usage

Create a kubernetes deployment like this:

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: my-k8s-autoscaler
spec:
  revisionHistoryLimit: 1
  replicas: 1
  template:
    metadata:
      labels:
        app: my-k8s-autoscaler
    spec:
      containers:
      - name: my-k8s-autoscaler
        image: sideshowbandana/k8s-sqs-autoscaler:1.0.0
        command:
          - ./k8s-sqs-autoscaler
          - --sqs-queue-url=https://sqs.$(AWS_REGION).amazonaws.com/$(AWS_ID)/$(SQS_QUEUE) # required
          - --kubernetes-deployment=$(KUBERNETES_DEPLOYMENT)
          - --kubernetes-namespace=$(K8S_NAMESPACE) # optional
          - --aws-region=us-west-2  #required
          - --poll-period=10 # optional
          - --scale-down-cool-down=30 # optional
          - --scale-up-cool-down=10 # optional
          - --scale-up-messages=20 # optional
          - --scale-down-messages=10 # optional
          - --max-pods=30 # optional
          - --min-pods=1 # optional
        env:
          - name: K8S_NAMESPACE
            valueFrom:
              fieldRef:
                fieldPath: metadata.namespace
        resources:
          requests:
            memory: "64Mi"
            cpu: "250m"
          limits:
            memory: "1512Mi"
            cpu: "500m"
        ports:
        - containerPort: 80

About

Kubernetes pod autoscaler based on queue size in AWS SQS

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 94.9%
  • Dockerfile 2.7%
  • Makefile 2.4%