Branch | Status |
---|---|
master |
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.
-
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>
-
Kubectl has been installed and configured to work with your cluster (instructions).
-
docker login -u "b514b60c-68cc-4f12-b361-3858878b2479" -p '4jX5vkPTSrUQ96UBbU/B7CQrBoJwT62WSs5WfZtFbB8=' projectkore.azurecr.io
Clone the repo:
git clone https://github.com/Azure/Kore.git
Deploy CRD to your cluster:
kubectl apply -f ./Kore/deploy
-
The Go language environment (instructions).
Make sure you've already configured your GOPATH and GOROOT environment variables.
-
Dep (instructions).
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 standard functions project:
- 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}
- Add your connection strings in
local.settings.json
e.g:
{
"IsEncrypted": false,
"Values": {
...
"AzureWebJobsStorage": "DefaultEndpointsProtocol=https;AccountName={name};AccountKey=......",
...
}
}
func kdeploy --image-name {image_name_from_above}
- Deploy to your k8s cluster
kubectl create -f deploy.yaml
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 [email protected] with any additional questions or comments.