All Projects → West-Coast-Devops → scheduled-scaler

West-Coast-Devops / scheduled-scaler

Licence: Apache-2.0 license
No description or website provided.

Programming Languages

go
31211 projects - #10 most used programming language
Mustache
554 projects
shell
77523 projects
Makefile
30231 projects

Projects that are alternatives of or similar to scheduled-scaler

laravel-php-k8s
Just a simple port of renoki-co/php-k8s for easier access in Laravel
Stars: ✭ 71 (+4.41%)
Mutual labels:  cluster, gke, k8s
Kube Aliases
Kubernetes Aliases and Bash Functions
Stars: ✭ 40 (-41.18%)
Mutual labels:  cluster, k8s
codis-operator
Codis Operator creates and manages codis clusters(proxy based Redis cluster solution) running in kubernetes.(WIP)
Stars: ✭ 21 (-69.12%)
Mutual labels:  k8s, crd
Ansible Role K3s
Ansible role for installing k3s as either a standalone server or HA cluster.
Stars: ✭ 132 (+94.12%)
Mutual labels:  cluster, k8s
Victoriametrics
VictoriaMetrics: fast, cost-effective monitoring solution and time series database
Stars: ✭ 5,558 (+8073.53%)
Mutual labels:  cluster, k8s
Scalecube Services
ScaleCube Services is a high throughput, low latency reactive microservices library built to scale. it features: API-Gateways, service-discovery, service-load-balancing, the architecture supports plug-and-play service communication modules and features. built to provide performance and low-latency real-time stream-processing. its open and designed to accommodate changes. (no sidecar in a form of broker or any kind)
Stars: ✭ 482 (+608.82%)
Mutual labels:  cluster, k8s
Php K8s
PHP K8s is a PHP handler for the Kubernetes Cluster API, helping you handling the individual Kubernetes resources directly from PHP, like viewing, creating, updating or deleting resources.
Stars: ✭ 111 (+63.24%)
Mutual labels:  cluster, k8s
k8s-istio-demo
Demo showing the capabilities of Istio
Stars: ✭ 22 (-67.65%)
Mutual labels:  cluster, k8s
Turing Pi Cluster
Turing Pi cluster configuration for Raspberry Pi Compute Modules
Stars: ✭ 233 (+242.65%)
Mutual labels:  cluster, k8s
Lokomotive
Lokomotive is a 100% open-source, easy to use and secure Kubernetes distribution from the volks at Kinvolk
Stars: ✭ 233 (+242.65%)
Mutual labels:  cluster, k8s
kube-watch
Simple tool to get webhooks on Kubernetes cluster events
Stars: ✭ 21 (-69.12%)
Mutual labels:  cluster, k8s
Kube No Trouble
Easily check your cluster for use of deprecated APIs
Stars: ✭ 280 (+311.76%)
Mutual labels:  cluster, k8s
K8s Tew
Kubernetes - The Easier Way
Stars: ✭ 269 (+295.59%)
Mutual labels:  cluster, k8s
K8s Digitalocean Terraform
Deploy latest Kubernetes cluster on DigitalOcean using Terraform
Stars: ✭ 33 (-51.47%)
Mutual labels:  cluster, k8s
kubernetes-marketplace
Marketplace of Kubernetes applications available for quick and easy installation in to Civo Kubernetes clusters
Stars: ✭ 136 (+100%)
Mutual labels:  cluster, k8s
Kubernetes Pfsense Controller
Integrate Kubernetes and pfSense
Stars: ✭ 100 (+47.06%)
Mutual labels:  cluster, k8s
kube-code-generator
Kubernetes code generator docker image
Stars: ✭ 60 (-11.76%)
Mutual labels:  k8s, crd
kube-alive
Some tools to experiment with Kubernetes to observe it's real-life behavior
Stars: ✭ 32 (-52.94%)
Mutual labels:  cluster, k8s
Gardener
Kubernetes-native system managing the full lifecycle of conformant Kubernetes clusters as a service on Alicloud, AWS, Azure, GCP, OpenStack, EquinixMetal, vSphere, MetalStack, and Kubevirt with minimal TCO.
Stars: ✭ 2,093 (+2977.94%)
Mutual labels:  cluster, k8s
k8s-digester
Add digests to container and init container images in Kubernetes pod and pod template specs. Use either as a mutating admission webhook, or as a client-side KRM function with kpt or kustomize.
Stars: ✭ 65 (-4.41%)
Mutual labels:  gke, k8s

Scheduled Scaler

All Contributors

Docker Image Version (latest semver) Travis (.com) branch

In order to use the ScheduledScaler you will need to install the CRD and deploy the Scaling Controller into your Kubernetes cluster.

