Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bonny.Server.Scheduler #55

Closed
coryodaniel opened this issue Jun 25, 2019 · 0 comments
Closed

Bonny.Server.Scheduler #55

coryodaniel opened this issue Jun 25, 2019 · 0 comments
Assignees

Comments

@coryodaniel
Copy link
Owner

coryodaniel commented Jun 25, 2019

Kubernetes scheduler server.

All nodes and pods are automatically selected from Bonny.Config.cluster_name/0. pods/0 and nodes/0 are overridable callbacks of Bonny.Server.Scheduler

defmodule MyScheduler do
  use Bonny.Server.Scheduler, name: "foo"

  @impl Bonny.Server.Scheduler
  def select_node_for_pod(_pod, nodes) do
    nodes
    |> Stream.filter(fn(node) ->
      name = K8s.Resource.name(node)
      String.contains?(name, "preempt")
    end)
    |> Enum.take(1)
    |> List.first
  end
end

MyScheduler.start_link()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant