gorya

module
v0.0.0-...-d17f45c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 2, 2024 License: MIT

README

logo

Gorya

Scheduler for compute instances across clouds. A Golang port of Doiintl's Zorya.

Build status

Supported Resources

  • AWS:
  • EC2
  • RDS
  • EKS
  • GCP:
  • EC2
  • CLOUDSQL
  • GKE
  • AZURE:
  • AZURE VIRTUAL MACHINE

Building Gorya

Software requirements

Setup your environments

By default, in-mem sqlite is used but MySQL is recommended for production setup.

Option 1: Set up with docker-compose
  1. Create a new directory for project if not exists.
mkdir -p ~/go/src/github.com/nduyphuong/gorya
  1. Clone the source code
cd ~/go/src/github.com/nduyphuong/gorya
git clone https://github.com/nduyphuong/gorya
  1. Set up the stack with docker
cd ~/go/src/github.com/nduyphuong/gorya
docker-compose up -d
  1. Setup keycloak
Client:

Alt text Make sure that Access Type is public and Web Origins is http://localhost:3000 or *

Roles:

Gorya rely on keycloak for doing identity and access management. List of role to configure for gorya client:

  • add-policy
  • add-schedule
  • delete-policy
  • delete-schedule
  • get-policy
  • get-schedule
  • get-timezone
  • list-policy
  • list-schedule Alt text
Github:

Create a github oauth app for keycloak.

Keycloak github identity provider setting: Alt text

sequenceDiagram
autonumber
actor U as User
participant UI as Gorya UI
participant K as Keycloak
participant IDP as Upstream Identity Provider
participant BE as Gorya Backend

U->>UI: Unauthenticated user
UI->>K: Redirects to Keycloak
K->>U: Login page
U->>K: Choose Identity Provider
K->>U: Return Identity Provider login page
U->>IDP: Enter credential
IDP->>UI: Return JWT Token
UI->>UI: Extract access token
UI->>BE: Send request with authorization header
BE->>K: Verify access token, with associated role in keycloak
BE->>UI: Response
Option 2: Set up with helm

TBD

How it works

sequenceDiagram
autonumber
actor U as User
participant G as Gorya
participant Q as GoryaQueue
participant P as Gorya Processor
participant C as Cloud Provider APIs

loop Every 60 Minutes
U->>G: Create off time schedule
G->>Q: Dispatch task
end
P->>Q: Process next item
P->>C: Change resource status

Directories

Path Synopsis
internal
api
os
signals
Package signals contains libraries for handling signals to gracefully shutdown the manager in combination with Kubernetes pod graceful termination policy.
Package signals contains libraries for handling signals to gracefully shutdown the manager in combination with Kubernetes pod graceful termination policy.
pkg
aws
gcp

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL