Skip to content
/ keda Public

KEDA is a Kubernetes-based Event Driven Autoscaling component. It provides event driven scale for any container running in Kubernetes

License

Notifications You must be signed in to change notification settings

kedacore/keda

Repository files navigation

Branch Status
master CircleCI

Kore - Event driven autoscaler and scale to zero for Kubernetes

Kore allows for fine grained autoscaling (including to/from zero) for event driven Kubernetes workloads. Kore serves as a Kubernetes Metrics Server and allows users to define autoscaling rules using a dedicated CRD.

Kore can run on both the cloud and the edge, integrates natively with Kubernetes components such as the Horizontal Pod Autoscaler, and has no external dependencies.

k

Setup

Prerequisites

  1. A Kubernetes cluster (instructions).

    Make sure your Kubernetes cluster is RBAC enabled. For AKS cluster ensure that you download the AKS cluster credentials with the following CLI

  az aks get-credentials -n <cluster-name> -g <resource-group>
  1. Kubectl has been installed and configured to work with your cluster (instructions).

  2. docker login -u "b514b60c-68cc-4f12-b361-3858878b2479" -p '4jX5vkPTSrUQ96UBbU/B7CQrBoJwT62WSs5WfZtFbB8=' projectkore.azurecr.io

Deploy Kore

Clone the repo:

git clone https://github.com/Azure/Kore.git

Deploy CRD to your cluster:

kubectl apply -f ./Kore/deploy

Getting Started

Development

Prerequisites

  1. The Go language environment (instructions).

    Make sure you've already configured your GOPATH and GOROOT environment variables.

  2. Dep (instructions).

Environment set up

First, clone the repo into your GOPATH:

cd $GOPATH/src
mkdir -p github.com/Azure/Kore
git clone https://github.com/Azure/Kore

Run dep:

cd $GOPATH/src/github.com/Azure/Kore
dep ensure

Run the code locally:

# bash
CONFIG=/path/to/.kube/config go run cmd/main.go

#Powershell
$Env:CONFIG=/path/to/.kube/config
go run cmd/main.go

Create a functions project:

  1. Create a standard functions project:
  1. Build a docker container for your functions:

Add a .dockerignore

local.settings.json
deploy.yaml

Add a Dockerfile depending on the language of your functions

dotnet:

FROM microsoft/dotnet:2.1-sdk AS installer-env

COPY . /src/dotnet-function-app
RUN cd /src/dotnet-function-app && \
    mkdir -p /home/site/wwwroot && \
    dotnet publish *.csproj --output /home/site/wwwroot

FROM mcr.microsoft.com/azure-functions/dotnet:2.0
ENV AzureWebJobsScriptRoot=/home/site/wwwroot

COPY --from=installer-env ["/home/site/wwwroot", "/home/site/wwwroot"]

javascript:

FROM mcr.microsoft.com/azure-functions/node:2.0

ENV AzureWebJobsScriptRoot=/home/site/wwwroot
COPY . /home/site/wwwroot
RUN cd /home/site/wwwroot && \
    npm install

python:

FROM mcr.microsoft.com/azure-functions/python:2.0

COPY . /home/site/wwwroot

RUN cd /home/site/wwwroot && \
    pip install -r requirements.txt

Build your container

docker build -t {IMAGE_NAME} .

Push your container to a container registry

docker push {IMAGE_NAME}
  1. Add your connection strings in local.settings.json

e.g:

{
  "IsEncrypted": false,
  "Values": {
    ...
    "AzureWebJobsStorage": "DefaultEndpointsProtocol=https;AccountName={name};AccountKey=......",
    ...
  }
}
  1. Download this build of core-tools:

    1. windows
    2. linux
    3. mac
  2. Run

func kdeploy --image-name {image_name_from_above}
  1. Deploy to your k8s cluster
kubectl create -f deploy.yaml

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.