Skip to content

Commit

Permalink
Init k8s (2.0) (#1493)
Browse files Browse the repository at this point in the history
* initialize k8s adapters

* better error message
  • Loading branch information
johrstrom authored Oct 25, 2021
1 parent 40f65f8 commit 086e533
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
5 changes: 2 additions & 3 deletions apps/dashboard/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,14 @@ GEM
ood_core (~> 0.1)
rails (> 4.0.7, < 6.0)
redcarpet (~> 3.2)
ood_core (0.17.6)
activesupport (>= 5.2, < 6.0)
ood_core (0.18.1)
ffi (~> 1.9, >= 1.9.6)
ood_support (~> 0.0.2)
ood_support (0.0.3)
pbs (2.2.1)
ffi (~> 1.9, >= 1.9.6)
public_suffix (4.0.6)
racc (1.5.2)
racc (1.6.0)
rack (2.2.3)
rack-protection (2.1.0)
rack
Expand Down
11 changes: 11 additions & 0 deletions apps/dashboard/config/initializers/k8s.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# frozen_string_literal: true

# bootstrap all the kuberenetes clusters if there are any
OodAppkit.clusters.select(&:kubernetes?).each do |cluster|
require 'ood_core/job/adapters/kubernetes'
require 'ood_core/job/adapters/kubernetes/batch'

OodCore::Job::Adapters::Kubernetes::Batch.configure_kube!(cluster.job_config)
rescue StandardError, LoadError => e
Rails.logger.error("could not initialize k8s cluster #{cluster.id} because of error '#{e.message}'")
end

0 comments on commit 086e533

Please sign in to comment.