module Kumonos::Clusters
Generate clusters configuration.
Constants
- Cluster
Public Class Methods
generate(definition)
click to toggle source
# File lib/kumonos/clusters.rb, line 7 def generate(definition) { clusters: definition['dependencies'].map { |s| Cluster.build(s).to_h } } end
Public Instance Methods
to_h()
click to toggle source
Calls superclass method
# File lib/kumonos/clusters.rb, line 40 def to_h h = super h.delete(:lb) h.delete(:use_sds) if use_sds h[:type] = 'sds' h[:service_name] = name h[:features] = 'http2' else h[:type] = 'strict_dns' h[:hosts] = [{ url: "tcp://#{lb}" }] end h[:lb_type] = 'round_robin' h.delete(:tls) if tls h[:ssl_context] = {} h[:ssl_context][:sni] = lb.split(':', 2)[0] unless use_sds end h.delete(:circuit_breaker) h[:circuit_breakers] = { default: circuit_breaker.to_h } if circuit_breaker if outlier_detection h[:outlier_detection] = outlier_detection.to_h else h.delete(:outlier_detection) end h end