Requirements

  • Kubernetes Version: 1.7+
  • Kubernetes Cluster Settings:
    • "Legacy authorization": "Enabled"

Tested Environments

  • Google Kubernetes Engine
    • Kubernetes Version: 1.9.3-gke.0, 1.7.15
    • Docker Version: 1.12.5
    • Golang Version: 1.9.4

Getting Started

Clone this repo

mkdir -p $GOPATH/src/k8s.restdev.com && \
git clone https://github.com/k8s-restdev/scheduled-scaler.git $GOPATH/src/k8s.restdev.com/operators && \
cd $GOPATH/src/k8s.restdev.com/operators

Install using Helm Chart

helm install scheduled-scaler artifacts/kubes/scaling/chart

Note: This uses the image stored at https://hub.docker.com/r/k8srestdev/scaling by default.

See chart README for detailed configuration options

Installation without Helm (and compiling binary yourself):

  1. Install the CRD
kubectl create -f ./artifacts/kubes/scaling/crd.yml
  1. Once you have the repo installed on your local dev you can test, build, push and deploy using make

Note: If you are just looking for a prebuilt image you can find the latest build here. Just add that image tag to the deployment yml in the artificats dir and apply to your kube-system namespace to get up and running without doing a fresh build :D

Using Make

The Makefile provides the following steps:

  1. test - Run go unit tests
  2. build - Build the go bin file and docker image locally
  3. push - Push the built docker image to gcr (or another repository of your choice)
  4. deploy - Deploy the updated image to your Kubernetes cluster

Each of these steps can be run in a single pass or can be used individually.

Examples

  • Do all the things (kubectl)
# This example will test, build, push and deploy using kubectl's currently configured cluster
make OPERATOR=scaling PROJECT_ID=my_project_id
  • Do all the things (kubernodes)
# This example will test, build, push and deploy using kubernodes
make OPERATOR=scaling PROJECT_ID=my_project_id DEPLOYBIN=kn KN_PROJECT_ID=my_kubernodes_project_id

Note: You only need to add KN_PROJECT_ID if it differs from PROJECT_ID

  • Just build the image
make build OPERATOR=scaling PROJECT_ID=my_project_id
  • Just push any image
make push IMAGE=myrepo/myimage:mytag
  • Just deploy any image (kubectl)
make deploy OPERATOR=scaling IMAGE=myrepo/myimage:mytag
  • Just deploy any image (kubernodes)
make deploy OPERATOR=scaling IMAGE=myrepo/myimage:mytag DEPLOYBIN=kn KN_PROJECT_ID=my_kubernodes_project_id

Now that you have all the resources required in your cluster you can begin creating ScheduledScalers.

Scheduled Scaler Spec

Note: This controller uses the following Cron Expression Format

HPA

apiVersion: "scaling.k8s.restdev.com/v1alpha1"
kind: ScheduledScaler
metadata:
  name: my-scheduled-scaler-1
spec:
  timeZone: America/Los_Angeles
  target:
    kind: HorizontalPodAutoscaler
    name: my-hpa
    apiVersion: autoscaling/v1
  steps:
  #run at 5:30am PST
  - runat: '0 30 5 * * *'
    mode: range
    minReplicas: 1
    maxReplicas: 5

Instance Group

apiVersion: "scaling.k8s.restdev.com/v1alpha1"
kind: ScheduledScaler
metadata:
  name: my-scheduled-scaler-2
spec:
  timeZone: America/Los_Angeles
  target:
    kind: InstanceGroup
    name: my-instance-group-name
    apiVersion: compute/v1
  steps:
  #run at 5:30am PST
  - runat: '0 30 5 * * *'
    mode: fixed
    replicas: 3

As you'll see above, you can target either instance groups (if you are on GKE) or hpa, but all the other options are the same.

Options

Option Description Required
spec.timeZone Timezone to run crons in False
spec.target.kind Type of target (InstanceGroup/HorizontalPodAutoscaler) True
spec.target.name Name of the target resource True
spec.target.apiVersion API Version of the target True
spec.steps List of steps True
spec.steps[].runat Cronjob time string (gocron) True
spec.steps[].mode Type of scaling to run (fixed/range) True
spec.steps[].replicas Defined if mode is 'fixed' False
spec.steps[].minReplicas Defined if mode is 'range' False
spec.steps[].maxReplicas Defined if mode is 'range' False

For more details on how this add-on can be used please follow the link below: Learn More...

Contributors

Thanks goes to these wonderful people (emoji key):


Sheridan C Rawlins

🚧 ⚠️ 💻

vnandha

🐛 🚧

so0k

🚇 📖

Andreas Wunderlich

📖

This project follows the all-contributors specification. Contributions of any kind welcome!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].